コード例 #1
0
    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;
        }
    }
コード例 #2
0
 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();
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
    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;
    }
コード例 #7
0
    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;
    }
コード例 #8
0
 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;
 }
コード例 #9
0
    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;
    }
コード例 #10
0
 protected void Button_CancelAdd_Click(object sender, EventArgs e)
 {
     Panel_add.Visible       = false;
     TextBox_wtname_Add.Text = "";
     UpdatePanel_add.Update();
 }