Exemplo n.º 1
0
    } //行链接按钮命令

    protected void Gridview_PS_Editing(object sender, GridViewEditEventArgs e)//显示编辑产品系列状态
    {
        GridView1.SelectedIndex = e.NewEditIndex;
        GridView1.EditIndex     = e.NewEditIndex;

        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();
        } //绑定数据源
        //无关信息隐藏
        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();
    }
Exemplo n.º 2
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;

            // 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();
        }
    } //行链接按钮命令
Exemplo n.º 3
0
 protected void Button_Close_PT_Click(object sender, EventArgs e)
 {
     GridView2.SelectedIndex          = -1;
     GridView_Parameter.SelectedIndex = -1;
     Panel_PT.Visible    = false;
     Panel_AddPT.Visible = false;
     UpdatePanel_AddPT.Update();
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     Panel_CheckParameter.Visible = false;
     UpdatePanel_CheckParameter.Update();
     Txt_PT_Search.Text = "";
 }
Exemplo n.º 4
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_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();
    }
Exemplo n.º 5
0
    protected void Btn_AddPT_Click(object sender, EventArgs e)
    {
        DropDownList_BOM.DataSource     = ppl.S_BOM_Name();
        DropDownList_BOM.DataTextField  = "BOM_Name";
        DropDownList_BOM.DataValueField = "BOM_ID";
        DropDownList_BOM.DataBind();
        DropDownList_BOM.Items.Insert(0, new ListItem("请选择", ""));

        DropDownList_PR.DataSource     = ppl.S_PR_Name();
        DropDownList_PR.DataTextField  = "PR_Name";
        DropDownList_PR.DataValueField = "PR_ID";
        DropDownList_PR.DataBind();
        DropDownList_PR.Items.Insert(0, new ListItem("请选择", ""));

        Label_submitState.Text             = "新增";
        Panel_AddPT.Visible                = true;
        Txt_PT.Text                        = "";
        DropDownList_BOM.SelectedIndex     = 0;
        DropDownList_PR.SelectedIndex      = 0;
        DropDownList_Special.SelectedIndex = 0;

        UpdatePanel_AddPT.Update();
    }
Exemplo n.º 6
0
 protected void Btn_CancelPT_Click(object sender, EventArgs e)
 {
     Txt_PT.Text         = "";
     Panel_AddPT.Visible = false;
     UpdatePanel_AddPT.Update();
 }
Exemplo n.º 7
0
    protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Check_Parameter")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView2.SelectedIndex = row.RowIndex;

            //无关信息隐藏

            Panel_AddPS.Visible          = false;
            Panel_AddPT.Visible          = false;
            Panel_CheckParameter.Visible = false;


            UpdatePanel_AddPS.Update();
            UpdatePanel_AddPT.Update();
            UpdatePanel_CheckParameter.Update();



            GridView_Parameter.SelectedIndex = -1;

            string[] al   = e.CommandArgument.ToString().Split(new char[] { ',' });
            string   prid = al[0];
            Label_PRID.Text = prid;
            string ptname = al[1];
            string ptid   = al[2];
            Label_PTP.Text          = ptname;
            Label_PT_ID.Text        = ptid;
            Panel_Parameter.Visible = true;
            if (prid == "")
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('该产品尚未制定工艺路线!')", true);
                return;
            }
            Guid guid_id = new Guid(prid);
            GridView_Parameter.DataSource = ppl.S_ProType_ProcessRoute(guid_id);
            GridView_Parameter.DataBind();
            UpdatePanel_Parameter.Update();
        }
        if (e.CommandName == "Delete_PT")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView2.SelectedIndex = row.RowIndex;
            GridView2.SelectedIndex = -1;

            //无关信息隐藏

            Panel_AddPS.Visible          = false;
            Panel_AddPT.Visible          = false;
            Panel_Parameter.Visible      = false;
            Panel_CheckParameter.Visible = false;

            UpdatePanel_Parameter.Update();
            UpdatePanel_AddPS.Update();
            UpdatePanel_AddPT.Update();
            UpdatePanel_CheckParameter.Update();

            string id      = e.CommandArgument.ToString();
            Guid   guid_id = new Guid(id);
            ppl.D_ProType(guid_id);
            string condition;
            string psid    = " PS_ID='" + Label_PS.Text.Trim() + "'";
            string pt_name = Txt_PT_Search.Text.Trim() == "" ? "1=1" : "PT_Name like '%" + Txt_PT_Search.Text.Trim() + "%'";
            condition            = psid + " and " + pt_name;
            GridView2.DataSource = ppl.S_ProSeries_ProType(condition);
            GridView2.DataBind();
            UpdatePanel_PT.Update();
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!')", true);
        }
        if (e.CommandName == "Edit_PT")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView2.SelectedIndex = row.RowIndex;

            //无关信息隐藏

            Panel_AddPS.Visible = false;
            // this.Panel_AddPT.Visible = false;
            Panel_Parameter.Visible      = false;
            Panel_CheckParameter.Visible = false;

            UpdatePanel_Parameter.Update();
            UpdatePanel_AddPS.Update();
            // this.UpdatePanel_AddPT.Update();
            UpdatePanel_CheckParameter.Update();

            DropDownList_BOM.DataSource     = ppl.S_BOM_Name();
            DropDownList_BOM.DataTextField  = "BOM_Name";
            DropDownList_BOM.DataValueField = "BOM_ID";
            DropDownList_BOM.DataBind();
            DropDownList_BOM.Items.Insert(0, new ListItem("请选择", ""));

            DropDownList_PR.DataSource     = ppl.S_PR_Name();
            DropDownList_PR.DataTextField  = "PR_Name";
            DropDownList_PR.DataValueField = "PR_ID";
            DropDownList_PR.DataBind();
            DropDownList_PR.Items.Insert(0, new ListItem("请选择", ""));


            string[] a         = e.CommandArgument.ToString().Split(new char[] { ',' });
            string   ptname    = a[0];
            string   ptspecial = a[1];
            string   prid      = a[2];
            string   bomid     = a[3];
            Label_PT_ID.Text = a[4];

            Txt_PT.Text       = ptname;
            Label_ptname.Text = ptname;
            DropDownList_Special.SelectedValue = ptspecial;

            DropDownList_PR.Items.FindByValue(prid.ToString().Trim()).Selected   = true;
            DropDownList_BOM.Items.FindByValue(bomid.ToString().Trim()).Selected = true;
            Label_submitState.Text = "编辑";
            Panel_AddPT.Visible    = true;

            UpdatePanel_AddPT.Update();
        }
    }