private void ShowErrInfo() { long curStockOrgId; if ((this.opResults == null) || (this.opResults.Count < 1)) { this.ShowErrGrid(true); } else { int entryCurrentRowIndex = this.Model.GetEntryCurrentRowIndex("FEntityAction"); curStockOrgId = Convert.ToInt64(this.Model.GetValue("FStockOrgID", entryCurrentRowIndex)); StockOrgOperateResult opResult = this.opResults.SingleOrDefault <StockOrgOperateResult>(p => p.StockOrgID == curStockOrgId); entryCurrentRowIndex = this.Model.GetEntryCurrentRowIndex("FEntityErrType"); ErrType none = ErrType.None; object obj2 = this.Model.GetValue("FErrorType", entryCurrentRowIndex); if ((obj2 != null) && !string.IsNullOrWhiteSpace(obj2.ToString())) { Enum.TryParse <ErrType>(obj2.ToString(), out none); } this.RefreshErrEntity(opResult, none); this.RefreshStkBillDraftEntry(opResult, none); this.RefreshStkCntBillAuditEntry(opResult, none); this.RefreshMinusEntry(opResult, none); this.ShowHideErrTabDetail(opResult, none); this.ShowErrGrid(true); } }
private void ShowHideErrTabDetail(StockOrgOperateResult opResult, ErrType errType) { this.View.GetBarItem("FMinusEntry", "tbIgnoreMinus").Enabled = false; this.View.GetBarItem("FStkCountBillAuditEntry", "tbIgnoreStkBillAudit").Enabled = false; this.View.GetBarItem("FStkDraftBillEntry", "tbIgnoreStkBillDraft").Enabled = false; if (errType == ErrType.Minus) { this.View.GetControl <EntryGrid>("FStkCountBillAuditEntry").Visible = false; this.View.GetControl <EntryGrid>("FStkDraftBillEntry").Visible = false; this.View.GetControl <EntryGrid>("FEntityErrInfo").Visible = false; this.View.GetControl <EntryGrid>("FMinusEntry").Visible = true; if (((opResult != null) && (opResult.MinusErrObject != null)) && (Convert.ToInt32(opResult.MinusErrObject["ErrType"]) == 1)) { this.View.GetBarItem("FMinusEntry", "tbIgnoreMinus").Enabled = true; } } else if (errType == ErrType.UnAuditStkCountBill) { this.View.GetControl <EntryGrid>("FStkCountBillAuditEntry").Visible = true; this.View.GetControl <EntryGrid>("FStkDraftBillEntry").Visible = false; this.View.GetControl <EntryGrid>("FEntityErrInfo").Visible = false; this.View.GetControl <EntryGrid>("FMinusEntry").Visible = false; if (((opResult != null) && (opResult.StkCountBillAuditErrInfo != null)) && (opResult.StkCountBillAuditErrInfo.Count > 0)) { this.View.GetBarItem("FStkCountBillAuditEntry", "tbIgnoreStkBillAudit").Enabled = true; } } else if (errType == ErrType.StkDraftBill) { this.View.GetControl <EntryGrid>("FStkCountBillAuditEntry").Visible = false; this.View.GetControl <EntryGrid>("FStkDraftBillEntry").Visible = true; this.View.GetControl <EntryGrid>("FEntityErrInfo").Visible = false; this.View.GetControl <EntryGrid>("FMinusEntry").Visible = false; if (((opResult != null) && (opResult.StkBillDraftErrInfo != null)) && (opResult.StkBillDraftErrInfo.Count > 0)) { this.View.GetBarItem("FStkDraftBillEntry", "tbIgnoreStkBillDraft").Enabled = true; } } else { this.View.GetControl <EntryGrid>("FStkCountBillAuditEntry").Visible = false; this.View.GetControl <EntryGrid>("FStkDraftBillEntry").Visible = false; this.View.GetControl <EntryGrid>("FEntityErrInfo").Visible = true; this.View.GetControl <EntryGrid>("FMinusEntry").Visible = false; } this.View.UpdateView("FTabErrDetail"); }
private void RefreshErrEntity(StockOrgOperateResult opResult, ErrType errType) { Entity entryEntity = this.View.BusinessInfo.GetEntryEntity("FEntityErrInfo"); DynamicObjectType dynamicObjectType = entryEntity.DynamicObjectType; DynamicObjectCollection entityDataObject = this.Model.GetEntityDataObject(entryEntity); entityDataObject.Clear(); if (((errType == ErrType.Minus) || (errType == ErrType.None)) || ((errType == ErrType.UnAuditStkCountBill) || (errType == ErrType.StkDraftBill))) { this.View.UpdateView("FEntityErrInfo"); } else if (((opResult == null) || (opResult.ErrInfo == null)) || (opResult.ErrInfo.Count < 1)) { this.View.UpdateView("FEntityErrInfo"); } else { IEnumerable <OperateErrorInfo> enumerable; if (errType == ErrType.UnAuditBill) { enumerable = from p in opResult.ErrInfo where p.ErrType == Convert.ToInt32(ErrType.UnAuditBill) select p; } else { enumerable = from p in opResult.ErrInfo where p.ErrType < Convert.ToInt32(ErrType.OrgStatusErr) select p; } foreach (OperateErrorInfo info in enumerable) { DynamicObject item = new DynamicObject(dynamicObjectType) { ["ErrType"] = info.ErrType, ["ErrObjType"] = info.ErrObjType, ["ErrObjKeyField"] = info.ErrObjKeyField, ["ErrObjKeyID"] = info.ErrObjKeyID, ["ErrMsg"] = info.ErrMsg }; entityDataObject.Add(item); } this.View.UpdateView("FEntityErrInfo"); } }
private void RefreshMinusEntry(StockOrgOperateResult opResult, ErrType errType) { Entity entryEntity = this.View.BusinessInfo.GetEntryEntity("FMinusEntry"); DynamicObjectType dynamicObjectType = entryEntity.DynamicObjectType; DynamicObjectCollection entityDataObject = this.Model.GetEntityDataObject(entryEntity); entityDataObject.Clear(); if (((opResult != null) && (opResult.MinusErrObject != null)) && (((DynamicObjectCollection)opResult.MinusErrObject["Entry"]).Count > 0)) { foreach (DynamicObject obj2 in (DynamicObjectCollection)opResult.MinusErrObject["Entry"]) { DynamicObject item = new DynamicObject(dynamicObjectType) { ["ErrMessage"] = obj2["ErrMessage"], ["MaterialNumber"] = obj2["MaterialNumber"], ["MaterialName"] = obj2["MaterialName"], ["Specification"] = obj2["Specification"], ["StockName"] = obj2["StockName"], ["StockLocName"] = obj2["StockLocName"], ["UnitName"] = obj2["UnitName"], ["Qty"] = obj2["Qty"], ["SecUnitName"] = obj2["SecUnitName"], ["SecQty"] = obj2["SecQty"], ["LotText"] = obj2["LotText"], ["AuxPropName"] = obj2["AuxPropName"], ["BOMNumber"] = obj2["BOMNumber"], ["MtoNo"] = obj2["MtoNo"], ["ProjectNo"] = obj2["ProjectNo"], ["ProduceDate"] = obj2["ProduceDate"], ["ExpiryDate"] = obj2["ExpiryDate"], ["StockStatusName"] = obj2["StockStatusName"], ["OwnerTypeName"] = obj2["OwnerTypeName"], ["OwnerName"] = obj2["OwnerName"], ["KeeperTypeName"] = obj2["KeeperTypeName"], ["KeeperName"] = obj2["KeeperName"] }; entityDataObject.Add(item); } } this.View.UpdateView("FMinusEntry"); }
private void RefreshStkCntBillAuditEntry(StockOrgOperateResult opResult, ErrType errtype) { Entity entryEntity = this.View.BusinessInfo.GetEntryEntity("FStkCountBillAuditEntry"); DynamicObjectType dynamicObjectType = entryEntity.DynamicObjectType; DynamicObjectCollection entityDataObject = this.Model.GetEntityDataObject(entryEntity); entityDataObject.Clear(); if (((opResult != null) && (opResult.StkCountBillAuditErrInfo != null)) && (opResult.StkCountBillAuditErrInfo.Count > 0)) { foreach (OperateErrorInfo info in opResult.StkCountBillAuditErrInfo) { DynamicObject item = new DynamicObject(dynamicObjectType) { ["CtbaErrType"] = info.ErrType, ["CtbaErrObjType"] = info.ErrObjType, ["CtbaErrObjKeyField"] = info.ErrObjKeyField, ["CtbaErrObjKeyID"] = info.ErrObjKeyID, ["CtbaErrMsg"] = info.ErrMsg }; entityDataObject.Add(item); } } this.View.UpdateView("FStkCountBillAuditEntry"); }
private void ShowErrTypeInfo() { long curStockOrgId; Entity entryEntity = this.View.BusinessInfo.GetEntryEntity("FEntityErrType"); DynamicObjectType dynamicObjectType = entryEntity.DynamicObjectType; DynamicObjectCollection entityDataObject = this.Model.GetEntityDataObject(entryEntity); entityDataObject.Clear(); if ((this.opResults == null) || (this.opResults.Count < 1)) { this.ClearEntity("FEntityErrInfo"); this.ShowHideErrTabDetail(null, ErrType.None); this.View.UpdateView("FEntityErrType"); this.ShowErrGrid(true); } else { int entryCurrentRowIndex = this.Model.GetEntryCurrentRowIndex("FEntityAction"); curStockOrgId = Convert.ToInt64(this.Model.GetValue("FStockOrgID", entryCurrentRowIndex)); StockOrgOperateResult result = this.opResults.SingleOrDefault <StockOrgOperateResult>(p => p.StockOrgID == curStockOrgId); if ((result == null) || result.OperateSuccess) { this.ClearEntity("FEntityErrInfo"); this.ShowHideErrTabDetail(null, ErrType.None); this.View.UpdateView("FEntityErrType"); this.ShowErrGrid(true); } else { DynamicObject obj2; if ((result.ErrInfo != null) && result.ErrInfo.Exists(p => p.ErrType < Convert.ToInt32(ErrType.UnAuditBill))) { obj2 = new DynamicObject(dynamicObjectType) { ["ErrorType"] = ErrType.OrgStatusErr, ["ErrTypeName"] = string.Format(ResManager.LoadKDString("当前组织状态不符合{0}操作条件", "004023030002140", SubSystemType.SCM, new object[0]), this.isOpenAccount ? ResManager.LoadKDString("反关账", "004023030000238", SubSystemType.SCM, new object[0]) : ResManager.LoadKDString("关账", "004023030000241", SubSystemType.SCM, new object[0])) }; entityDataObject.Add(obj2); } if ((result.ErrInfo != null) && result.ErrInfo.Exists(p => p.ErrType == Convert.ToInt32(ErrType.UnAuditBill))) { obj2 = new DynamicObject(dynamicObjectType) { ["ErrorType"] = ErrType.UnAuditBill, ["ErrTypeName"] = string.Format(ResManager.LoadKDString("当前组织存在未审核的库存单据", "004023030002143", SubSystemType.SCM, new object[0]), new object[0]) }; entityDataObject.Add(obj2); } if ((result.StkBillDraftErrInfo != null) && (result.StkBillDraftErrInfo.Count > 0)) { obj2 = new DynamicObject(dynamicObjectType) { ["ErrorType"] = ErrType.StkDraftBill, ["ErrTypeName"] = ResManager.LoadKDString("当前组织存在暂存的库存单据", "004023000022222", SubSystemType.SCM, new object[0]) }; entityDataObject.Add(obj2); } if ((result.StkCountBillAuditErrInfo != null) && (result.StkCountBillAuditErrInfo.Count > 0)) { obj2 = new DynamicObject(dynamicObjectType) { ["ErrorType"] = ErrType.UnAuditStkCountBill, ["ErrTypeName"] = ResManager.LoadKDString("当前组织存在未审核的盘点单据", "004023000018755", SubSystemType.SCM, new object[0]) }; entityDataObject.Add(obj2); } if (result.MinusErrObject != null) { obj2 = new DynamicObject(dynamicObjectType) { ["ErrorType"] = ErrType.Minus, ["ErrTypeName"] = string.Format(ResManager.LoadKDString("当前组织存在异常库存数据", "004023030002146", SubSystemType.SCM, new object[0]), new object[0]) }; entityDataObject.Add(obj2); } this.View.UpdateView("FEntityErrType"); this.View.SetEntityFocusRow("FEntityErrType", 0); this.ShowErrInfo(); } } }
private void RefreshOrgSuccessFlag() { DynamicObjectCollection entryDataObject = this.View.Model.DataObject["EntityAction"] as DynamicObjectCollection; DateTime minValue = DateTime.MinValue; object obj2 = this.Model.GetValue("FCLOSEDATE"); if (obj2 != null) { minValue = DateTime.Parse(obj2.ToString()); } DataTable stockOrgAcctLastCloseDate = null; if (this.isOpenAccount) { stockOrgAcctLastCloseDate = CommonServiceHelper.GetStockOrgAcctLastCloseDate(base.Context, ""); } Func <StockOrgOperateResult, bool> predicate = null; for (int i = 0; i < entryDataObject.Count; i++) { if (Convert.ToBoolean(entryDataObject[i]["Check"])) { if (predicate == null) { predicate = p => p.StockOrgID == Convert.ToInt64(entryDataObject[i]["StockOrgID"]); } StockOrgOperateResult result = this.opResults.SingleOrDefault <StockOrgOperateResult>(predicate); if (result != null) { this.Model.SetValue("FResult", result.OperateSuccess ? ResManager.LoadKDString("成功", "004023030000250", SubSystemType.SCM, new object[0]) : ResManager.LoadKDString("失败", "004023030000253", SubSystemType.SCM, new object[0]), i); this.Model.SetValue("FRetFlag", result.OperateSuccess, i); if (result.OperateSuccess) { if (this.isOpenAccount) { DataRow[] source = stockOrgAcctLastCloseDate.Select($"FORGID={result.StockOrgID}"); if (source.Count <DataRow>() > 0) { this.Model.SetValue("FLastCloseDate", source[0]["FCLOSEDATE"], i); } else { this.Model.SetValue("FLastCloseDate", null, i); this.Model.SetValue("FCheck", false, i); } } else { this.Model.SetValue("FLastCloseDate", minValue, i); } } LogObject logObject = new LogObject { ObjectTypeId = this.View.BusinessInfo.GetForm().Id, Description = string.Format(ResManager.LoadKDString("库存组织{0}{1}{2}{3}", "004023030000256", SubSystemType.SCM, new object[0]), new object[] { result.StockOrgNumber, result.StockOrgName, this.isOpenAccount ? ResManager.LoadKDString("反关账", "004023030000238", SubSystemType.SCM, new object[0]) : ResManager.LoadKDString("关账", "004023030000241", SubSystemType.SCM, new object[0]), result.OperateSuccess ? ResManager.LoadKDString("成功", "004023030000250", SubSystemType.SCM, new object[0]) : ResManager.LoadKDString("失败", "004023030000253", SubSystemType.SCM, new object[0]) }), Environment = OperatingEnvironment.BizOperate, OperateName = this.isOpenAccount ? ResManager.LoadKDString("反关账", "004023030000238", SubSystemType.SCM, new object[0]) : ResManager.LoadKDString("关账", "004023030000241", SubSystemType.SCM, new object[0]), SubSystemId = "21" }; this.Model.WriteLog(logObject); } } } }