void btnRecalcInventory_Click(object sender, EventArgs e) { Control period = UIManager.GetControl("period"); Control stock = UIManager.GetControl("stock"); if (period != null && stock != null && (period as ABCPeriodEdit).EditValue != null && (stock as ABCSearchControl).EditValue != null) { Guid periodID = ABCHelper.DataConverter.ConvertToGuid((period as ABCPeriodEdit).EditValue); Guid stockID = ABCHelper.DataConverter.ConvertToGuid((stock as ABCSearchControl).EditValue); if (periodID != Guid.Empty && stockID != Guid.Empty) { GEPeriodsInfo preriodInfo = new GEPeriodsController().GetObjectByID(periodID) as GEPeriodsInfo; GECompanyUnitsInfo stockInfo = new GECompanyUnitsController().GetObjectByID(stockID) as GECompanyUnitsInfo; if (preriodInfo != null && stockInfo != null) { ABCHelper.ABCWaitingDialog.Show("", String.Format("Tính tồn kho tháng {0}/{1} {2}. . .!", preriodInfo.Month, preriodInfo.Year, stockInfo.No)); InventoryProvider.PeriodEndingProcessing(periodID, stockID); if (this.DataManager.DataObjectsList.ContainsKey((stock as ABCSearchControl).DataSource)) { this.DataManager.DataObjectsList[(stock as ABCSearchControl).DataSource].Refresh(); } ABCHelper.ABCWaitingDialog.Close(); } } } }
void btnRecalcInventory_Click(object sender, EventArgs e) { Control period = UIManager.GetControl("period"); if (period != null && (period as ABCPeriodEdit).EditValue != null) { Guid periodID = ABCHelper.DataConverter.ConvertToGuid((period as ABCPeriodEdit).EditValue); if (periodID != Guid.Empty) { GEPeriodsInfo preriodInfo = new GEPeriodsController().GetObjectByID(periodID) as GEPeriodsInfo; if (preriodInfo != null) { ABCHelper.ABCWaitingDialog.Show("", String.Format("Tính tồn kho tháng {0}/{1}. . .!", preriodInfo.Month, preriodInfo.Year)); InventoryProvider.PeriodEndingProcessing(periodID); DoAction(ABCCommon.ABCScreenAction.Refresh, false); ABCHelper.ABCWaitingDialog.Close(); } } } }