public class TTC_Order extends common
{
public void modifiedField(FieldId _fieldId)
{
TTC_Customer customer;
TTC_WomenWear womenwear;
TTC_MenWear menwear;
TTC_KidWear kidwear;
super(_fieldId);
if(_fieldId == fieldNum(TTC_Order,CustomerID))
{
select customer
where customer.ID == this.CustomerID;
this.CustomerName = customer.Name;
this.AccountType = customer.CustomerType;
}
if(_fieldId == fieldNum(TTC_Order,ItemId))
{
if(this.Category == TTC_Category::Kid)
{
select kidwear
where kidwear.ID == this.ItemId;
this.ItemType = kidwear.Type;
}
if(this.Category == TTC_Category::Men)
{
select menwear
where menwear.ID == this.ItemId;
this.ItemType = menwear.Type;
}
if(this.Category == TTC_Category::Women)
{
select womenwear
where womenwear.ID == this.ItemId;
this.ItemType = womenwear.Type;
}
}
if(_fieldId == fieldNum(TTC_Order,Quantity))
{
if(this.Category == TTC_Category::Kid)
{
select kidwear
where kidwear.ID == this.ItemID;
this.Amount = this.Quantity * kidwear.Price;
}
if(this.Category == TTC_Category::Men)
{
select menwear
where menwear.ID == this.ItemID;
this.Amount = this.Quantity * menwear.Price;
}
if(this.Category == TTC_Category::Women)
{
select womenwear
where womenwear.ID == this.ItemID;
this.Amount = this.Quantity * womenwear.Price;
}
}
}
}
{
public void modifiedField(FieldId _fieldId)
{
TTC_Customer customer;
TTC_WomenWear womenwear;
TTC_MenWear menwear;
TTC_KidWear kidwear;
super(_fieldId);
if(_fieldId == fieldNum(TTC_Order,CustomerID))
{
select customer
where customer.ID == this.CustomerID;
this.CustomerName = customer.Name;
this.AccountType = customer.CustomerType;
}
if(_fieldId == fieldNum(TTC_Order,ItemId))
{
if(this.Category == TTC_Category::Kid)
{
select kidwear
where kidwear.ID == this.ItemId;
this.ItemType = kidwear.Type;
}
if(this.Category == TTC_Category::Men)
{
select menwear
where menwear.ID == this.ItemId;
this.ItemType = menwear.Type;
}
if(this.Category == TTC_Category::Women)
{
select womenwear
where womenwear.ID == this.ItemId;
this.ItemType = womenwear.Type;
}
}
if(_fieldId == fieldNum(TTC_Order,Quantity))
{
if(this.Category == TTC_Category::Kid)
{
select kidwear
where kidwear.ID == this.ItemID;
this.Amount = this.Quantity * kidwear.Price;
}
if(this.Category == TTC_Category::Men)
{
select menwear
where menwear.ID == this.ItemID;
this.Amount = this.Quantity * menwear.Price;
}
if(this.Category == TTC_Category::Women)
{
select womenwear
where womenwear.ID == this.ItemID;
this.Amount = this.Quantity * womenwear.Price;
}
}
}
}