protected void GridView_WOmain_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete12")// { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; string id = e.CommandArgument.ToString().Trim(); try { Guid guid = new Guid(id); ppl.D_ProMainSeries(guid); ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!')", true); } catch (Exception) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除失败!,请您再核对!')", true); return; } databind1(); Panel_add.Visible = false; TextBox_wtname_Add.Text = ""; UpdatePanel_add.Update(); Panel_pt.Visible = false; UpdatePanel_pt.Update(); Panel_Product.Visible = false; UpdatePanel_Product.Update(); CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; CheckBox2.Checked = false; Checkfanxuan2.Checked = false; } if (e.CommandName == "membermgt")// { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_WOmain.SelectedIndex = row.RowIndex; string[] al = e.CommandArgument.ToString().Split(new char[] { ',' }); label_S.Text = al[1]; label_SID.Text = al[0]; databind2(); Panel_add.Visible = false; TextBox_wtname_Add.Text = ""; UpdatePanel_add.Update(); Panel_pt.Visible = true; UpdatePanel_pt.Update(); Panel_Product.Visible = false; UpdatePanel_Product.Update(); CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; CheckBox2.Checked = false; Checkfanxuan2.Checked = false; } }
protected void Btn_CloseS_Click(object sender, EventArgs e) { CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; Panel_add.Visible = false; UpdatePanel_add.Update(); Panel_pt.Visible = false; UpdatePanel_pt.Update(); Panel_Product.Visible = false; UpdatePanel_Product.Update(); }
protected void Button_AddTeam_Click(object sender, EventArgs e) { Panel_add.Visible = true; TextBox_wtname_Add.Text = ""; UpdatePanel_add.Update(); Panel_pt.Visible = false; UpdatePanel_pt.Update(); Panel_Product.Visible = false; UpdatePanel_Product.Update(); CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; CheckBox2.Checked = false; Checkfanxuan2.Checked = false; }
protected void Btn_Search_Click(object sender, EventArgs e) { databind1(); Panel_add.Visible = false; TextBox_wtname_Add.Text = ""; UpdatePanel_add.Update(); Panel_pt.Visible = false; UpdatePanel_pt.Update(); Panel_Product.Visible = false; UpdatePanel_Product.Update(); CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; CheckBox2.Checked = false; Checkfanxuan2.Checked = false; }
protected void GridView_WOmain_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { GridView_WOmain.EditIndex = -1; GridView_WOmain.SelectedIndex = -1; databind1(); Panel_add.Visible = false; TextBox_wtname_Add.Text = ""; UpdatePanel_add.Update(); Panel_pt.Visible = false; UpdatePanel_pt.Update(); Panel_Product.Visible = false; UpdatePanel_Product.Update(); CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; CheckBox2.Checked = false; Checkfanxuan2.Checked = false; }
protected void GridView_LPT_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView theGrid = sender as GridView; // refer to the GridView int newPageIndex = 0; GridView_LPT.SelectedIndex = -1; if (-2 == e.NewPageIndex) { TextBox txtNewPageIndex = null; GridViewRow pagerRow = GridView_LPT.BottomPagerRow; if (null != pagerRow) { txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox"); } if (null != txtNewPageIndex && txtNewPageIndex.Text != "") { newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; } } else { newPageIndex = e.NewPageIndex; } newPageIndex = newPageIndex < 0 ? 0 : newPageIndex; newPageIndex = newPageIndex >= GridView_LPT.PageCount ? GridView_LPT.PageCount - 1 : newPageIndex; GridView_LPT.PageIndex = newPageIndex; GridView_LPT.PageIndex = newPageIndex; databind2(); Panel_add.Visible = false; TextBox_wtname_Add.Text = ""; UpdatePanel_add.Update(); Panel_pt.Visible = true; UpdatePanel_pt.Update(); Panel_Product.Visible = false; UpdatePanel_Product.Update(); CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; CheckBox2.Checked = false; Checkfanxuan2.Checked = false; }
protected void Button_ChosePT_Click(object sender, EventArgs e) { TextBox_Series.Text = ""; TextBox_ProductName.Text = ""; databind3(); Panel_add.Visible = false; TextBox_wtname_Add.Text = ""; UpdatePanel_add.Update(); Panel_pt.Visible = true; UpdatePanel_pt.Update(); Panel_Product.Visible = true; UpdatePanel_Product.Update(); CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; CheckBox2.Checked = false; Checkfanxuan2.Checked = false; }
protected void GridView_WOmain_RowEditing(object sender, GridViewEditEventArgs e) { label_Sname.Text = GridView_WOmain.Rows[e.NewEditIndex].Cells[1].Text.Trim(); GridView_WOmain.EditIndex = e.NewEditIndex; GridView_WOmain.SelectedIndex = e.NewEditIndex; databind1(); Panel_add.Visible = false; TextBox_wtname_Add.Text = ""; UpdatePanel_add.Update(); Panel_pt.Visible = false; UpdatePanel_pt.Update(); Panel_Product.Visible = false; UpdatePanel_Product.Update(); CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; CheckBox2.Checked = false; Checkfanxuan2.Checked = false; }
protected void Button_AddPTToSeries_Click(object sender, EventArgs e) { int sum = 0; try { for (int i = 0; i <= GridView_ProType.Rows.Count - 1; i++) { CheckBox CheckBox = (CheckBox)GridView_ProType.Rows[i].FindControl("CheckBox2"); if (CheckBox.Checked == true) { ppl.U_Protype_ProMainSeries(new Guid(label_SID.Text.Trim()), new Guid(GridView_ProType.DataKeys[i].Values["PT_ID"].ToString().Trim())); sum++; } } if (sum == 0) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('您没选择任何要添加的产品型号!请您再核对!')", true); return; } ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('添加成功!')", true); } catch (Exception) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('添加失败!,请您再核对!')", true); } TextBox_ProductName.Text = ""; TextBox_Series.Text = ""; databind2(); Panel_add.Visible = false; TextBox_wtname_Add.Text = ""; UpdatePanel_add.Update(); Panel_pt.Visible = true; UpdatePanel_pt.Update(); Panel_Product.Visible = false; UpdatePanel_Product.Update(); CheckBoxAll.Checked = false; CheckBoxfanxuan.Checked = false; CheckBox2.Checked = false; Checkfanxuan2.Checked = false; }
protected string GetCondition1()//用于GridView_LPT绑定 { label_pagestate.Text = Request.QueryString["state"]; string state = label_pagestate.Text; string condition1; string temp = ""; if (state == "scyjhhqbmgl") { Title = "生产月计划会签维护"; GridView_LPT.DataSource = ppp.S_PMPCountersignBasic("and PMPCB_Type = '1'"); GridView_LPT.DataBind(); UpdatePanel_pt.Update(); } if (state == "sczjhhqbmgl") { Title = "生产周计划会签维护"; GridView_LPT.DataSource = ppp.S_PMPCountersignBasic("and PMPCB_Type = '3'"); GridView_LPT.DataBind(); UpdatePanel_pt.Update(); } if (state == "mkyjhhqbmgl") { Title = "模块月计划会签维护"; GridView_LPT.DataSource = ppp.S_PMPCountersignBasic("and PMPCB_Type = '2'"); GridView_LPT.DataBind(); UpdatePanel_pt.Update(); } if (state == "mkzjhhqbmgl") { Title = "模块周计划会签维护"; GridView_LPT.DataSource = ppp.S_PMPCountersignBasic("and PMPCB_Type = '4'"); GridView_LPT.DataBind(); UpdatePanel_pt.Update(); } condition1 = temp; return(condition1); }
public void databind2() { GridView_LPT.DataSource = ppl.S_ProMainSeries_Protype(" and PMS_ID='" + label_SID.Text.Trim() + "'"); GridView_LPT.DataBind(); UpdatePanel_pt.Update(); }