protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string sPlanId = this.Request["PlanId"]; List <string> list = new List <string>(); List <Tbl_User> lUsers = new List <Tbl_User>(); Msg msg = UserLoginModel.GetAllUser(); if (msg.Status) { Msg planMsg = PlanModel.QyeryPlanById(int.Parse(sPlanId)); if (planMsg.Status) { lUsers = msg.UserData as List <Tbl_User>; for (int i = 0; i < lUsers.Count; i++) { list.Add("用户名:" + lUsers[i].Name); } ViewState["lUsers"] = lUsers; DropDownList2.DataSource = list; DropDownList2.DataBind(); DropDownList3.DataSource = list; DropDownList3.DataBind(); DropDownList4.DataSource = list; DropDownList4.DataBind(); DropDownList5.DataSource = list; DropDownList5.DataBind(); Tbl_Plan oPlan = planMsg.UserData as Tbl_Plan; txtProjectName.Text = oPlan.ProjectName; for (int i = 0; i < lUsers.Count; i++) { if (lUsers[i].ID == oPlan.DesignAdm) { DropDownList2.SelectedIndex = i; } if (lUsers[i].ID == oPlan.ProductAdm) { DropDownList3.SelectedIndex = i; } if (lUsers[i].ID == oPlan.CenterStorageAdm) { DropDownList4.SelectedIndex = i; } if (lUsers[i].ID == oPlan.SiteStorageAdm) { DropDownList5.SelectedIndex = i; } } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string sPlanId = this.Request["PlanID"]; Msg msg = PlanModel.QyeryPlanById(int.Parse(sPlanId)); if (msg.Status) { txbPlanId.Text = (msg.UserData as Tbl_Plan).ProjectName; } List <string> list = UpLoadModel.QueryMatriesName(); DropDownList1.DataSource = list; DropDownList1.DataBind(); } int index = GridView1.PageIndex; List <int> li = new List <int>(); for (int i = 0; i < GridView1.Rows.Count; i++) { if (((System.Web.UI.HtmlControls.HtmlInputCheckBox) this.GridView1.Rows[i].FindControl("chkBox")).Checked == true) { li.Add(i + 1); } } ViewState["page" + index] = li; if (DropDownList1.Text != null) { Msg sqlMsg = UpLoadModel.GetMatriesByName(DropDownList1.Text); if (sqlMsg.Status) { inList = sqlMsg.UserData as List <Tbl_InMaries>; GridView1.DataSource = BuildGridViewDataSource(inList); GridView1.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string palnId = this.Request["PlanID"]; string type = this.Request["Type"]; StringBuilder build = new StringBuilder(); int iPlanId = int.Parse(palnId); Msg planMsg = PlanModel.QyeryPlanById(iPlanId); if (planMsg.Status) { planName.InnerText = "用户导航:" + (planMsg.UserData as Tbl_Plan).ProjectName + "信息"; } if (this.CurrentUserInfo.Type == (int)LoginType.主管密码) { if (int.Parse(type) == (int)BatchStatus.加工仓库入库待审批) { Msg msg = ProductModel.NGetAllMetaries(int.Parse(palnId)); if (msg.Status) { List <Tbl_Materies> lMetries = msg.UserData as List <Tbl_Materies>; ViewState["ListData"] = lMetries; ViewState["Identify"] = (int)CurrentType.加工登录入库; if (lMetries.Count > 0) { for (int i = 0; i < lMetries.Count; i++) { //div的事件onclick='urlLocation(" + i + ")' build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='EditProductInBunch.aspx?MateriesID=" + lMetries[i].MateriesID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' /><strong><a href='EditProductInBunch.aspx?MateriesID=" + lMetries[i].MateriesID + "'>材料编号:" + lMetries[i].MateriesID + "</a></strong></div></li>"); } } } } else if (int.Parse(type) == (int)BatchStatus.加工仓库待出库审批) { Msg msg = ProductModel.NQueryProductOutBunch(iPlanId); if (msg.Status) { List <Tbl_ProductStorage> lStorage = msg.UserData as List <Tbl_ProductStorage>; ViewState["ListData"] = lStorage; ViewState["Identify"] = (int)CurrentType.加工登录出库; if (lStorage.Count > 0) { for (int i = 0; i < lStorage.Count; i++) { build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='EditProductOutBunch.aspx?BuildBunchId=" + lStorage[i].BuildBatchID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' /><strong><a href='EditProductOutBunch.aspx?BuildBunchId=" + lStorage[i].BuildBatchID + "'>材料编号:" + lStorage[i].BuildBatchID + "</a></strong></div></li>"); } } } } else if (int.Parse(type) == (int)BatchStatus.中心仓库待出库审批) { Msg msg = Center.NQueryOutBunch(iPlanId); if (msg.Status) { List <Tbl_CenterStorage> lStorage = msg.UserData as List <Tbl_CenterStorage>; ViewState["ListData"] = lStorage; ViewState["Identify"] = (int)CurrentType.中心登录出库; if (lStorage.Count > 0) { for (int i = 0; i < lStorage.Count; i++) { build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='CenterStorage/EditOutBunch.aspx?BuildBunchId=" + lStorage[i].BuildBatchID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' ' /><strong><a href='CenterStorage/EditOutBunch.aspx?BuildBunchId=" + lStorage[i].BuildBatchID + "'>批次编号:" + lStorage[i].BuildBatchID + "</a></strong></div></li>"); } } } } else if (int.Parse(type) == (int)BatchStatus.现场仓库待出库审批) { Msg msg = SiteStorageModel.NQueryOutBunch(iPlanId); if (msg.Status) { List <Tbl_SiteStorage> lBunch = msg.UserData as List <Tbl_SiteStorage>; ViewState["ListData"] = lBunch; ViewState["Identify"] = (int)CurrentType.现场登录出库; if (lBunch.Count > 0) { for (int i = 0; i < lBunch.Count; i++) { build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='EditSiteOutBunch.aspx?BuildBunchId=" + lBunch[i].BuildBatchID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' ' /><strong><a href='EditSiteOutBunch.aspx?BuildBunchId=" + lBunch[i].BuildBatchID + "'>批次编号:" + lBunch[i].BuildBatchID + "</a></strong></div></li>"); } } } } else { } } else if (this.CurrentUserInfo.Type == (int)LoginType.确认密码) { if (int.Parse(type) == (int)BatchStatus.加工仓库入库待审批) { Msg msg = ProductModel.NGetPreUnsureInBatch(int.Parse(palnId)); if (msg.Status) { List <Tbl_ProductBatch> lMetries = msg.UserData as List <Tbl_ProductBatch>;//批次表 ViewState["ListData"] = lMetries; ViewState["Identify"] = (int)CurrentType.加工确认入库; if (lMetries.Count > 0) { for (int i = 0; i < lMetries.Count; i++) { build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='EnsureProductInBunch.aspx?BuildBatchId=" + lMetries[i].BuildBatchID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' /><strong><a href='EnsureProductInBunch.aspx?BuildBunchId=" + lMetries[i].BuildBatchID + "'>批次编号:" + lMetries[i].BuildBatchID + "</a></strong></div></li>"); } } } } else if (int.Parse(type) == (int)BatchStatus.加工仓库待出库审批) { Msg msg = ProductModel.NQueryEnsureProductOutBunch(iPlanId); if (msg.Status) { List <Tbl_OutProductBatch> lStorage = msg.UserData as List <Tbl_OutProductBatch>; ViewState["ListData"] = lStorage; ViewState["Identify"] = (int)CurrentType.加工确认出库; if (lStorage.Count > 0) { for (int i = 0; i < lStorage.Count; i++) { build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='EnsureProductOutBunch.aspx?BuildBunchId=" + lStorage[i].BuildBatchID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' /><strong><a href='EnsureProductOutBunch.aspx?BuildBunchId=" + lStorage[i].BuildBatchID + "'>批次编号:" + lStorage[i].BuildBatchID + "</a></strong></div></li>"); } } } } else if (int.Parse(type) == (int)BatchStatus.中心仓库入库待审批) { Msg msg = Center.NQueryWaitInBunch(iPlanId); if (msg.Status) { List <Tbl_CenterStorageBatch> lBunch = msg.UserData as List <Tbl_CenterStorageBatch>; ViewState["ListData"] = lBunch; ViewState["Identify"] = (int)CurrentType.中心确认入库; if (lBunch.Count > 0) { for (int i = 0; i < lBunch.Count; i++) { build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='CenterStorage/EnsureCenterInBunch.aspx?BuildBunchId=" + lBunch[i].BuildBatchID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' /><strong><a href='CenterStorage/EnsureCenterInBunch.aspx?BuildBunchId=" + lBunch[i].BuildBatchID + "'>批次编号:" + lBunch[i].BuildBatchID + "</a></strong></div></li>"); } } } } else if (int.Parse(type) == (int)BatchStatus.中心仓库待出库审批) { Msg msg = Center.NQueryEnsureOutBunch(iPlanId); if (msg.Status) { List <Tbl_OutCenterStorage> lStorage = msg.UserData as List <Tbl_OutCenterStorage>; ViewState["ListData"] = lStorage; ViewState["Identify"] = (int)CurrentType.中心确认出库; if (lStorage.Count > 0) { for (int i = 0; i < lStorage.Count; i++) { build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='CenterStorage/EnsureOutBunch.aspx?BuildBunchId=" + lStorage[i].BuildBatchID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' /><strong><a href='CenterStorage/EnsureOutBunch.aspx?BuildBunchId=" + lStorage[i].BuildBatchID + "'>批次编号:" + lStorage[i].BuildBatchID + "</a></strong></div></li>"); } } } } else if (int.Parse(type) == (int)BatchStatus.现场仓库入库待审批) { Msg msg = SiteStorageModel.NQueryInBunch(iPlanId); if (msg.Status) { List <Tbl_SiteStorageBatch> lBunch = msg.UserData as List <Tbl_SiteStorageBatch>; ViewState["ListData"] = lBunch; ViewState["Identify"] = (int)CurrentType.现场确认入库; for (int i = 0; i < lBunch.Count; i++) { build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='EnsureSiteInBunch.aspx?BuildBunchId=" + lBunch[i].BuildBatchID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' /><strong><a href='EnsureSiteInBunch.aspx?BuildBunchId=" + lBunch[i].BuildBatchID + "'>批次编号:" + lBunch[i].BuildBatchID + "</a></strong></div></li>"); } } } else if (int.Parse(type) == (int)BatchStatus.现场仓库待出库审批) { Msg msg = SiteStorageModel.NQueryEnsureOutBunch(iPlanId); if (msg.Status) { List <Tbl_OutSiteStorage> lBunch = msg.UserData as List <Tbl_OutSiteStorage>; ViewState["ListData"] = lBunch; ViewState["Identify"] = (int)CurrentType.现场确认出库; if (lBunch.Count > 0) { for (int i = 0; i < lBunch.Count; i++) { build.Append(@"<li><div style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><input type='hidden' id='chk" + i + "' value='EnsureSiteOutBunch.aspx?BuildBunchId=" + lBunch[i].BuildBatchID + "'> <input id='chk'" + i + " value=" + i + " type='checkbox' /><strong><a href='EnsureSiteOutBunch.aspx?BuildBunchId=" + lBunch[i].BuildBatchID + "'>批次编号:" + lBunch[i].BuildBatchID + "</a></strong></div></li>"); } } } } else { } } else { } list.InnerHtml = build.ToString(); } }