Beispiel #1
0
    /// <summary>
    /// 函数名:GridViewShowErrorOptionList_RowCommand
    /// 作用:GridView命令自定义响应函数
    /// 作者:bush2582
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void GridViewShowErrorOptionList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        //翻页响应
        if (base.Page_Turning(GridViewShowErrorOptionList, e, this.GridViewShowErrorOptionList.PageIndex, "ASP_Pager_Text") == true)
        {
            Is_Search();
        }

        if (e.CommandName == "Check_Detail")//
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridViewShowErrorOptionList.SelectedIndex = row.RowIndex;
            GridViewShowErrorOptionList.EditIndex     = -1;
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            this.Label_PTP.Text     = al[1];
            this.Label1.Text        = al[0];
            Panel_Parameter.Visible = true;
            databind_detail();
            GridView_Parameter.SelectedIndex = -1;
            GridView_Parameter.EditIndex     = -1;
            GridView_Parameter.PageIndex     = 0;
            Panel_ADD_ErrorOption.Visible    = false;
            UpdatePanel_ADD_ErrorOption.Update();

            UpdatePanel_Parameter.Update();
            Panel_AddPS.Visible = false;
            UpdatePanel_AddPS.Update();
        }
    }
Beispiel #2
0
 /// <summary>
 /// 函数名:Asp_Input_AddNewErrorOption_Click
 /// 作用:响应页面的新增异常选项按钮,使新增模块的页面可见或不可见
 /// 作者:bush2582
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Asp_Input_AddNewErrorOption_Click(object sender, EventArgs e)
 {
     //如果再次点击按钮则转换按钮上的文字
     //if (BlIs_Close_ADD == false)
     //{
     //    this.Panel_ADD_ErrorOption.Visible = true;
     //    this.Asp_Input_AddNewErrorOption.Text = "关闭新增模块";
     //    BlIs_Close_ADD = true;
     //    GridViewShowErrorOptionList.SelectedIndex = -1;
     //}
     //else
     //{
     //    this.Asp_Input_AddNewErrorOption.Text = "新增异常原因";
     //    this.Panel_ADD_ErrorOption.Visible = false;
     //    BlIs_Close_ADD = false;
     //    GridViewShowErrorOptionList.SelectedIndex = -1;
     //}
     this.Panel_ADD_ErrorOption.Visible = true;
     BlIs_Close_ADD = true;
     GridViewShowErrorOptionList.SelectedIndex = -1;
     //置空两个text
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     this.Asp_ADD_ErrorOption_Name_Text.Text = "";
     this.Asp_ADD_ErrorOption_WDay_Text.Text = "";
     this.UpdatePanel_ADD_ErrorOption.Update();
     base.Bind_Updata(this.GridViewShowErrorOptionList, mProSeriesInfo_ProErrorTypeL.SList_ProErrorSeries(), UpdatePanel_List_ErrorOption);
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
 }
Beispiel #3
0
    /* =======================================================================================*/
    protected void GridView_Parameter_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "delete1")//
        {
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            try
            {
                ppl.D_ErrorPhenomenonOptionDetail(new Guid(al[0].Trim()));
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('删除成功!')", true);
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('删除失败!')", true);
            }

            databind_detail();
            GridView_Parameter.SelectedIndex = -1;
            GridView_Parameter.EditIndex     = -1;
            //   GridView_Parameter.PageIndex = 0;
            Panel_Parameter.Visible = true;
            UpdatePanel_Parameter.Update();
            Panel_AddPS.Visible = false;
            UpdatePanel_AddPS.Update();
        }
    }
    } //行链接按钮命令

    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();
    }
