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 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 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); } }