public void UpdateInvoiceRelatedHeaders(BLL.ReceiptInvoice rctInvoice) { this.LoadByReceiptInvoiceID(rctInvoice.ID); if (this.RowCount > 0) { while (!this.EOF) { this.STVOrInvoiceNo = rctInvoice.STVOrInvoiceNo; this.WayBillNo = rctInvoice.WayBillNo; this.InsurancePolicyNo = rctInvoice.InsurancePolicyNo; this.MoveNext(); } this.Save(); } }
public static void SaveList(List<HCMIS.Desktop.STVSyncService.STVDetail> list) { BLL.ReceiptInvoiceDetail bv = new BLL.ReceiptInvoiceDetail(); foreach (HCMIS.Desktop.STVSyncService.STVDetail v in list) { // try to load by primary key BLL.ReceiptInvoice rctInvoice = new BLL.ReceiptInvoice(); rctInvoice.LoadByAccountAndSTVNo(v.AccountID.Value, v.STVNo.Value);// ID.Value); bv.LoadByReceiptInvoiceID(rctInvoice.ID); // if the entry doesn't exist, create it if (bv.RowCount == 0) { bv.AddNew(); bv.ReceiptInvoiceID = rctInvoice.ID; bv.ReceiptInvoiceType = rctInvoice.ReceiptInvoiceType; } // populate the contents of v on the to the database list if (v.ItemID.HasValue) bv.ItemID = v.ItemID.Value; if (v.HubID.HasValue) bv.HubID = v.HubID.Value; if (v.RequisitionNo.HasValue) bv.RequisitionNo = v.RequisitionNo.Value; if (v.STVNo.HasValue) bv.STVNo = v.STVNo.Value; if (v.AccountID.HasValue) bv.AccountID = v.AccountID.Value; if (v.ManufactureID.HasValue) bv.ManufactureID = v.ManufactureID.Value; if (v.Qty.HasValue) bv.Qty = v.Qty.Value; if (v.Batch != "" && v.Batch != null) bv.Batch = v.Batch; if (v.Expiry.HasValue) bv.Expiry = v.Expiry.Value; if (v.UnitCost.HasValue) bv.UnitCost = v.UnitCost.Value; if (v.TotalCost.HasValue) bv.TotalCost = v.TotalCost.Value; bv.Margin = v.Margin; bv.Save(); } }
public static void SaveList(List <HCMIS.Desktop.STVSyncService.STVDetail> list) { BLL.ReceiptInvoiceDetail bv = new BLL.ReceiptInvoiceDetail(); foreach (HCMIS.Desktop.STVSyncService.STVDetail v in list) { // try to load by primary key BLL.ReceiptInvoice rctInvoice = new BLL.ReceiptInvoice(); rctInvoice.LoadByAccountAndSTVNo(v.AccountID.Value, v.STVNo.Value);// ID.Value); bv.LoadByReceiptInvoiceID(rctInvoice.ID); // if the entry doesn't exist, create it if (bv.RowCount == 0) { bv.AddNew(); bv.ReceiptInvoiceID = rctInvoice.ID; bv.ReceiptInvoiceType = rctInvoice.ReceiptInvoiceType; } // populate the contents of v on the to the database list if (v.ItemID.HasValue) { bv.ItemID = v.ItemID.Value; } if (v.HubID.HasValue) { bv.HubID = v.HubID.Value; } if (v.RequisitionNo.HasValue) { bv.RequisitionNo = v.RequisitionNo.Value; } if (v.STVNo.HasValue) { bv.STVNo = v.STVNo.Value; } if (v.AccountID.HasValue) { bv.AccountID = v.AccountID.Value; } if (v.ManufactureID.HasValue) { bv.ManufactureID = v.ManufactureID.Value; } if (v.Qty.HasValue) { bv.Qty = v.Qty.Value; } if (v.Batch != "" && v.Batch != null) { bv.Batch = v.Batch; } if (v.Expiry.HasValue) { bv.Expiry = v.Expiry.Value; } if (v.UnitCost.HasValue) { bv.UnitCost = v.UnitCost.Value; } if (v.TotalCost.HasValue) { bv.TotalCost = v.TotalCost.Value; } bv.Margin = v.Margin; bv.Save(); } }