Beispiel #5
0
    protected void ButtonSearch_Click(object sender, EventArgs e)
    {
        PanelOverTimeNew.Visible = false;
        UpdatePanelOverTimeNew.Update();
        Panel_Parameter.Visible = false;
        UpdatePanel_Parameter.Update();
        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.Update();
        Label_Grid1_State.Text = "模糊搜索数据源";
        string name = TextBoxOverTime.Text;

        if (name != "")
        {
            Session["BindTable"] = OverTimeOption.SearchOverTime(name);
            BindData();
            UpdatePanelList.Update();
        }
        else
        {
            Label_Grid1_State.Text = "默认数据源";
            Session["BindTable"]   = OverTimeOption.BindOverTime();
            BindData();
            UpdatePanelList.Update();
        }
    }
Beispiel #6
0
 protected void Btn_Close_Parameter_Click(object sender, EventArgs e)
 {
     GridViewOverTime.SelectedIndex = -1;
     Panel_Parameter.Visible        = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
     UpdatePanelList.Update();
 }
Beispiel #7
0
    public void databind_detail()
    {
        string condition;

        condition = DropDownList1.SelectedItem.Text.Trim() == "所有工序" ? " and 1=1 " : " and PBC_Name like '%" + DropDownList1.SelectedItem.Text.Trim() + "%'";
        GridView_Parameter.DataSource = OverTimeOption.S_OverTimeOptionDetail(Label1.Text.Trim(), condition);
        GridView_Parameter.DataBind();
        UpdatePanel_Parameter.Update();
    }
Beispiel #8
0
 protected void Btn_Close_Parameter_Click(object sender, EventArgs e)
 {
     GridViewShowErrorOptionList.SelectedIndex = -1;
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
     UpdatePanel_List_ErrorOption.Update();
 }
Beispiel #9
0
    public void databind_detail()
    {
        string condition;

        condition = this.DropDownList1.SelectedItem.Text.Trim() == "所有工序" ? " and 1=1 " : " and PBC_Name like '%" + this.DropDownList1.SelectedItem.Text.Trim() + "%'";
        GridView_Parameter.DataSource = ppl.S_ErrorPhenomenonOptionDetail(this.Label1.Text.Trim(), condition);
        GridView_Parameter.DataBind();
        UpdatePanel_Parameter.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();
        }
    } //行链接按钮命令
Beispiel #11
0
 /// <summary>
 /// 函数名:GridViewShowErrorOptionList_PageIndexChanging
 /// 作用:GridView分页响应函数
 /// 作者:bush2582
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void GridViewShowErrorOptionList_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     IntCurrentPageIndex           = GridViewShowErrorOptionList.PageIndex;//获取当前的页面在第几页保存下来
     Panel_ADD_ErrorOption.Visible = false;
     UpdatePanel_ADD_ErrorOption.Update();
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
 }
Beispiel #12
0
 /// <summary>
 /// 函数名:Asp_Input_Btn_Reset_Click
 /// 作用:重置页面的参数
 /// 作者:bush2582
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Asp_Input_Btn_Reset_Click(object sender, EventArgs e)
 {
     base.Bind_Updata(this.GridViewShowErrorOptionList, mProSeriesInfo_ProErrorTypeL.SList_ProErrorSeries(), UpdatePanel_List_ErrorOption);
     this.Asp_Input_Search_text.Text = "";
     Panel_ADD_ErrorOption.Visible   = false;
     UpdatePanel_ADD_ErrorOption.Update();
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
 }
Beispiel #13
0
 /// <summary>
 /// 函数:GridViewShowErrorOptionList_RowEditing
 /// 作用:在点击编辑后显示更新和取消按键
 /// 作者:bush2582
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void GridViewShowErrorOptionList_RowEditing(object sender, GridViewEditEventArgs e)
 {
     this.GridViewShowErrorOptionList.EditIndex = e.NewEditIndex;
     Is_Search();
     Panel_ADD_ErrorOption.Visible = false;
     UpdatePanel_ADD_ErrorOption.Update();
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
 }
