protected void btnQualified_Click(object sender, EventArgs e) { try { TheInspectOrderMgr.PendInspectOrder(this.ucDetailList.PopulateInspectOrder(true), this.CurrentUser); this.ShowSuccessMessage("MasterData.InspectOrder.Process.Successfully", this.lbInspectNo.Text); this.InitPageParameter(this.lbInspectNo.Text); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
protected void btnConfirm_Click(object sender, EventArgs e) { try { TheInspectOrderMgr.ProcessInspectOrder(this.PopulateInspectOrderDetailList(), this.CurrentUser); ShowSuccessMessage("MasterData.Inventory.InspectOrder.Confirm.Successful"); InitPageParameter(this.InspectCriteria); } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
public void InitPageParameter(string inspectNo, bool isWorkShop) { InspectOrder inspectOrder = TheInspectOrderMgr.LoadInspectOrder(inspectNo); this.lbInspectNo.Text = inspectOrder.InspectNo; this.lbCreateUser.Text = inspectOrder.CreateUser.Name; this.lbCreateDate.Text = inspectOrder.CreateDate.ToString("yyyy-MM-dd"); this.lbStatus.Text = inspectOrder.Status; this.IsPartQualified = bool.Parse(TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_ALLOW_PART_QUALIFIED).Value); this.btnQualified.Visible = (inspectOrder.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE) && !this.IsPartQualified && inspectOrder.IsDetailHasHu && !isWorkShop; this.btnUnqalified.Visible = (inspectOrder.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE) && !this.IsPartQualified && inspectOrder.IsDetailHasHu && !isWorkShop; this.btnInspect.Visible = (inspectOrder.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE) && (this.IsPartQualified || !inspectOrder.IsDetailHasHu) && !isWorkShop; this.btnUnqualifiedPrint.Visible = !isWorkShop; this.ucDetailList.IsPartQualified = this.IsPartQualified; this.ucDetailList.InitPageParameter(inspectNo, isWorkShop); }
protected void btnUnqualifiedPrint_Click(object sender, EventArgs e) { string inspectNo = this.lbInspectNo.Text; IList <object> list = new List <object>(); IList <InspectResult> inspectResultList = this.ucDetailList.PopulateUnqualifiedInspectOrder(); if (inspectResultList == null || inspectResultList.Count == 0) { ShowWarningMessage("MasterData.Inventory.InspectOrder.Unqualified.Empty"); return; } InspectOrder inspectOrder = TheInspectOrderMgr.LoadInspectOrder(inspectNo); list.Add(inspectOrder); list.Add(inspectResultList); string printUrl = TheReportMgr.WriteToFile("BelowBrade.xls", list); Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + printUrl + "'); </script>"); this.ShowSuccessMessage("MasterData.Inventory.InspectOrder.Unqualified.Print.Successful"); }
protected void btnConfirm_Click(object sender, EventArgs e) { UpdateInspectItemDic(); bool hasDetail = false; if (this.InspectItemDic.Count == 0) { } else { foreach (string itemCode in this.InspectItemDic.Keys) { if (InspectItemDic[itemCode] != 0) { hasDetail = true; break; } } } if (!hasDetail) { ShowErrorMessage("MasterData.InspectOrder.Detail.Empty"); return; } try { InspectOrder inspectOrder = TheInspectOrderMgr.CreateInspectOrder(this.tbLocation.Text.Trim(), this.InspectItemDic, this.CurrentUser); ShowSuccessMessage("MasterData.InspectOrder.Create.Successfully", inspectOrder.InspectNo); if (CreateEvent != null) { CreateEvent(inspectOrder.InspectNo, e); } } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
private void AppendPrintUrlInspectionOrder(StringBuilder url) { DetachedCriteria criteria = DetachedCriteria.For(typeof(InspectOrder)); criteria.Add(Expression.Eq("IsPrinted", false)); criteria.Add(Expression.Eq("Status", BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE)); //SecurityHelper.SetRegionSearchCriteria(criteria, "PartyFrom.Code", this.CurrentUser.Code); //区域权限 //SecurityHelper.SetRegionSearchCriteria(criteria, "PartyTo.Code", this.CurrentUser.Code); //区域权限 IList <InspectOrder> inspectOrderList = TheCriteriaMgr.FindAll <InspectOrder>(criteria); if (inspectOrderList != null && inspectOrderList.Count > 0) { foreach (InspectOrder inspectOrder in inspectOrderList) { string newUrl = TheReportMgr.WriteToFile("InspectOrder.xls", inspectOrder.InspectNo); //to be refactored AppendPrintUrl(url, newUrl); inspectOrder.IsPrinted = true; //to be refactored TheInspectOrderMgr.UpdateInspectOrder(inspectOrder); } } }
public void InitPageParameter(string inspectNo, bool isWorkShop) { this.InspectNo = inspectNo; InspectOrder inspectOrder = TheInspectOrderMgr.LoadInspectOrder(inspectNo, true); this.GV_List.DataSource = inspectOrder.InspectOrderDetails; this.GV_List.DataBind(); this.GV_List.Columns[7].Visible = inspectOrder.IsDetailHasHu; this.IsDetailHasHu = inspectOrder.IsDetailHasHu; if (this.IsPartQualified || !inspectOrder.IsDetailHasHu) { this.GV_List.Columns[13].Visible = true; this.GV_List.Columns[14].Visible = true; // this.GV_List.Columns[0].Visible = false; } else { //this.GV_List.Columns[0].Visible = true; this.GV_List.Columns[13].Visible = false; this.GV_List.Columns[14].Visible = false; } if (isWorkShop) { this.GV_List.Columns[0].Visible = false; this.GV_List.Columns[9].Visible = false; this.GV_List.Columns[10].Visible = false; this.GV_List.Columns[11].Visible = false; this.GV_List.Columns[12].Visible = false; this.GV_List.Columns[13].Visible = false; this.GV_List.Columns[14].Visible = false; this.GV_List.Columns[17].Visible = false; } }