protected void btnAdjust_Click(object sender, EventArgs e) { try { IList <int> cycleCountResultIdList = new List <int>(); for (int i = 0; i < this.GV_List.Rows.Count; i++) { GridViewRow row = this.GV_List.Rows[i]; CheckBox checkBoxGroup = row.FindControl("CheckBoxGroup") as CheckBox; if (checkBoxGroup.Checked) { HiddenField hfId = (HiddenField)row.FindControl("hfId"); cycleCountResultIdList.Add(Int32.Parse(hfId.Value)); } } if (cycleCountResultIdList.Count == 0) { ShowErrorMessage("Common.Message.Record.Not.Select"); return; } TheCycleCountMgr.ProcessCycleCountResult(cycleCountResultIdList, this.CurrentUser); ShowSuccessMessage("Common.Business.Result.Adjust.Successfully"); this.Visible = false; } catch (BusinessErrorException ex) { this.ShowErrorMessage(ex); } }
protected void btnSave_Click(object sender, EventArgs e) { try { CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo); if (cycleCount.IsScanHu) { cycleCount.Bins = this.ucStorageBinList.GetBins(); } cycleCount.Items = this.ucItemList.GetItems(); TheCycleCountMgr.UpdateCycleCount(cycleCount); this.Refresh(); if (TabEvent != null) { TabEvent(new object[] { false, "" }, e); } ShowSuccessMessage("Common.Business.Result.Update.Successfully"); } catch (BusinessErrorException ex) { ShowErrorMessage("Common.Business.Result.Update.Failed.Reason", ex.Message); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo); if (cycleCount.Type == BusinessConstants.CODE_MASTER_PHYCNT_TYPE_WHOLECHECK) { TheCycleCountMgr.ReleaseCycleCount(this.OrderNo, this.CurrentUser); } else { if (cycleCount.IsScanHu) { cycleCount.Bins = this.ucStorageBinList.GetBins(); } cycleCount.Items = this.ucItemList.GetItems(); TheCycleCountMgr.ReleaseCycleCount(cycleCount, this.CurrentUser); } if (TabEvent != null) { TabEvent(new object[] { true, this.OrderNo }, e); } ShowSuccessMessage("Common.Business.Result.Submit.Successfully"); this.InitPageParameter(this.OrderNo); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
public void InitPageParameter(CycleCount cycleCount) { IList <CycleCountResult> cycleCountResultList = TheCycleCountMgr.CalcCycleCount(cycleCount.Code, true, true, true, null, null); this.GV_List.DataSource = cycleCountResultList; this.GV_List.DataBind(); }
protected void btnAdjust_Click(object sender, EventArgs e) { try { CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(Code); IList <int> cycleCountResultIdList = new List <int>(); for (int i = 0; i < this.GV_List.Rows.Count; i++) { GridViewRow row = this.GV_List.Rows[i]; CheckBox checkBoxGroup = row.FindControl("CheckBoxGroup") as CheckBox; if (checkBoxGroup.Checked) { if (cycleCount.IsScanHu) { Label lblStorageBin = (Label)row.FindControl("lblStorageBin"); Label lblItemCode = (Label)row.FindControl("lblItemCode"); IList <string> binList = new List <string>(); IList <string> itemList = new List <string>(); if (lblStorageBin.Text.Trim() != string.Empty) { binList.Add(lblStorageBin.Text.Trim()); } if (lblItemCode.Text.Trim() != string.Empty) { itemList.Add(lblItemCode.Text.Trim()); } IList <CycleCountResult> cycleCountResultList = TheCycleCountMgr.ListCycleCountResultDetail(this.Code, true, true, false, binList, itemList, binList.Count == 0); foreach (CycleCountResult cycleCountResult in cycleCountResultList) { cycleCountResultIdList.Add(cycleCountResult.Id); } } else { HiddenField hfId = (HiddenField)row.FindControl("hfId"); cycleCountResultIdList.Add(Int32.Parse(hfId.Value)); } } } if (cycleCountResultIdList.Count == 0) { ShowErrorMessage("Common.Message.Record.Not.Select"); return; } TheCycleCountMgr.ProcessCycleCountResult(cycleCountResultIdList, this.CurrentUser); UpdateView(); DoSearch(); ShowSuccessMessage("Common.Business.Result.Adjust.Successfully"); } catch (BusinessErrorException ex) { this.ShowErrorMessage(ex); } }
protected void btnRecalc_Click(object sender, EventArgs e) { try { IList <CycleCountResult> cycleCountResultList = TheCycleCountMgr.ReCalcCycleCount(this.code, this.CurrentUser); this.BindData(cycleCountResultList); ShowSuccessMessage("Common.Business.Result.Update.Successfully"); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
protected void btnClose_Click(object sender, EventArgs e) { try { TheCycleCountMgr.ManualCloseCycleCount(Code, this.CurrentUser); UpdateView(); ShowSuccessMessage("Common.Business.Result.Close.Successfully"); } catch (BusinessErrorException ex) { this.ShowErrorMessage(ex); } }
protected void btnComplete_Click(object sender, EventArgs e) { try { TheCycleCountMgr.CompleteCycleCount(this.OrderNo, this.CurrentUser); ShowSuccessMessage("Common.Business.Result.Complete.Successfully"); this.Refresh(); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
public override void UpdateView() { CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(Code); this.Status = cycleCount.Status; if (cycleCount.IsScanHu) { tbBinCode.ServiceParameter = "string:" + cycleCount.Location.Code; tbBinCode.DataBind(); tbBinCode.Visible = true; lblBinCode.Visible = true; btnExportDetail.Visible = true; this.GV_List.Columns[6].Visible = true; this.GV_List.Columns[7].Visible = true; this.GV_List.Columns[8].Visible = true; this.GV_List.Columns[9].Visible = false; this.GV_List.Columns[10].Visible = false; this.GV_List.Columns[11].Visible = false; } else { this.GV_List.Columns[2].Visible = false; this.GV_List.Columns[6].Visible = false; this.GV_List.Columns[7].Visible = false; this.GV_List.Columns[8].Visible = false; this.GV_List.Columns[9].Visible = true; this.GV_List.Columns[10].Visible = true; this.GV_List.Columns[11].Visible = true; tbBinCode.Visible = false; lblBinCode.Visible = false; btnExportDetail.Visible = false; } this.GV_List.Columns[0].Visible = cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_COMPLETE; if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_COMPLETE) { this.btnAdjust.Visible = true; this.btnClose.Visible = true; //this.GV_List.Columns[0].Visible = true; } else { this.btnAdjust.Visible = false; this.btnClose.Visible = false; // this.GV_List.Columns[0].Visible = false; } this.isExport = false; }
protected void btnPrint_Click(object sender, EventArgs e) { CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo); IList <object> cycleCountList = new List <object>(); IList <CycleCount> cycleCountListT = new List <CycleCount>(); cycleCountListT.Add(cycleCount); cycleCountList.Add(cycleCountListT); cycleCountList.Add(CurrentUser.Code); string printUrl = TheReportMgr.WriteToFile("Stocktaking.xls", cycleCountList, "Stocktaking.xls"); Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + printUrl + "'); </script>"); }
protected void btnImport_Click(object sender, EventArgs e) { try { CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo); IList <CycleCountDetail> cycleCountDetailList = TheImportMgr.ReadCycleCountFromXls(fileUpload.PostedFile.InputStream, this.CurrentUser, cycleCount); this.TheCycleCountMgr.RecordCycleCountDetail(this.OrderNo, cycleCountDetailList, this.CurrentUser); ShowSuccessMessage("Import.Result.Successfully"); } catch (BusinessErrorException ex) { this.ShowErrorMessage(ex); } }
protected void btnCancel_Click(object sender, EventArgs e) { try { TheCycleCountMgr.CancelCycleCount(this.CacheResolver.Code, this.CurrentUser); this.CacheResolver.Status = BusinessConstants.CODE_MASTER_STATUS_VALUE_CANCEL; this.EditMode = false; this.Refresh(); ShowSuccessMessage("MasterData.Order.OrderHead.Cancel.Successfully", this.CacheResolver.Code); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { TheCycleCountMgr.SubmitCycleCount(this.CacheResolver.Code, this.CurrentUser); this.ucEdit.InitPageParameter(this.CacheResolver.Code); this.EditMode = false; this.CacheResolver.Status = BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT; this.InitialUI(); ShowSuccessMessage("Common.Business.Result.Update.Successfully"); } catch (BusinessErrorException ex) { ShowErrorMessage("Common.Business.Result.Update.Failed.Reason", ex.Message); } }
protected void btnDelete_Click(object sender, EventArgs e) { try { TheCycleCountMgr.DeleteCycleCount(this.OrderNo); ShowSuccessMessage("Common.Business.Result.Delete.Successfully"); if (BackEvent != null) { BackEvent(sender, e); } } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
public void InitPageParameter(string code, bool isEditMode) { try { InitialResolver(this.CurrentUser.Code, BusinessConstants.TRANSFORMER_MODULE_TYPE_STOCKTAKING); CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code); this.CacheResolver.Code = code; this.CacheResolver.Status = cycleCount.Status; IList <CycleCountDetail> cycleCountDetailList = TheCycleCountDetailMgr.GetCycleCountDetail(code); CacheResolver.Transformers = this.ConvertCycleCountToTransformer(cycleCountDetailList); this.EditMode = isEditMode; this.Refresh(); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
public void ListEdit_Render(object sender, EventArgs e) { this.ucSearch.Visible = false; this.ucList.Visible = false; this.ucBusiness.Visible = true; string code = (string)sender; CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code); if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CANCEL || cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE) { TabEvent(new object[] { false, "" }, e); } else { TabEvent(new object[] { true, code }, e); } this.ucBusiness.InitPageParameter((string)sender); }
protected void btnCancel_Click(object sender, EventArgs e) { try { TheCycleCountMgr.CancelCycleCount(this.OrderNo, this.CurrentUser); this.Refresh(); if (TabEvent != null) { TabEvent(new object[] { false, "" }, e); } ShowSuccessMessage("Common.Business.Result.Cancel.Successfully", this.OrderNo); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
protected void btnSave_Click(object sender, EventArgs e) { string region = this.tbRegion.Text.Trim(); string location = this.tbLocation.Text.Trim(); string effectiveDate = this.tbEffDate.Text.Trim(); DateTime effDate = DateTime.Today; if (region == string.Empty) { ShowErrorMessage("Common.Business.Error.RegionInvalid"); return; } else if (location == string.Empty) { ShowErrorMessage("Common.Business.Error.LocationInvalid"); return; } try { effDate = Convert.ToDateTime(effectiveDate); } catch (Exception) { ShowErrorMessage("Common.Business.Error.DateInvalid"); return; } CycleCount cycleCount = new CycleCount(); cycleCount.Location = TheLocationMgr.LoadLocation(location); cycleCount.EffectiveDate = effDate; cycleCount.Type = this.ddlType.SelectedValue; cycleCount.IsScanHu = this.cbIsScanHu.Checked; cycleCount.PhyCntGroupBy = this.ddlPhyCntGroupBy.SelectedValue; TheCycleCountMgr.CreateCycleCount(cycleCount, this.CurrentUser); ShowSuccessMessage("Common.Business.Result.Insert.Successfully"); if (SaveEvent != null) { SaveEvent(cycleCount.Code, e); } }
public void UpdateView() { CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code); this.ucInfo.InitPageParameter(cycleCount); this.btnRecalc.Visible = (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT); this.btnAdjust.Visible = (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT); //if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT) //{ // IList<CycleCountResult> cycleCountResultList = TheCycleCountMgr.ReCalcCycleCount(this.code, this.CurrentUser); // this.BindData(cycleCountResultList); //} //else //{ this.BindData(); //} }
private void BoundGridView() { IList <string> binCodeList = new List <string>(); if (this.tbBinCode.Text != null && this.tbBinCode.Text.Trim().Length > 0) { binCodeList.Add(this.tbBinCode.Text); } IList <string> itemCodeList = new List <string>(); if (this.tbItemCode.Text != null && this.tbItemCode.Text.Trim().Length > 0) { itemCodeList.Add(this.tbItemCode.Text); } IList <CycleCountResult> cycleCountResultList = TheCycleCountMgr.ListCycleCountResult(Code, cbShortage.Checked, this.cbProfit.Checked, cbEqual.Checked, binCodeList, itemCodeList); this.GV_List.DataSource = cycleCountResultList; this.GV_List.DataBind(); UpdateView(); }
protected void btnImport_Click(object sender, EventArgs e) { try { CycleCount cycleCount = this.GetCycleCount(); if (cycleCount == null) return; IList<CycleCountDetail> cycleCountDetailList = TheImportMgr.ReadCycleCountFromXls(fileUpload.PostedFile.InputStream, this.CurrentUser, cycleCount); TheCycleCountMgr.SaveCycleCount(cycleCount, cycleCountDetailList, this.CurrentUser); ShowSuccessMessage("Import.Result.Successfully"); if (BtnImportClick != null) { BtnImportClick(cycleCount.Code, null); } } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
public void InitPageParameter(string code) { this.OrderNo = code; CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code); this.ucEdit.InitPageParameter(cycleCount); InitialUI(); //全盘 不显示 库格明细和物料明细 if (cycleCount.Type == BusinessConstants.CODE_MASTER_PHYCNT_TYPE_WHOLECHECK) { this.ucStorageBinList.Visible = false; this.ucItemList.Visible = false; this.btnSave.Visible = false; } else //抽盘 { // 不选择 是否扫描条码 就没有库格明细 if (!cycleCount.IsScanHu) { this.ucStorageBinList.Visible = false; } else { this.ucStorageBinList.InitPageParameter(cycleCount); this.ucStorageBinList.Visible = true; } this.ucItemList.InitPageParameter(cycleCount); ucItemList.Visible = true; } if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS) { //this.ucCycleCountResultList.InitPageParameter(cycleCount); } }
private void OnDetailClick(string binItem, bool isShortage, bool isProfit, bool isEqual) { string[] argument = binItem.Split('|'); IList <string> binList = new List <string>(); IList <string> itemList = new List <string>(); if (argument[0].Trim() != string.Empty) { binList.Add(argument[0]); } if (argument[1].Trim() != string.Empty) { itemList.Add(argument[1]); } IList <CycleCountResult> cycleCountResultList = TheCycleCountMgr.ListCycleCountResultDetail(this.Code, isShortage, isProfit, isEqual, binList, itemList, binList.Count == 0); this.ucDetail.UpdateView(cycleCountResultList, isShortage, isProfit, isEqual); this.ucDetail.Visible = true; //this.ucDetail.UpdateView(); }
protected void btnAdjust_Click(object sender, EventArgs e) { try { IList <CycleCountResult> cycleCountResultList = TheCycleCountResultMgr.GetCycleCountResult(this.code); foreach (GridViewRow gvr in GV_List.Rows) { TextBox tbDiffReason = (TextBox)gvr.FindControl("tbDiffReason"); string diffReason = tbDiffReason.Text.Trim() != string.Empty ? tbDiffReason.Text.Trim() : string.Empty; if (diffReason != string.Empty) { cycleCountResultList[gvr.RowIndex].DiffReason = diffReason; } } TheCycleCountResultMgr.UpdateCycleCountResult(cycleCountResultList.Where(c => c.DiffReason != null).ToList <CycleCountResult>()); TheCycleCountMgr.ProcessCycleCountResult(this.code, this.CurrentUser); this.UpdateView(); ShowSuccessMessage("Common.Business.Result.Update.Successfully"); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
public void InitPageParameter(string code) { CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(code); InitPageParameter(cycleCount); }
private void InitialUI() { CycleCount cycleCount = TheCycleCountMgr.LoadCycleCount(this.OrderNo); if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE) { this.btnSave.Visible = true; this.btnDelete.Visible = true; this.btnSubmit.Visible = true; this.btnCancel.Visible = false; this.btnComplete.Visible = false; this.btnPrint.Visible = false; this.btnImport.Visible = false; this.fileUpload.Visible = false; this.hlTemplate.Visible = false; } else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT) { this.btnSave.Visible = false; this.btnDelete.Visible = false; this.btnSubmit.Visible = false; this.btnCancel.Visible = true; this.btnComplete.Visible = true; this.btnPrint.Visible = true; this.btnImport.Visible = false; this.fileUpload.Visible = false; this.hlTemplate.Visible = false; } else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS) { this.btnSave.Visible = false; this.btnDelete.Visible = false; this.btnSubmit.Visible = false; this.btnCancel.Visible = true; this.btnComplete.Visible = true; this.btnPrint.Visible = true; this.btnImport.Visible = true; this.fileUpload.Visible = true; this.hlTemplate.Visible = true; } else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_COMPLETE) { this.btnSave.Visible = false; this.btnDelete.Visible = false; this.btnSubmit.Visible = false; this.btnCancel.Visible = false; this.btnComplete.Visible = false; this.btnPrint.Visible = false; this.btnImport.Visible = false; this.fileUpload.Visible = false; this.hlTemplate.Visible = false; } else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CLOSE) { this.btnSave.Visible = false; this.btnDelete.Visible = false; this.btnSubmit.Visible = false; this.btnCancel.Visible = false; this.btnComplete.Visible = false; this.btnPrint.Visible = false; this.btnImport.Visible = false; this.fileUpload.Visible = false; this.hlTemplate.Visible = false; } else if (cycleCount.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CANCEL) { this.btnSave.Visible = false; this.btnDelete.Visible = false; this.btnSubmit.Visible = false; this.btnCancel.Visible = false; this.btnComplete.Visible = false; this.btnPrint.Visible = false; this.btnImport.Visible = false; this.fileUpload.Visible = false; this.hlTemplate.Visible = false; } }