protected void Btn_Cancel_Click(object sender, EventArgs e) //取消新增
 {
     Label_Grid1_State.Text = "默认数据源";
     txt_PS.Text            = "";
     UpdatePanel_AddPS.Update();
     UpdatePanel_PS.Update();
 }
    protected void Gridview_PS_Updating(object sender, GridViewUpdateEventArgs e) //Grid编辑产品系列
    {
        DataSet   ds = ppl.S_ProSeries_Name(Convert.ToString(((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.Trim().ToString()));
        DataTable dt = ds.Tables[0];
        DataView  dv = ds.Tables[0].DefaultView;

        if (dt.Rows.Count != 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('系统中已有该产品系列名称,不能重名!')", true);
            return;
        }
        pplinfo.PS_ID   = new Guid(GridView1.DataKeys[e.RowIndex].Value.ToString());
        pplinfo.PS_Name = Convert.ToString(((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.Trim().ToString());
        ppl.U_ProSeries(pplinfo);

        GridView1.EditIndex = -1;
        if (Label_Grid1_State.Text == "默认数据源")
        {
            GridView1.DataSource = ppl.SList_ProSeries();
            GridView1.DataBind();
        }
        if (Label_Grid1_State.Text == "模糊搜索数据源")
        {
            GridView1.DataSource = ppl.S_ProSeries(Txt_search.Text.Trim());
            GridView1.DataBind();
        } //绑定数据源
        UpdatePanel_PS.Update();
    }
Example #3
0
 protected void Button_Close_PT_Click(object sender, EventArgs e)
 {
     Panel_PT.Visible = false;
     UpdatePanel_PT.Update();
     GridView1.SelectedIndex = -1;
     UpdatePanel_PS.Update();
 }
    protected void Btn_Submit_Click(object sender, EventArgs e)//提交新增产品型号
    {
        Label_Grid1_State.Text = "默认数据源";

        DataSet   ds = ppl.S_ProSeries_Name(txt_PS.Text);
        DataTable dt = ds.Tables[0];
        DataView  dv = ds.Tables[0].DefaultView;

        if (dt.Rows.Count != 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('系统中已有该产品系列名称,不能重名!')", true);
            return;
        }
        if (txt_PS.Text != "")
        {
            pplinfo.PS_Name = txt_PS.Text.Trim();
            ppl.I_ProSeries(pplinfo);
            ScriptManager.RegisterStartupScript(Panel_AddPS, typeof(Page), "alert", "alert('产品系列新增成功!')", true);
            GridView1.DataSource = ppl.SList_ProSeries();
            GridView1.DataBind();
            UpdatePanel_PS.Update();
            txt_PS.Text         = "";
            Panel_AddPS.Visible = false;
            UpdatePanel_AddPS.Update();
            UpdatePanel_PS.Update();
        }

        else
        {
            ScriptManager.RegisterStartupScript(Panel_AddPS, typeof(Page), "alert", "alert('产品系列名称不能为空!')", true);
        }
    }
Example #5
0
 protected void Btn_CloseS_Click(object sender, EventArgs e)
 {
     GridView1.SelectedIndex = -1;
     Panel_PT.Visible        = false;
     UpdatePanel_PT.Update();
     Panel_Product.Visible = false;
     UpdatePanel_Product.Update();
     UpdatePanel_PS.Update();
 }
    }  //行分页

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Delete1")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            GridView1.SelectedIndex = -1;

            // this.Lab_State.Text = "Delete1";
            string id      = e.CommandArgument.ToString();
            Guid   guid_id = new Guid(id);
            ppl.D_ProSeries(guid_id);
            GridView1.DataSource = ppl.SList_ProSeries();
            GridView1.DataBind();
            UpdatePanel_PS.Update();
            //无关信息隐藏
            Panel_PT.Visible             = false;
            Panel_AddPS.Visible          = false;
            Panel_AddPT.Visible          = false;
            Panel_CheckParameter.Visible = false;
            Panel_Parameter.Visible      = false;
            UpdatePanel_PT.Update();
            UpdatePanel_AddPS.Update();
            UpdatePanel_AddPT.Update();
            UpdatePanel_CheckParameter.Update();
            UpdatePanel_Parameter.Update();
        }


        if (e.CommandName == "CheckProType")
        {
            Panel_PT.Visible                 = true;
            GridView2.SelectedIndex          = -1;
            GridView_Parameter.SelectedIndex = -1;
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            string   id = al[0];
            Label_PsName.Text = al[1] + " 所属";
            Label_PS.Text     = id;
            Guid   guid_id   = new Guid(id);
            string condition = " PS_ID='" + id + "'";
            GridView2.DataSource = ppl.S_ProSeries_ProType(condition);
            GridView2.DataBind();
            UpdatePanel_PT.Update();
            //无关信息隐藏
            Panel_AddPS.Visible          = false;
            Panel_AddPT.Visible          = false;
            Panel_CheckParameter.Visible = false;
            Panel_Parameter.Visible      = false;
            UpdatePanel_AddPS.Update();
            UpdatePanel_AddPT.Update();
            UpdatePanel_CheckParameter.Update();
            UpdatePanel_Parameter.Update();
        }
    } //行链接按钮命令
Example #7
0
 protected void Button_Add_Click(object sender, EventArgs e)
 {
     Panel_AddPS.Visible = true;
     UpdatePanel_AddPS.Update();
     Panel_Product.Visible = false;
     Panel_PT.Visible      = false;
     UpdatePanel_PT.Update();
     UpdatePanel_Product.Update();
     GridView1.SelectedIndex = -1;
     UpdatePanel_PS.Update();
 }
Example #8
0
    public void databind1()
    {
        string condition;
        string IPSM_Type = Txt_search.Text.Trim() == "" ? " and 1=1 " : " and IPSM_Type like '%" + Txt_search.Text.Trim() + "%' ";

        condition            = IPSM_Type;
        GridView1.DataSource = ip.S_IPSMain(condition);
        GridView1.DataBind();
        GridView1.SelectedIndex = -1;
        UpdatePanel_PS.Update();
    }
Example #9
0
    public void datebind1()
    {
        string condition;
        string HRDD_StaffNO = Txt_search.Text.Trim() == "" ? " and 1=1 " : " and HRDD_StaffNO like '%" + Txt_search.Text.Trim() + "%' ";
        string HRDD_Name    = TextBox1.Text.Trim() == "" ? " and 1=1 " : " and HRDD_Name like '%" + TextBox1.Text.Trim() + "%' ";
        string pbcname      = TextBox2.Text.Trim() == "" ? " and 1=1 " : " and pbcname like '%" + TextBox2.Text.Trim() + "%' ";

        condition            = HRDD_StaffNO + HRDD_Name + pbcname;
        GridView1.DataSource = cs.S_CSUser(condition);
        GridView1.DataBind();
        UpdatePanel_PS.Update();
    }
Example #10
0
    protected void Button_Add_Click(object sender, EventArgs e)
    {
        GridView1.SelectedIndex = -1;
        Panel_Product.Visible   = true;

        GridView_ProType.PageIndex = 0;
        GridView1.PageIndex        = 0;
        GridView1.SelectedIndex    = 0;
        Panel_PT.Visible           = false;
        UpdatePanel_PT.Update();
        datebind3();
        UpdatePanel_PS.Update();
    }
Example #11
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Delete1")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            GridView1.SelectedIndex = -1;

            try
            {
                string id      = e.CommandArgument.ToString();
                Guid   guid_id = new Guid(id);
                ppl.D_WorkOrderCode(guid_id);
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除失败!请先删除该代码下所属的产品型号!')", true);
            }

            GridView1.DataSource = ppl.SList_WorkOrderCode();
            GridView1.DataBind();
            UpdatePanel_PS.Update();
            //无关信息隐藏

            Panel_AddPS.Visible = false;

            UpdatePanel_AddPS.Update();
        }
        if (e.CommandName == "CheckProType")
        {
            Panel_PT.Visible        = true;
            GridView2.SelectedIndex = -1;

            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;

            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            string   id = al[0];
            Label_PsName.Text = al[1] + " 所属";
            Label_PS.Text     = id;
            Guid guid_id = new Guid(id);


            databind();
            //无关信息隐藏
            Panel_AddPS.Visible = false;
            UpdatePanel_AddPS.Update();
            Panel_Product.Visible = false;
            UpdatePanel_Product.Update();
        }
    }
