public void DoPick() { if (ConfirmEvent != null) { int resultCount = 0; PickList pickList = ThePickListMgr.LoadPickList(this.PickListNo); pickList.PickListDetails = new List <PickListDetail>(); foreach (GridViewRow row in GV_List.Rows) { Label lblLoc = (Label)row.FindControl("lblLoc"); HiddenField hfId = (HiddenField)row.FindControl("hfId"); Hu_HuInput ucHuInput = (Hu_HuInput)row.FindControl("ucHuInput"); PickListDetail pickListDetail = ThePickListDetailMgr.LoadPickListDetail(int.Parse(hfId.Value), true); IList <Hu> huList = ucHuInput.GetHuList(); if (huList != null && huList.Count > 0) { foreach (Hu hu in huList) { IList <LocationLotDetail> locationLotDetailList = TheLocationLotDetailMgr.GetHuLocationLotDetail(lblLoc.Text.Trim(), hu.HuId); if (locationLotDetailList != null && locationLotDetailList.Count > 0) { PickListResult pickListResult = new PickListResult(); pickListResult.LocationLotDetail = locationLotDetailList[0]; pickListResult.PickListDetail = pickListDetail; pickListResult.Qty = hu.Qty * pickListDetail.OrderLocationTransaction.UnitQty; pickListDetail.AddPickListResult(pickListResult); resultCount++; } } } pickList.AddPickListDetail(pickListDetail); } if (resultCount == 0) { ShowErrorMessage("MasterData.No.PickListResult"); return; } try { ThePickListMgr.DoPick(pickList, this.CurrentUser); ShowSuccessMessage("MasterData.PickList.Pick.Successfully", pickList.PickListNo); ConfirmEvent(this.PickListNo, null); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } } }
protected void btnPrint_Click(object sender, EventArgs e) { string pickListNo = this.tbPickListNo.Text; IList <object> list = new List <object>(); PickList pickList = ThePickListMgr.LoadPickList(pickListNo, true); //pickList.PickListDetails = pickList.PickListDetails.OrderBy(pd => pd.PrintLocationCode).ToList(); list.Add(pickList); string printUrl = TheReportMgr.WriteToFile("PickList.xls", list); Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + printUrl + "'); </script>"); }
protected void btnClose_Click(object sender, EventArgs e) { try { ThePickListMgr.ManualClosePickList(this.tbPickListNo.Text.Trim(), this.CurrentUser); ShowSuccessMessage("MasterData.PickList.ClosePickList.Successfully", this.tbPickListNo.Text.Trim()); DoSearch(); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
protected void lbtnDelete_Click(object sender, EventArgs e) { string pickListNo = ((LinkButton)sender).CommandArgument; try { ThePickListMgr.DeletePickList(pickListNo, this.CurrentUser); ShowSuccessMessage("MasterData.PickList.DeletePickList.Successfully", pickListNo); UpdateView(); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
protected void btnDelete_Click(object sender, EventArgs e) { try { ThePickListMgr.DeletePickList(this.tbPickListNo.Text.Trim(), this.CurrentUser); ShowSuccessMessage("MasterData.PickList.DeletePickList.Successfully", this.tbPickListNo.Text.Trim()); if (DeleteEvent != null) { DeleteEvent(sender, e); } } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
protected void btnCreatePickList_Click(object sender, EventArgs e) { try { PickList pickList = ThePickListMgr.CreatePickList(this.ucTransformer.GetTransformer(), this.CurrentUser); ShowSuccessMessage("MasterData.PickList.CreatePickList.Successfully", pickList.PickListNo); if (CreatePickListEvent != null) { CreatePickListEvent(pickList.PickListNo, null); } } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
public IList <PickList> PopulateSelectedData() { if (this.GV_List.Rows != null && this.GV_List.Rows.Count > 0) { IList <PickList> pickListList = new List <PickList>(); foreach (GridViewRow row in this.GV_List.Rows) { CheckBox checkBoxGroup = row.FindControl("CheckBoxGroup") as CheckBox; if (checkBoxGroup.Checked) { HiddenField hfPickListNo = row.FindControl("hfPickListNo") as HiddenField; PickList pickList = ThePickListMgr.LoadPickList(hfPickListNo.Value); pickListList.Add(pickList); } } return(pickListList); } return(null); }
private void AppendPrintUrlPicklist(StringBuilder url) { DetachedCriteria criteria = DetachedCriteria.For(typeof(PickList)); criteria.Add(Expression.Eq("IsPrinted", false)); OrderHelper.SetOpenOrderStatusCriteria(criteria, "Status"); //订单状态 SecurityHelper.SetRegionSearchCriteria(criteria, "PartyFrom.Code", this.CurrentUser.Code); //区域权限 //SecurityHelper.SetRegionSearchCriteria(criteria, "PartyTo.Code", this.CurrentUser.Code); //区域权限 IList <PickList> pickList = TheCriteriaMgr.FindAll <PickList>(criteria); if (pickList != null && pickList.Count > 0) { foreach (PickList pl in pickList) { string newUrl = TheReportMgr.WriteToFile("PickList.xls", pl.PickListNo); //to be refactored AppendPrintUrl(url, newUrl); pl.IsPrinted = true; //to be refactored ThePickListMgr.UpdatePickList(pl); } } }
protected void btnClose_Click(object sender, EventArgs e) { IList <PickList> pickListList = this.ucList.PopulateSelectedData(); if (pickListList == null || pickListList.Count == 0) { ShowErrorMessage("PickList.Error.NoData.Selected"); return; } try { foreach (PickList pickList in pickListList) { ThePickListMgr.ManualClosePickList(pickList, this.CurrentUser); } ShowSuccessMessage("PickList.BatchClose.Successfully"); DoSearch(); } catch (BusinessErrorException ex) { this.ShowErrorMessage(ex); } }
protected void DoSearch() { if (this.tbPickListNo.Text != string.Empty) { string pickListNo = this.tbPickListNo.Text.Trim(); PickList pickList = ThePickListMgr.LoadPickList(pickListNo, true); if (pickList != null) { this.lbStatus.Text = pickList.Status; this.lblStatus.Visible = true; if (pickList.PickListDetails != null && pickList.PickListDetails.Count > 0) { if (pickList.PartyFrom.Code == "YFK-RW" || pickList.PartyFrom.Code == "YFK-RM-HD") { pickList.PickListDetails = pickList.PickListDetails.OrderBy(pd => pd.PrintLocationCode).ToList(); } if (pickList.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT) { this.ucResultList.Visible = false; this.ucDetailList.InitPageParameter(pickList); this.ucDetailList.Visible = true; this.btnStart.Visible = true; this.btnConfirm.Visible = false; this.btnCancel.Visible = true; this.btnClose.Visible = false; this.btnPrint.Visible = true; this.btnShip.Visible = false; } else if (pickList.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS) { this.ucDetailList.InitPageParameter(pickList); this.ucResultList.InitPageParameter(pickList); this.ucResultList.Visible = false; this.ucDetailList.Visible = true; this.btnStart.Visible = false; this.btnConfirm.Visible = true; this.btnCancel.Visible = false; this.btnClose.Visible = true; this.btnPrint.Visible = true; this.btnShip.Visible = false; } else if (pickList.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_COMPLETE) { this.ucResultList.InitPageParameter(pickList); this.ucDetailList.Visible = false; this.ucResultList.Visible = true; this.btnStart.Visible = false; this.btnConfirm.Visible = false; this.btnCancel.Visible = false; this.btnClose.Visible = true; this.btnPrint.Visible = false; this.btnShip.Visible = true; } else if (pickList.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CLOSE) { this.ucResultList.InitPageParameter(pickList); this.ucResultList.Visible = true; this.ucDetailList.Visible = false; this.btnConfirm.Visible = false; this.btnCancel.Visible = false; this.btnClose.Visible = false; this.btnPrint.Visible = false; this.btnShip.Visible = false; this.btnStart.Visible = false; } else if (pickList.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CANCEL) { this.ucResultList.Visible = false; this.ucDetailList.InitPageParameter(pickList); this.ucDetailList.Visible = true; this.btnConfirm.Visible = false; this.btnCancel.Visible = false; this.btnClose.Visible = false; this.btnPrint.Visible = false; this.btnShip.Visible = false; this.btnStart.Visible = false; } } else { this.ucResultList.Visible = false; this.ucDetailList.Visible = false; this.btnConfirm.Visible = false; this.btnCancel.Visible = false; this.btnPrint.Visible = false; this.btnShip.Visible = false; } } else { this.lblStatus.Visible = false; this.lbStatus.Text = string.Empty; this.ucDetailList.Visible = false; this.btnCancel.Visible = false; this.btnPrint.Visible = false; this.btnShip.Visible = false; ShowErrorMessage("MasterData.PickList.Not.Found", pickListNo); } } else { ShowErrorMessage("MasterData.No.PickListNo.Input"); } }