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