Example #12
0
 protected void Button_Add_Click(object sender, EventArgs e)
 {
     GridView1.EditIndex     = -1;
     GridView1.SelectedIndex = -1;
     GridView1.DataSource    = ppl.SList_WorkOrderCode();
     GridView1.DataBind();
     UpdatePanel_PS.Update();
     Panel_AddPS.Visible = true;
     UpdatePanel_AddPS.Update();
     Panel_Product.Visible = false;
     Panel_PT.Visible      = false;
     UpdatePanel_PT.Update();
     UpdatePanel_Product.Update();
 }
 protected void Btn_Search_Click(object sender, EventArgs e) //搜索产品系列
 {
     Label_Grid1_State.Text = "模糊搜索数据源";
     Label_Search.Text      = Txt_search.Text.Trim();
     if (Txt_search.Text != "")
     {
         GridView1.DataSource = ppl.S_ProSeries(Txt_search.Text.Trim());
         GridView1.DataBind();
         UpdatePanel_PS.Update();
     }
     else
     {
         Label_Grid1_State.Text = "默认数据源";
         GridView1.DataSource   = ppl.SList_ProSeries();
         GridView1.DataBind();
         UpdatePanel_PS.Update();
     }
 }
Example #14
0
    protected void Btn_Submit_Click(object sender, EventArgs e)
    {
        Label_Grid1_State.Text = "默认数据源";

        DataSet   ds = ppl.S_WorkOrderCode_Name(txt_PS.Text);
        DataTable dt = ds.Tables[0];
        DataView  dv = ds.Tables[0].DefaultView;

        if (dt.Rows.Count != 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('系统中已有该随工单产品代码,不能重名!')", true);
            return;
        }
        if (txt_PS.Text.Trim() != "")
        {
            string PS_Name = txt_PS.Text.Trim();
            ppl.I_WorkOrderCode(PS_Name);
            ScriptManager.RegisterStartupScript(Panel_AddPS, typeof(Page), "alert", "alert('随工单产品代码新增成功!')", true);
            GridView1.DataSource = ppl.SList_WorkOrderCode();
            GridView1.DataBind();
            UpdatePanel_PS.Update();
            txt_PS.Text         = "";
            Panel_AddPS.Visible = false;
            UpdatePanel_AddPS.Update();
            UpdatePanel_PS.Update();
        }
        else
        {
            ScriptManager.RegisterStartupScript(Panel_AddPS, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
        }
        Regex rx = new Regex("^[\u4E00-\u9FA5]+$");

        if (rx.IsMatch(txt_PS.Text.ToString()))
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('随工单产品代码中不能含有汉字!请核对')", true);
            return;
        }
        if (!(txt_PS.Text.Trim().Length == 2))
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('随工单产品代码只能为两位!')", true);
            return;
        }
    }
