Ejemplo n.º 1
0
 public void AddFormPVDetail(int? FormPVID, int ItemID, decimal FinalPrice, decimal Quantity, decimal ExchangeRate, DateTime DeliveryDate)
 {
     PurchaseDS.FormPVDetailRow rowDetail = this.PurchaseDataSet.FormPVDetail.NewFormPVDetailRow();
     rowDetail.FormPVID = FormPVID.GetValueOrDefault();
     MasterData.ItemRow item = new ItemTableAdapter().GetDataByID(ItemID)[0];
     rowDetail.ItemID = ItemID;
     rowDetail.ItemCode = item.ItemCode;
     rowDetail.ItemName = item.ItemName;
     if (!item.IsDescriptionNull()) {
         rowDetail.ItemDescription = item.Description;
     }
     if (!item.IsPackageNull()) {
         rowDetail.Package = item.Package;
     }
     rowDetail.UnitPrice = item.UnitPrice;
     rowDetail.FinalPrice = FinalPrice;
     rowDetail.Quantity = Quantity;
     rowDetail.Amount = decimal.Round(FinalPrice * Quantity, 2);
     rowDetail.AmountRMB = decimal.Round(rowDetail.Amount * ExchangeRate, 2);
     rowDetail.DeliveryDate = DeliveryDate;
     PurchaseDataSet.FormPVDetail.AddFormPVDetailRow(rowDetail);
 }
Ejemplo n.º 2
0
 public void UpdateFormPRDetail(int FormPRDetailID, int ItemID, decimal FinalPrice, decimal Quantity, decimal ExchangeRate, DateTime DeliveryDate, string DeliveryAddress)
 {
     PurchaseDS.FormPRDetailRow rowDetail = this.PurchaseDataSet.FormPRDetail.FindByFormPRDetailID(FormPRDetailID);
     MasterData.ItemRow item = new ItemTableAdapter().GetDataByID(ItemID)[0];
     rowDetail.ItemID = ItemID;
     rowDetail.ItemCode = item.ItemCode;
     rowDetail.ItemName = item.ItemName;
     if (!item.IsDescriptionNull()) {
         rowDetail.ItemDescription = item.Description;
     }
     if (!item.IsPackageNull()) {
         rowDetail.Package = item.Package;
     }
     rowDetail.UnitPrice = item.UnitPrice;
     rowDetail.FinalPrice = FinalPrice;
     rowDetail.Quantity = Quantity;
     rowDetail.Amount = decimal.Round(FinalPrice * Quantity, 2);
     rowDetail.AmountRMB = decimal.Round(rowDetail.Amount * ExchangeRate, 2);
     rowDetail.DeliveryDate = DeliveryDate;
     if (DeliveryAddress != null) {
         rowDetail.DeliveryAddress = DeliveryAddress;
     }
 }