Пример #1
0
    protected void GridView_Craft_PageIndexChanging(object sender, GridViewPageEventArgs e) //工序表分页
    {
        GridView theGrid      = sender as GridView;                                         // refer to the GridView
        int      newPageIndex = 0;

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

            GridViewRow pagerRow = GridView_Craft.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_Craft.PageCount ? GridView_Craft.PageCount - 1 : newPageIndex;
        GridView_Craft.PageIndex  = newPageIndex;
        GridView_Craft.PageIndex  = newPageIndex;
        GridView_Craft.DataSource = cmpr.S_ProcessRoute_PBCraftInfo(new Guid(Label_PRID.Text));
        GridView_Craft.DataBind();
        GridView_Craft.SelectedIndex = -1;
    }
Пример #2
0
    protected void Btn_AddCraft_Click(object sender, EventArgs e)//新增工序按钮事件
    {
        Panel_Craft.Visible = true;

        GridView_Craft.DataSource = cmpr.S_ProcessRoute_PBCraftInfo(new Guid(Label_PRID.Text));
        GridView_Craft.DataBind();
        UpdatePanel_Craft.Update();

        //无关信息隐藏
        // this.Panel_PR.Visible = false;
        Panel_AddOrEditPR.Visible = false;
        // this.Panel_CraftMgt.Visible = false;
        //this.Panel_Craft.Visible = false;
        //  UpdatePanel_PR.Update();
        UpdatePanel_AddOrEditPR.Update();
        //    UpdatePanel_CraftMgt.Update();
        //  UpdatePanel_Craft.Update();
        GridView_Craft.SelectedIndex    = -1;
        GridView_CraftMgt.SelectedIndex = -1;
    }