Beispiel #14
0
 protected void ButtonNew_Click(object sender, EventArgs e)
 {
     PanelOverTimeNew.Visible = true;//Panel可见
     UpdatePanelOverTimeNew.Update();
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
     GridViewOverTime.EditIndex = -1;
     Session["BindTable"]       = OverTimeOption.BindOverTime();
     BindData();
     UpdatePanelList.Update();
 }
 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 = "";
 }
    protected void GridView_Parameter_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView theGrid      = sender as GridView; // refer to the GridView
        int      newPageIndex = 0;

        if (-2 == e.NewPageIndex)
        { // when click the "GO" Button
            TextBox     txtNewPageIndex = null;
            GridViewRow pagerRow        = GridView_Parameter.BottomPagerRow;


            if (null != pagerRow)
            {
                txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox");   // refer to the TextBox with the NewPageIndex value
            }

            if (null != txtNewPageIndex && txtNewPageIndex.Text != "")
            {
                newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; // get the NewPageIndex
            }
        }
        else
        {  // when click the first, last, previous and next Button
            newPageIndex = e.NewPageIndex;
        }

        // check to prevent form the NewPageIndex out of the range


        GridView_Parameter.DataSource = ppl.S_ProType_ProcessRoute(new Guid(Label_PRID.Text));
        GridView_Parameter.DataBind();
        UpdatePanel_Parameter.Update();

        //绑定数据源

        //bindgridview1();
        newPageIndex = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex = newPageIndex >= GridView_Parameter.PageCount ? GridView_Parameter.PageCount - 1 : newPageIndex;

        // specify the NewPageIndex
        GridView_Parameter.PageIndex = newPageIndex;

        GridView_Parameter.PageIndex = newPageIndex;
        GridView_Parameter.DataBind();
    }
Beispiel #17
0
    protected void GridViewOverTime_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "DeleteOTO")//删除某行数据
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridViewOverTime.SelectedIndex = row.RowIndex;
            string id      = e.CommandArgument.ToString();
            Guid   guid_id = new Guid(id);
            if (OverTimeOption.DeleteOverTime(guid_id))
            {
                //Message.Text = "数据已成功删除!";
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('数据已成功删除!')", true);
            }
            else
            {
                Message.Text = "";
            }
            Session["BindTable"] = OverTimeOption.BindOverTime();
            BindData();
        }
        if (e.CommandName == "Check_Detail")//
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridViewOverTime.SelectedIndex = row.RowIndex;
            GridViewOverTime.EditIndex     = -1;
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            Label_PTP.Text          = al[1];
            Label1.Text             = al[0];
            Panel_Parameter.Visible = true;
            databind_detail();
            GridView_Parameter.SelectedIndex = -1;
            GridView_Parameter.EditIndex     = -1;
            GridView_Parameter.PageIndex     = 0;
            PanelOverTimeNew.Visible         = false;
            UpdatePanelOverTimeNew.Update();

            UpdatePanel_Parameter.Update();
            Panel_AddPS.Visible = false;
            UpdatePanel_AddPS.Update();
        }
    }
Beispiel #18
0
 /// <summary>
 /// 函数名:Asp_Input_Btn_Search_Click
 /// 作用:模糊查询按键的响应函数
 /// 作者:bush2582
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Asp_Input_Btn_Search_Click(object sender, EventArgs e)
 {
     if (this.Asp_Input_Search_text.Text.ToString() != "")                                                                     //保证模糊查询的字段不为空
     {
         this.GridViewShowErrorOptionList.PageIndex = 0;                                                                       //在检索的模式下,要在检索之后,让列表框返回去到第一页,从头开始显示检索到的东西
         base.Bind_Updata(this.GridViewShowErrorOptionList,
                          mProSeriesInfo_ProErrorTypeL.S_SearchErrorOption(this.Asp_Input_Search_text.Text.ToString().Trim()), //调用BLL层进行模糊查询
                          UpdatePanel_List_ErrorOption);
         BlInto_S_Search = true;
     }
     else
     {
         ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('请填写查询的条件!')", true);
     }
     Panel_ADD_ErrorOption.Visible = false;
     UpdatePanel_ADD_ErrorOption.Update();
     Panel_Parameter.Visible = false;
     UpdatePanel_Parameter.Update();
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.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();
    }
    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();
        }
    }