//驳回 protected void ButtonUnpass(object sender, EventArgs e) { Guid PTC_ID; string PTC_Man = ""; string PTC_State = ""; string PTC_Suggestion = ""; if (TextBox15.Text != "") { PTC_Suggestion = TextBox15.Text.ToString(); } PTC_ID = new Guid(label_PTC_ID.Text.ToString()); PTC_Man = Session["UserName"].ToString(); PTC_State = "驳回"; psd.UpdatePTCountersign(PTC_ID, PTC_Man, PTC_State, PTC_Suggestion); psd.UpdatePTCSate(new Guid(label_PT_ID.Text.ToString()), "会签驳回"); string condition = Getcondition(); BindGriview2(condition); string conditionn = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'"; BindGridview4(conditionn); UpdatePanel_Sign.Update(); UpdatePanel_Preserve.Update(); TextBox15.Text = ""; Panel4.Visible = false; Panel2.Visible = false; UpdatePanel2.Update(); }
//通过 protected void ButtonPass(object sender, EventArgs e) { Guid PTC_ID; string PTC_Man = ""; string PTC_State = ""; string PTC_Suggestion = ""; if (TextBox15.Text != "") { PTC_Suggestion = TextBox15.Text.ToString(); } PTC_ID = new Guid(label_PTC_ID.Text.ToString()); PTC_Man = Session["UserName"].ToString(); PTC_State = "通过"; psd.UpdatePTCountersign(PTC_ID, PTC_Man, PTC_State, PTC_Suggestion); string conditionnn = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'"; BindGridview4(conditionnn); int i = 0; foreach (GridViewRow item in Gridview4.Rows) { if (item.Cells[2].Text == "通过") { i = i + 1; } if (item.Cells[2].Text == "驳回") { i = -1; } } if (i == Gridview4.Rows.Count) { psd.UpdatePTCSate(new Guid(label_PT_ID.Text.ToString()), "会签通过"); } if (i < Gridview4.Rows.Count && i != -1) { psd.UpdatePTCSate(new Guid(label_PT_ID.Text.ToString()), "会签中"); } string condition = Getcondition(); BindGriview2(condition); string conditionn = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'"; BindGridview4(conditionn); UpdatePanel_Sign.Update(); UpdatePanel_Preserve.Update(); TextBox15.Text = ""; Panel4.Visible = false; Panel2.Visible = false; UpdatePanel2.Update(); }
protected void Button_Ccl(object sender, EventArgs e) { Panel_Sign.Visible = false; UpdatePanel_Sign.Update(); }
//会签表 protected void Gridview4_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Myloo")//查看 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview4.SelectedIndex = row.RowIndex; string condition = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'"; DataSet ds = psd.SelectProType_Special(condition); DataTable dt = ds.Tables[0]; label_PTC_ID.Text = e.CommandArgument.ToString(); string conditionn = "and PTC_ID='" + label_PTC_ID.Text + "'"; DataSet dss = psd.SelectPTCountersign(conditionn); DataTable dtt = dss.Tables[0]; if (dtt.Rows.Count > 0) { label40.Text = dt.Rows[0][28].ToString() + dtt.Rows[0][6].ToString() + "会签"; label41.Text = dtt.Rows[0][4].ToString(); label43.Text = dtt.Rows[0][2].ToString(); label44.Text = dtt.Rows[0][3].ToString(); TextBox15.Text = dtt.Rows[0][5].ToString(); } label41.Visible = true; Label42.Visible = true; label43.Visible = true; label44.Visible = true; TextBox15.Enabled = false; Button22.Visible = false; Button23.Visible = false; Button24.Visible = false; Button30.Visible = true; Panel2.Visible = true; Panel4.Visible = true; UpdatePanel2.Update(); } if (e.CommandName == "Mylloo")//会签 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview4.SelectedIndex = row.RowIndex; string condition = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'"; DataSet ds = psd.SelectProType_Special(condition); DataTable dt = ds.Tables[0]; label_PTC_ID.Text = e.CommandArgument.ToString(); string conditionn = "and PTC_ID='" + label_PTC_ID.Text + "'"; DataSet dss = psd.SelectPTCountersign(conditionn); DataTable dtt = dss.Tables[0]; if (dtt.Rows.Count > 0) { label40.Text = dt.Rows[0][28].ToString() + dtt.Rows[0][6].ToString() + "会签"; } if (dtt.Rows[0][6].ToString() == Session["Department"].ToString()) { label41.Visible = false; Label42.Visible = false; label43.Visible = false; label44.Visible = false; TextBox15.Enabled = true; Button22.Visible = true; Button23.Visible = true; Button24.Visible = true; Button30.Visible = false; Panel2.Visible = true; Panel4.Visible = true; UpdatePanel2.Update(); } else { ScriptManager.RegisterClientScriptBlock(Page, GetType(), "aa", "alert('抱歉,你没有此权限!')", true); return; } } if (e.CommandName == "Miko")//删除 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview4.SelectedIndex = row.RowIndex; label_PTC_ID.Text = e.CommandArgument.ToString(); psd.DeletePTCountersign(new Guid(label_PTC_ID.Text)); string condition = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'"; BindGridview4(condition); Panel_Sign.Visible = true; UpdatePanel_Sign.Update(); } }
protected void Gridview2_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit1")//编辑 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_PT_ID.Text = e.CommandArgument.ToString(); string condition = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'"; DataSet ds = psd.SelectProType_Special(condition); DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0) { label_Change.Text = dt.Rows[0][28].ToString() + "申请单修改"; TextBox4.Text = dt.Rows[0][12].ToString(); TextBox2.Text = dt.Rows[0][19].ToString(); } Panel_NewProjectInfo.Visible = true; UpdatePanel_NewProjectInfo.Update(); } if (e.CommandName == "Cancel1")//删除 { try { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_PT_ID.Text = e.CommandArgument.ToString(); psd.DeleteProType_Special(new Guid(label_PT_ID.Text)); BindGriview2(""); UpdatePanel_Preserve.Update(); } catch (Exception) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('已经选择了会签部门或制定了下一步信息,无法删除只能修改!')", true); return; } } if (e.CommandName == "SelectDept")//选择会签部门 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_PT_ID.Text = e.CommandArgument.ToString(); BindGridview3(""); Panel_Org.Visible = true; UpdatePanel_Org.Update(); } if (e.CommandName == "Design")//会签 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_PT_ID.Text = e.CommandArgument.ToString(); string condition = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'"; BindGridview4(condition); Gridview4.Columns[8].Visible = false; Gridview4.Columns[7].Visible = true; Panel_Sign.Visible = true; UpdatePanel_Sign.Update(); } if (e.CommandName == "Look")//查看会签 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_PT_ID.Text = e.CommandArgument.ToString(); string condition = "and PT_ID='" + new Guid(label_PT_ID.Text) + "'"; BindGridview4(condition); //this.Gridview4.Columns[7].Visible = false; //this.Gridview4.Columns[8].Visible = true; Panel_Sign.Visible = true; UpdatePanel_Sign.Update(); } if (e.CommandName == "Make")//制作 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_PT_ID.Text = e.CommandArgument.ToString(); string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); Response.Redirect("../ProductionBasicInfo/PBProType.aspx?state=specialmake&PT_ID=" + new Guid(label_PT_ID.Text)); } if (e.CommandName == "Lookinfo")//查看基础数据 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_PT_ID.Text = e.CommandArgument.ToString(); string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); Response.Redirect("../ProductionBasicInfo/PBProType.aspx?state=speciallook&PT_ID=" + new Guid(label_PT_ID.Text)); } if (e.CommandName == "MAcc")//制定时上传附件 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; label_Acc.Text = "制定"; label_PT_ID.Text = e.CommandArgument.ToString(); ShowPanel(); UpdatePanel4.Update(); } if (e.CommandName == "printpreview")//打印报表 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview2.SelectedIndex = row.RowIndex; try { Response.Redirect("../REPORT_cc/ProSpecialPrint.aspx?" + "&PT_ID=" + Gridview2.DataKeys[row.RowIndex].Values["PT_ID"].ToString()); } catch (Exception) { throw; } } }