Exemplo n.º 1
0
 protected void Btn_Cancel_Click(object sender, EventArgs e) //取消新增
 {
     Label_Grid1_State.Text = "默认数据源";
     txt_PS.Text            = "";
     UpdatePanel_AddPS.Update();
     UpdatePanel_PS.Update();
 }
Exemplo n.º 2
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();
        }
    }
Exemplo n.º 3
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.º 4
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();
        }
    }
Exemplo n.º 5
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();
 }
Exemplo n.º 6
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Delete1")
        {
            try
            {
                // this.Lab_State.Text = "Delete1";
                string id      = e.CommandArgument.ToString();
                Guid   guid_id = new Guid(id);
                ip.D_IPSMain(guid_id);
                databind1();
                clear();
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('该测试类别已有详细项目信息或产品型号已引用该测试类别,无法删除,请另外新建!')", true);
            }
        }
        if (e.CommandName == "CheckProType")
        {
            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];
            Label2.Text    = al[1] + " 所属 ";
            Label_MID.Text = id;
            databind2();
            Panel_AddPS.Visible = false;
            UpdatePanel_AddPS.Update();
            Panel1.Visible = true;
            Panel3.Visible = false;
            UpdatePanel2.Update();
        }
    }
Exemplo n.º 7
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();
        }
    }
Exemplo n.º 8
0
    protected void Btn_confirmAdd1_Click(object sender, EventArgs e)
    {
        if (TextBox1.Text.Trim() == "")
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('测试参数类别不能为空!')", true);
            return;
        }
        DataSet ds = ip.S_IPSMain("");

        DataRow[] rows = ds.Tables[0].Select("IPSM_Type='" + TextBox1.Text.Trim() + "'");
        if (rows.Length > 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('系统中已存在该测试参数类别!请重新填写')", true);
            return;
        }
        try
        {
            ip.I_IPSMain(TextBox1.Text.Trim());
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('新增失败')", true);
            return;
        }
        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.Update();
        databind1();
    }
Exemplo n.º 9
0
    protected void GridView_Parameter_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView theGrid      = sender as GridView; // refer to the GridView
        int      newPageIndex = 0;

        GridView_Parameter.SelectedIndex = -1;
        if (-2 == e.NewPageIndex)
        {
            TextBox txtNewPageIndex = null;

            GridViewRow pagerRow = GridView_Parameter.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_Parameter.PageCount ? GridView_Parameter.PageCount - 1 : newPageIndex;
        GridView_Parameter.PageIndex = newPageIndex;
        databind_detail();

        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.Update();
    }
Exemplo n.º 10
0
    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);
        }
    }
Exemplo n.º 11
0
    protected void Btn_Submit_Click(object sender, EventArgs e)
    {
        if (txt_PS.Text.ToString() == "" || DropDownList2.SelectedIndex == 0)
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
            return;
        }
        string condition = " and a.PBC_ID = '" + DropDownList2.SelectedValue.ToString().Trim() + "'";

        DataSet ds = OverTimeOption.S_OverTimeOptionDetail(Label1.Text.Trim(), condition);

        DataRow[] rows = ds.Tables[0].Select(" OTOD_Name='" + txt_PS.Text + "'");
        if (rows.Length > 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('" + DropDownList2.SelectedItem.Text.Trim() + " 工序下已存在名为 " + txt_PS.Text.Trim() + " 的详细项目名称!请重新填写')", true);
            return;
        }
        try
        {
            OverTimeOption.I_OverTimeOptionDetail(new Guid(Label1.Text.Trim()), txt_PS.Text.Trim(), new Guid(DropDownList2.SelectedValue.ToString().Trim()));
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('新增成功!')", true);
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('新增失败!')", true);
            return;
        }
        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.Update();
        databind_detail();
    }
Exemplo n.º 12
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();
 }
Exemplo n.º 13
0
 public void clear()
 {
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
     Panel1.Visible = false;
     UpdatePanel1.Update();
     Panel3.Visible = false;
     UpdatePanel2.Update();
 }
Exemplo n.º 14
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();
 }
Exemplo n.º 15
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.º 16
0
 protected void Button_Add2_Click(object sender, EventArgs e)
 {
     Panel_AddPS.Visible = false;
     UpdatePanel_AddPS.Update();
     Panel1.Visible = true;
     UpdatePanel1.Update();
     Panel3.Visible = true;
     TextBox2.Text  = "";
     UpdatePanel2.Update();
 }
Exemplo n.º 17
0
 protected void Btn_Close_Parameter0_Click(object sender, EventArgs e)
 {
     Panel_AddPS.Visible = true;
     txt_PS.Text         = "";
     GridView_Parameter.SelectedIndex = -1;
     GridView_Parameter.EditIndex     = -1;
     DropDownList2.SelectedIndex      = 0;
     UpdatePanel_AddPS.Update();
     databind_detail();
 }
Exemplo n.º 18
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();
 }
Exemplo n.º 19
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();
 }
Exemplo n.º 20
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();
 }
Exemplo n.º 21
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();
 }
Exemplo n.º 22
0
    protected void GridView_Parameter_RowEditing(object sender, GridViewEditEventArgs e)
    {
        GridView_Parameter.EditIndex = e.NewEditIndex;
        string value1 = ((Label)GridView_Parameter.Rows[e.NewEditIndex].FindControl("lbl1")).Text;

        Label17.Text = GridView_Parameter.Rows[e.NewEditIndex].Cells[1].Text.Trim();
        Label2.Text  = value1;
        databind_detail();
        ((DropDownList)GridView_Parameter.Rows[e.NewEditIndex].FindControl("ddl1")).SelectedIndex = ((DropDownList)GridView_Parameter.Rows[e.NewEditIndex].FindControl("ddl1")).Items.IndexOf(((DropDownList)GridView_Parameter.Rows[e.NewEditIndex].FindControl("ddl1")).Items.FindByText(value1));;

        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.Update();
    }
Exemplo n.º 23
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();
 }
Exemplo n.º 24
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();
        }
    }
Exemplo n.º 25
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();
 }
Exemplo n.º 26
0
    protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView theGrid      = sender as GridView; // refer to the GridView
        int      newPageIndex = 0;

        GridView2.SelectedIndex = -1;
        if (-2 == e.NewPageIndex)
        {
            TextBox txtNewPageIndex = null;

            GridViewRow pagerRow = GridView2.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 >= GridView2.PageCount ? GridView2.PageCount - 1 : newPageIndex;
        GridView2.PageIndex = newPageIndex;
        GridView2.PageIndex = newPageIndex;

        databind();
        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.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;
    }
Exemplo n.º 27
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_WorkOrderCode();
            GridView1.DataBind();
        }
        if (Label_Grid1_State.Text == "模糊搜索数据源")
        {
            GridView1.DataSource = ppl.S_WorkOrderCode(Txt_search.Text.Trim());
            GridView1.DataBind();
        } //绑定数据源
        //无关信息隐藏
        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.Update();
    }
Exemplo n.º 28
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_ProSeries(new Guid(Label_PS.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      = "";
        databind();
        Panel_AddPS.Visible = false;
        UpdatePanel_AddPS.Update();
        DataBind();
        GridView2.PageIndex     = 0;
        GridView2.SelectedIndex = -1;
        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;
    }
Exemplo n.º 29
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;
        }
    }
Exemplo n.º 30
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();
        }
    }