//根据条件检索具体随工单 protected void Button1_Fd(object sender, EventArgs e) { string Condition = GetCondition_One(); BindGridview_WorkOrder(Condition); UpdatePanel_WorkOrder.Update(); }
//检索所有随工单 protected void Button1_FD(object sender, EventArgs e) { Panel3.Visible = true; UpdatePanel3.Update(); BindGridview_WorkOrder(""); Panel_WorkOrder.Visible = true; UpdatePanel_WorkOrder.Update(); }
//选择随工单 protected void Button1_Com(object sender, EventArgs e) { bool temp = false; string Pname = ""; bool bl = false; Guid gd = new Guid(Label_SchduleID.Text.ToString()); DataSet ds = pl.SelectPRMProjectSchedule_One(gd); DataTable dt = ds.Tables[0]; string str = ""; if (dt.Rows.Count > 0) { str = dt.Rows[0][4].ToString(); } string[] sArray = Regex.Split(str, ";", RegexOptions.IgnoreCase); foreach (GridViewRow item in Gridview_WorkOrder.Rows) { CheckBox cb = item.FindControl("CheckBox1") as CheckBox; if (cb.Checked) { foreach (string i in sArray) { if (Gridview_WorkOrder.DataKeys[item.RowIndex].Value.ToString() == i) { bl = true; ScriptManager.RegisterClientScriptBlock(UpdatePanel_WorkOrder, GetType(), "aa", "alert('已重复选择随工单!')", true); return; } } if (!bl) { Pname += Gridview_WorkOrder.DataKeys[item.RowIndex].Value.ToString() + ";"; temp = true; Label_Pname.Text = Pname; } } } TextBox10.Text = TextBox10.Text + Label_Pname.Text.ToString(); UpdatePanel_Pschedule.Update(); if (!temp) { ScriptManager.RegisterClientScriptBlock(UpdatePanel_WorkOrder, GetType(), "aa", "alert('请选择随工单')", true); return; } else { TextBox12.Text = ""; TextBox_SPTime2.Text = ""; TextBox13.Text = ""; Panel3.Visible = false; UpdatePanel3.Update(); Panel_WorkOrder.Visible = false; UpdatePanel_WorkOrder.Update(); } }
protected void Button_Cancel(object sender, EventArgs e) { Panel_Pschedule.Visible = false; UpdatePanel_Pschedule.Update(); Panel3.Visible = false; UpdatePanel3.Update(); Panel_WorkOrder.Visible = false; UpdatePanel_WorkOrder.Update(); }
protected void Button1_Cancel(object sender, EventArgs e) { TextBox12.Text = ""; TextBox_SPTime2.Text = ""; TextBox13.Text = ""; Panel3.Visible = false; UpdatePanel3.Update(); Panel_WorkOrder.Visible = false; UpdatePanel_WorkOrder.Update(); }
//关闭进度表 protected void ButtonPClose(object sender, EventArgs e) { Panel2.Visible = false; UpdatePanel2.Update(); Panel_Postpone.Visible = false; UpdatePanel_Postpone.Update(); Panel_Pschedule.Visible = false; UpdatePanel_Pschedule.Update(); Panel3.Visible = false; UpdatePanel3.Update(); Panel_WorkOrder.Visible = false; UpdatePanel_WorkOrder.Update(); Panel1.Visible = false; UpdatePanel1.Update(); }
//检索项目 protected void Button1_Sh(object sender, EventArgs e) { string Condition = GetCondition(); BindGridView_Projectinfo(Condition); Panel_ProjectInfo.Visible = true; UpdatePanel_ProjectInfo.Update(); Panel2.Visible = false; UpdatePanel2.Update(); Panel_Postpone.Visible = false; UpdatePanel_Postpone.Update(); Panel_Pschedule.Visible = false; UpdatePanel_Pschedule.Update(); Panel3.Visible = false; UpdatePanel3.Update(); Panel_WorkOrder.Visible = false; UpdatePanel_WorkOrder.Update(); Panel1.Visible = false; UpdatePanel1.Update(); }
//项目进度表 protected void Gridview2_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Lay")//延期 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; Label_SchduleID.Text = e.CommandArgument.ToString(); Guid gd = new Guid(Label_SchduleID.Text.ToString()); DataSet ds = pl.SelectPRMProjectSchedule_One(gd); DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0) { TextBox6.Text = dt.Rows[0][5].ToString(); } TextBox4.Text = Gridview2.Rows[row.RowIndex].Cells[2].Text.ToString().Trim().Replace(" ", ""); //this.TextBox2.Text = this.Gridview_ProjectInfo.Rows[row.RowIndex].Cells[1].Text.ToString().Trim().Replace(" ", ""); TextBox3.Text = Gridview2.Rows[row.RowIndex].Cells[1].Text.ToString().Trim().Replace(" ", ""); TextBox5.Text = Gridview2.Rows[row.RowIndex].Cells[10].Text.ToString().Trim().Replace(" ", ""); //this.TextBox6.Text = this.Gridview2.Rows[row.RowIndex].Cells[10].Text.ToString().Trim().Replace(" ", ""); Panel_Postpone.Visible = true; UpdatePanel_Postpone.Update(); Panel_Pschedule.Visible = false; UpdatePanel_Pschedule.Update(); Panel1.Visible = false; UpdatePanel1.Update(); Panel3.Visible = false; UpdatePanel3.Update(); Panel_WorkOrder.Visible = false; UpdatePanel_WorkOrder.Update(); } if (e.CommandName == "Protect")//维护 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; Label_SchduleID.Text = e.CommandArgument.ToString(); Guid gd = new Guid(Label_SchduleID.Text.ToString()); DataSet ds = pl.SelectPRMProjectSchedule_One(gd); DataTable dt = ds.Tables[0]; Panel_Pschedule.Visible = true; if (dt.Rows.Count > 0) { TextBox10.Text = dt.Rows[0][4].ToString(); TextBox11.Text = dt.Rows[0][6].ToString(); label_AccNum.Text = dt.Rows[0][7].ToString(); label_AccName.Text = dt.Rows[0][8].ToString(); Label_FilePath.Text = dt.Rows[0][9].ToString(); if (Label_FilePath.Text.ToString() != "") { LabelQ_SaveDirectory.Text = "上传"; } } TextBox7.Text = Gridview2.Rows[row.RowIndex].Cells[2].Text.ToString().Replace(" ", ""); TextBox8.Text = Gridview_ProjectInfo.Rows[Gridview_ProjectInfo.SelectedIndex].Cells[1].Text.ToString().Replace(" ", ""); TextBox9.Text = Gridview2.Rows[row.RowIndex].Cells[1].Text.ToString().Replace(" ", ""); DropDownList3.SelectedValue = Gridview2.Rows[row.RowIndex].Cells[5].Text.ToString().Replace(" ", ""); //this.TextBox14.Text = this.Gridview2.Rows[row.RowIndex].Cells[11].Text.ToString().Replace(" ", ""); //this.TextBox15.Text = this.Gridview2.Rows[row.RowIndex].Cells[12].Text.ToString().Replace(" ", ""); //this.TextBox10.Text = this.Gridview2.Rows[row.RowIndex].Cells[6].Text.ToString().Replace(" ", ""); //this.TextBox11.Text = this.Gridview2.Rows[row.RowIndex].Cells[5].Text.ToString().Replace(" ", ""); //ShowPanel(); UpdatePanel_Pschedule.Update(); Panel_Postpone.Visible = false; UpdatePanel_Postpone.Update(); Panel1.Visible = false; UpdatePanel1.Update(); } if (e.CommandName == "Look")//附件证明查看 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; Label_SchduleID.Text = e.CommandArgument.ToString(); } if (e.CommandName == "Follow")//随工单跟踪 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; Label_SchduleID.Text = e.CommandArgument.ToString(); string item = ""; Guid gd = new Guid(Label_SchduleID.Text.ToString()); DataSet ds = pl.SelectPRMProjectSchedule_One(gd); DataTable dt = ds.Tables[0]; string str = ""; if (dt.Rows.Count > 0) { str = dt.Rows[0][4].ToString(); } string[] sArray = Regex.Split(str, ";", RegexOptions.IgnoreCase); for (int i = 0; i < sArray.Length; i++) { if (i == 0) { item = "and WO_Num='" + sArray[0] + "'"; } else { item += " or WO_Num='" + sArray[i] + "'"; } } labelcondition.Text = item; BindGridview1(labelcondition.Text); Panel1.Visible = true; UpdatePanel1.Update(); Panel_Postpone.Visible = false; UpdatePanel_Postpone.Update(); Panel_Pschedule.Visible = false; UpdatePanel_Pschedule.Update(); Panel3.Visible = false; UpdatePanel3.Update(); Panel_WorkOrder.Visible = false; UpdatePanel_WorkOrder.Update(); } }
//protected void Button1_TJ(object sender, EventArgs e) //{ // ClosePanel(); // // ShowPanel(); //} //进度填写提交 protected void Button1_TJWH(object sender, EventArgs e) { if (DropDownList3.Text.ToString() != "请选择") { PRMProjectinfo.PRMPS_ScheduleFinish = DropDownList3.SelectedValue.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_Pschedule, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox10.Text.ToString() != "") { PRMProjectinfo.PRMPS_WorkOrderNum = TextBox10.Text.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_Pschedule, typeof(Page), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox11.Text.ToString() != "") { PRMProjectinfo.PRMPS_ProcessCondition = TextBox11.Text.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_Pschedule, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } // //ok_upload_Click(); Guid gd = new Guid(Label_SchduleID.Text); PRMProjectinfo.PRMPS_ID = gd; if (LabelQ_SaveDirectory.Text != "上传") { PRMProjectinfo.PRMPS_Accessory = "否"; PRMProjectinfo.PRMPS_AccNum = ""; PRMProjectinfo.PRMPS_AccName = ""; } else if (LabelQ_SaveDirectory.Text == "上传") { PRMProjectinfo.PRMPS_Accessory = "是"; PRMProjectinfo.PRMPS_AccNum = label_AccNum.Text.ToString(); PRMProjectinfo.PRMPS_AccName = label_AccName.Text.ToString(); } PRMProjectinfo.PRMPS_AccessoryPath = Label_FilePath.Text; PRMProjectinfo.PRMPS_ProcessMan = Session["UserName"].ToString().Trim(); ppm.InsertPRMProject_Schedule(PRMProjectinfo); Guid lp = new Guid(label_projectid.Text.ToString()); PRMProjectinfo.PRMP_ID = lp; BindGridview2(PRMProjectinfo); int i = 0; bool lio = false; foreach (GridViewRow item in Gridview2.Rows) { if (item.Cells[5].Text == "是") { i++; } if (item.Cells[9].Text == "是") { lio = true; } } if (i == Gridview2.Rows.Count) { prp.UpdatePRMP_ProjectStates(lp, "已完成"); } else if (lio) { prp.UpdatePRMP_ProjectStates(lp, "进度延期"); } else if (!lio) { prp.UpdatePRMP_ProjectStates(lp, "进行中"); } BindGridview2(PRMProjectinfo); UpdatePanel2.Update(); string condition = " and PRMP_ProjectStates='" + "进度设置完成" + "'" + " or PRMP_ProjectStates='" + "进行中" + "'" + " or PRMP_ProjectStates='" + "进度延期" + "'" + " or PRMP_ProjectStates='" + "已完成" + "'"; BindGridView_Projectinfo(condition); UpdatePanel_ProjectInfo.Update(); TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; TextBox14.Text = ""; TextBox15.Text = ""; TextBox10.Text = ""; TextBox11.Text = ""; DropDownList3.SelectedValue = "请选择"; Panel_Pschedule.Visible = false; UpdatePanel_Pschedule.Update(); PRMProjectinfo.PRMP_ID = new Guid(label_projectid.Text); BindGridview2(PRMProjectinfo); UpdatePanel2.Update(); string condition1 = " and PRMP_ProjectStates='" + "进度设置完成" + "'" + " or PRMP_ProjectStates='" + "进行中" + "'" + " or PRMP_ProjectStates='" + "进度延期" + "'" + " or PRMP_ProjectStates='" + "已完成" + "'"; BindGridView_Projectinfo(condition1); UpdatePanel_ProjectInfo.Update(); Panel3.Visible = false; UpdatePanel3.Update(); Panel_WorkOrder.Visible = false; UpdatePanel_WorkOrder.Update(); //this.LabelQ_SaveDirectory.Text = ""; //this.Label_FilePath.Text = ""; }