public override void InitModuleObjectList() { ReceiptItemsList.InitVinaList(this, "ICReceipts", "ICReceiptItems", VinaList <ICReceiptItemsInfo> .cstRelationForeign); ReceiptItemsList.ItemTableForeignKey = "FK_ICReceiptID"; }
public void UpdateTotalAmount() { ICReceiptsInfo mainobject = (ICReceiptsInfo)MainObject; mainobject.ICReceiptSubTotalAmount = ReceiptItemsList.Sum(o => o.ICReceiptItemTotalAmount); mainobject.ICReceiptDiscountAmount = mainobject.ICReceiptSubTotalAmount * mainobject.ICReceiptDiscountPercent / 100; mainobject.ICReceiptTaxAmount = (mainobject.ICReceiptSubTotalAmount - mainobject.ICReceiptDiscountAmount) * mainobject.ICReceiptTaxPercent / 100; mainobject.ICReceiptTotalAmount = mainobject.ICReceiptSubTotalAmount - mainobject.ICReceiptDiscountAmount + mainobject.ICReceiptTaxAmount; UpdateMainObjectBindingSource(); }
public override void SetDefaultModuleObjectsList() { try { ReceiptItemsList.SetDefaultListAndRefreshGridControl(); } catch (Exception) { return; } }
public override void SaveModuleObjects() { ICStockLotsController objStockLotsController = new ICStockLotsController(); ICStockLotsInfo objStockLotsInfo = new ICStockLotsInfo(); ICProductsController objProductsController = new ICProductsController(); ICProductsInfo objProductsInfo = new ICProductsInfo(); ReceiptItemsList.ForEach(o => { objProductsInfo = (ICProductsInfo)objProductsController.GetObjectByID(o.FK_ICProductID); if (objProductsInfo == null) { return; } objStockLotsInfo = objStockLotsController.GetStockLotByProductAndLotNo(o.FK_ICProductID, o.ICReceiptItemStockLotNo); if (objStockLotsInfo == null) { objStockLotsInfo = new ICStockLotsInfo() { ICStockLotNo = o.ICReceiptItemStockLotNo, FK_ICProductID = o.FK_ICProductID, ICStockLotProductNo = objProductsInfo.ICProductNo, ICStockLotProductName = objProductsInfo.ICProductName, ICStockLotProductDesc = objProductsInfo.ICProductDesc, ICStockLotProductLength = objProductsInfo.ICProductLength, ICStockLotProductWidth = objProductsInfo.ICProductWidth, ICStockLotProductHeight = objProductsInfo.ICProductHeight }; objStockLotsController.CreateObject(objStockLotsInfo); } o.FK_ICStockLotID = objStockLotsInfo.ICStockLotID; }); ReceiptItemsList.SaveItemObjects(); }
public override void InitGridControlInVinaList() { ReceiptItemsList.InitVinaListGridControl(); }
public override void InvalidateModuleObjects(int iObjectID) { ReceiptItemsList.Invalidate(iObjectID); }