public WIPCalc() { uow = new UnitOfWork(); wipTable = new WIPTable(uow); wipTable.Save(); dictPoLine = new Dictionary<string, XPCollection<WIPPurchOrderLine>>(); dictProdRoute = new Dictionary<string, XPCollection<WIPProdRoute>>(); dictWHTotal = new Dictionary<string, XPCollection<WIPWHTotal>>(); dictProdBom = new Dictionary<string, XPCollection<WIPProdBom>>(); }
public void RunReport() { Logger.For(this).Info("开始"); wipTable = new WIPTable(Session); wipTable.WIPReportType = this.WIPReportType; wipTable.Save(); dictPoLine = new Dictionary<string, XPCollection<WIPPurchOrderLine>>(); dictProdRoute = new Dictionary<string, XPCollection<WIPProdRoute>>(); dictWHTotal = new Dictionary<string, XPCollection<WIPWHTotal>>(); dictProdBom = new Dictionary<string, XPCollection<WIPProdBom>>(); dictWIPRouteLine = new Dictionary<string, WIPRouteLine>(); uow = (UnitOfWork)Session; try { cacheData(); initWIPItemNeed(); uow.CommitChanges(); calcWIP(); uow.CommitChanges(); calcReadyQty(); uow.CommitChanges(); } catch (Exception ex) { Logger.For(this).Error(string.Format("不能计算WIP. 出现以下错误.\n{0}", ex.Message)); uow.RollbackTransaction(); } Logger.For(this).Info("结束"); }