} //读取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; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { } if (Request.QueryString["status"] == "GegionSee")//区域查看权限 { Title = "销售区域查看"; Panel_ClientSort.Visible = false; GridView_Region.Columns[3].Visible = false; GridView_Region.Columns[4].Visible = false; Btn_NewStore.Visible = false; GridView_Region.DataSource = PCB.SList_CRMRegionBasicInfo(); GridView_Region.DataBind(); //this.GridView_ClientSort.DataSource = PCB.SList_CRMCustomerSortBasicData(); //this.GridView_ClientSort.DataBind(); } else if (Request.QueryString["status"] == "GegionMange") //区域维护权限 { Title = "销售区域维护"; Panel_ClientSort.Visible = false; GridView_Region.DataSource = PCB.SList_CRMRegionBasicInfo(); GridView_Region.DataBind(); } else if (Request.QueryString["status"] == "SortSee") //区域维护权限 { Title = "销售区域维护"; Panel_RegionBasicInfo1.Visible = false; UpdatePanel_RegionBasicInfo.Visible = false; GridView_ClientSort.Columns[3].Visible = false; GridView_ClientSort.Columns[4].Visible = false; Btn_newSort.Visible = false; GridView_ClientSort.DataSource = PCB.SList_CRMCustomerSortBasicData(); GridView_ClientSort.DataBind(); } else if (Request.QueryString["status"] == "SortMange") //类别维护权限 { Title = "客户类别维护"; Panel_RegionBasicInfo1.Visible = false; UpdatePanel_RegionBasicInfo.Visible = false; GridView_ClientSort.DataSource = PCB.SList_CRMCustomerSortBasicData(); GridView_ClientSort.DataBind(); } }
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; }
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; }
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,导航到指定页面