protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindDropDownList1(); BindDropDownList11(); BindDropDownList111(); BindPlanMain(); BindOrder(); BindMatPlan_Add(); BindMatPlan_Original(); BindMatPlan_Week(); #region 权限 if (Request.QueryString["status"] == "PurchasingPlanLook")//采购计划查看 { Title = "采购计划查看"; Button6.Visible = false; UpdatePanel_Search.Update(); Gridview_MonthPlan.Columns[9].Visible = false; Gridview_MonthPlan.Columns[10].Visible = false; Gridview_MonthPlan.Columns[11].Visible = false; UpdatePanel_MonthPlan.Update(); Gridview_DetailPlan.Columns[11].Visible = false; Gridview_DetailPlan.Columns[12].Visible = false; Gridview_DetailPlan.Columns[13].Visible = false; Button31.Visible = false; Button2.Visible = false; Button33.Visible = false; UpdatePanel_Detail.Update(); } if (Request.QueryString["status"] == "PurchasingPlanEdit")//采购计划维护 { Title = "采购计划维护"; Button6.Visible = true; ButtonPro.Visible = true; Cbx2_SelectAll.Visible = true; Button8.Visible = true; CheckBox1.Visible = true; UpdatePanel_Search.Update(); Gridview_MonthPlan.Columns[9].Visible = true; Gridview_MonthPlan.Columns[10].Visible = false; Gridview_MonthPlan.Columns[11].Visible = true; UpdatePanel_MonthPlan.Update(); Gridview_DetailPlan.Columns[11].Visible = true; Gridview_DetailPlan.Columns[12].Visible = true; Gridview_DetailPlan.Columns[13].Visible = true; Button31.Visible = true; Button2.Visible = false; Button33.Visible = true; UpdatePanel_Detail.Update(); } if (Request.QueryString["status"] == "PurchasingPlanCheck")//采购计划审核 { Title = "采购计划审核"; Button6.Visible = false; UpdatePanel_Search.Update(); Gridview_MonthPlan.Columns[9].Visible = false; Gridview_MonthPlan.Columns[10].Visible = true; Gridview_MonthPlan.Columns[11].Visible = false; UpdatePanel_MonthPlan.Update(); Gridview_DetailPlan.Columns[11].Visible = false; Gridview_DetailPlan.Columns[12].Visible = false; Gridview_DetailPlan.Columns[13].Visible = false; Button31.Visible = false; Button2.Visible = false; Button33.Visible = false; UpdatePanel_Detail.Update(); } if (Request.QueryString["status"] == "PurchasingPlanBuy")//采购计划执行 { Title = "采购计划执行"; ButtonPro.Visible = true; Button8.Visible = true; Button17.Visible = true; Cbx2_SelectAll.Visible = true; CheckBox1.Visible = true; CheckBox3.Visible = true; Button6.Visible = false; UpdatePanel_Search.Update(); Gridview_MonthPlan.Columns[9].Visible = false; Gridview_MonthPlan.Columns[10].Visible = false; Gridview_MonthPlan.Columns[11].Visible = false; UpdatePanel_MonthPlan.Update(); Gridview_DetailPlan.Columns[0].Visible = true; Gridview_DetailPlan.Columns[11].Visible = false; Gridview_DetailPlan.Columns[12].Visible = false; Gridview_DetailPlan.Columns[13].Visible = false; Button31.Visible = false; Button2.Visible = true; Button33.Visible = false; UpdatePanel_Detail.Update(); } if (Request.QueryString["status"] == "PurchasingPlanMatBuy")//材料周计划执行 { Title = "材料周计划执行"; Panel_PMPurchaseOrder.Visible = false; UpdatePanel_PMPurchaseOrder.Update(); Button17.Visible = true; CheckBox3.Visible = true; Panel_Search.Visible = false; UpdatePanel_Search.Update(); Panel_MonthPlan.Visible = false; UpdatePanel_MonthPlan.Update(); Panel_Choose.Visible = true; Button10.Visible = false; Button11.Visible = false; UpdatePanel_Choose.Update(); //this.Label6.Text = "6CFEB693-4DE7-49F9-A0C3-2A89A5B990FB"; BindOrder(); Panel_PMPurchaseOrder.Visible = false; UpdatePanel_PMPurchaseOrder.Update(); } #endregion } }
protected void Gridview_MonthPlan_RowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow gvr = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent)); if (e.CommandName == "Detail1") { if (Gridview_MonthPlan.Rows[gvr.RowIndex].Cells[3].Text != "待提交") { Button31.Visible = false; Button33.Visible = false; Gridview_DetailPlan.Columns[12].Visible = false; Gridview_DetailPlan.Columns[13].Visible = false; UpdatePanel_Detail.Update(); } else { if (Request.QueryString["status"] == "PurchasingPlanEdit")//采购计划维护 { if (Gridview_MonthPlan.Rows[gvr.RowIndex].Cells[3].Text == "已新建") { Button31.Visible = true; Button33.Visible = true; UpdatePanel_Detail.Update(); } } } if (Request.QueryString["status"] == "PurchasingPlanBuy")//采购计划zhixing { if (Gridview_MonthPlan.Rows[gvr.RowIndex].Cells[3].Text != "审核通过") { Button2.Visible = false; UpdatePanel_Detail.Update(); } else { Button2.Visible = true; UpdatePanel_Detail.Update(); } } label53.Text = e.CommandArgument.ToString(); Panel_Detail.Visible = true; BindDetail(); UpdatePanel_Detail.Update(); } if (e.CommandName == "Delete1") { Guid id = new Guid(e.CommandArgument.ToString()); pp.Delete_PlanMain(id); ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('删除成功!')", true); BindPlanMain(); } if (e.CommandName == "Check1") { Label33.Text = e.CommandArgument.ToString(); Panel_ADDCheck.Visible = true; TextBox_AddMan.Text = Session["UserName"].ToString().Trim(); TextBox_Addtime.Text = DateTime.Now.ToShortDateString(); UpdatePanel_ADDCheck.Update(); } if (e.CommandName == "Mat1") { string state = Gridview_MonthPlan.Rows[gvr.RowIndex].Cells[3].Text.ToString(); if (state == "审核通过") { label2.Text = e.CommandArgument.ToString(); } label53.Text = e.CommandArgument.ToString(); Panel_Choose.Visible = true; UpdatePanel_Choose.Update(); } }