Exemplo n.º 1
0
    }  //读取go前textbox,导航到指定页面

    #endregion

    #region 客户类别表后台
    protected void GridView_ClientSort_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Change1")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_Region.SelectedIndex = row.RowIndex;
            GridView_Region.SelectedIndex = -1;
            string Sort_id = e.CommandArgument.ToString();
            Guid   sort_id = new Guid(Sort_id);
            Session["sort_id"]          = e.CommandArgument.ToString();
            Panel_ChangeSort.Visible    = true;
            TextBox_ChanSort.Text       = row.Cells[1].Text.Trim().ToString();
            TextBox_ChanSortDetail.Text = row.Cells[2].Text.Trim().ToString().Replace(" ", "");
            UpdatePanel_ChangeSort.Update();

            return;
        }
        else
        if (e.CommandName == "dele")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_Region.SelectedIndex = row.RowIndex;
            GridView_Region.SelectedIndex = -1;
            string Sort_id = e.CommandArgument.ToString();
            Guid   sort_id = new Guid(Sort_id);
            PCB.D_CRMCustomerSortBasicData(sort_id);
            GridView_ClientSort.DataSource = PCB.SList_CRMCustomerSortBasicData();
            GridView_ClientSort.DataBind();
            UpdatePanel_ClientSort.Update();
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!')", true);
            return;
        }
    }
Exemplo n.º 2
0
    protected void Btn_ChanSortName_Click(object sender, EventArgs e)//确认修改客户类别
    {
        Guid   id     = new Guid(Session["sort_id"].ToString());
        string name   = TextBox_ChanSort.Text.Trim().ToString();
        string detail = TextBox_ChanSortDetail.Text.Trim().ToString();

        PCB.U_CRMCustomerSortBasicData(id, name, detail);
        GridView_ClientSort.DataSource = PCB.SList_CRMCustomerSortBasicData();
        GridView_ClientSort.DataBind();
        UpdatePanel_ClientSort.Update();
        ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('修改成功!')", true);
        Panel_ChangeSort.Visible = false;
        UpdatePanel_ChangeSort.Update();
        return;
    }
Exemplo n.º 3
0
    protected void Btn_NewSortOk_Click(object sender, EventArgs e)//新增客户类别
    {
        string name   = TextBox_Sortname.Text.Trim().ToString();
        string detail = TextBox_SortDetail.Text.Trim().ToString();

        PCB.I_CRMCustomerSortBasicData(name, detail);
        GridView_ClientSort.DataSource = PCB.SList_CRMCustomerSortBasicData();
        GridView_ClientSort.DataBind();
        UpdatePanel_ClientSort.Update();


        ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('新增成功!')", true);
        Panel_NewSort.Visible = false;
        UpdatePanel_NewSort.Update();
        return;
    }
Exemplo n.º 4
0
    protected void GridView_ClientSort_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_ClientSort.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
        newPageIndex = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex = newPageIndex >= GridView_ClientSort.PageCount ? GridView_ClientSort.PageCount - 1 : newPageIndex;

        // specify the NewPageIndex
        GridView_ClientSort.PageIndex = newPageIndex;

        GridView_ClientSort.PageIndex  = newPageIndex;
        GridView_ClientSort.DataSource = PCB.SList_CRMCustomerSortBasicData();
        GridView_ClientSort.DataBind();
        UpdatePanel_ClientSort.Update();
    }  //读取go前textbox,导航到指定页面