Example #15
0
    protected void Button_Cancel_Click(object sender, EventArgs e)
    {
        Label_Grid1_State.Text = "默认数据源";
        Txt_search.Text        = "";
        GridView1.DataSource   = ppl.SList_ProSeries();
        GridView1.DataBind();
        UpdatePanel_PS.Update();
        UpdatePanel_Search.Update();
        UpdatePanel_AddPS.Update();
        //无关信息隐藏
        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.Update();

        GridView1.SelectedIndex = -1;
        UpdatePanel_PS.Update();

        Panel_PT.Visible = false;
        UpdatePanel_PT.Update();
        Panel_Product.Visible = false;
        UpdatePanel_Product.Update();
    }
    protected void Button_Cancel_Click(object sender, EventArgs e) //取消搜索产品系列
    {
        Label_Grid1_State.Text = "默认数据源";
        Txt_search.Text        = "";
        GridView1.DataSource   = ppl.SList_ProSeries();
        GridView1.DataBind();
        UpdatePanel_PS.Update();
        UpdatePanel_Search.Update();
        UpdatePanel_AddPS.Update();

        //无关信息隐藏
        Panel_PT.Visible             = false;
        Panel_AddPS.Visible          = false;
        Panel_AddPT.Visible          = false;
        Panel_CheckParameter.Visible = false;
        Panel_Parameter.Visible      = false;
        UpdatePanel_PT.Update();
        UpdatePanel_AddPS.Update();
        UpdatePanel_AddPT.Update();
        UpdatePanel_CheckParameter.Update();
        UpdatePanel_Parameter.Update();
    }
Example #17
0
 protected void Btn_Search_Click(object sender, EventArgs e)
 {
     GridView1.EditIndex    = -1;
     Label_Grid1_State.Text = "模糊搜索数据源";
     Label_Search.Text      = Txt_search.Text.Trim();
     if (Txt_search.Text != "")
     {
         GridView1.DataSource = ppl.S_WorkOrderCode(Txt_search.Text.Trim());
         GridView1.DataBind();
         UpdatePanel_PS.Update();
     }
     else
     {
         Label_Grid1_State.Text = "默认数据源";
         GridView1.DataSource   = ppl.SList_WorkOrderCode();
         GridView1.DataBind();
         UpdatePanel_PS.Update();
     }
     Panel_PT.Visible = false;
     UpdatePanel_PT.Update();
     Panel_Product.Visible = false;
     UpdatePanel_Product.Update();
 }