Exemple #1
0
 protected void GridView_Region_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Change")
     {
         label1.Text = e.CommandArgument.ToString();
         string    temp = " and CRMCustomSortID ='" + label1.Text.ToString() + "'";
         DataSet   ds   = cb.S_CRMCusSort(temp);
         DataTable dt   = ds.Tables[0];
         TextBox_Changregion.Text   = dt.Rows[0][1].ToString();
         TextBox_ChangeDetail.Text  = dt.Rows[0][2].ToString();
         Panel_ChangeRegion.Visible = true;
         UpdatePanel_ChangeRegion.Update();
     }
     else
     if (e.CommandName == "dele")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         cb.D_CRMCusSort(new Guid(e.CommandArgument.ToString()));
         Bindlingyu();
         ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!')", true);
     }
     else if (e.CommandName == "Detail")
     {
         Panel_RegionPeople.Visible = true;
         Label16.Text = e.CommandArgument.ToString();
         GridView1_RegionPeople.DataSource = cb.S_CRMCusSort_Custome(new Guid(e.CommandArgument.ToString()));
         GridView1_RegionPeople.DataBind();
         UpdatePanel_RegionPeople.Update();
     }
 } //linkbutton链接按钮根据自身Commandname来触发不同事件
Exemple #2
0
    protected void GridView_Region_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "dele")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_Region.SelectedIndex = row.RowIndex;
            GridView_Region.SelectedIndex = -1;
            string Region_id = e.CommandArgument.ToString();
            Guid   region_id = new Guid(Region_id);
            PCB.D_CRMRegionBasicInfo(region_id);
            GridView_Region.DataSource = PCB.SList_CRMRegionBasicInfo();
            GridView_Region.DataBind();
            UpdatePanel_RegionBasicInfo.Update();
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!')", true);
            return;
        }
        else if (e.CommandName == "Change")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_Region.SelectedIndex = row.RowIndex;
            GridView_Region.SelectedIndex = -1;
            string Region_id = e.CommandArgument.ToString();
            Guid   region_id = new Guid(Region_id);
            Session["region_id"]       = e.CommandArgument.ToString();
            Panel_ChangeRegion.Visible = true;
            UpdatePanel_ChangeRegion.Update();
            TextBox_Changregion.Text  = row.Cells[1].Text.Trim().ToString();
            TextBox_ChangeDetail.Text = row.Cells[2].Text.Trim().ToString().Replace(" ", "");
            return;
        }
        else if (e.CommandName == "Detail")
        {
            Panel_RegionPeople.Visible = true;
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_Region.SelectedIndex = row.RowIndex;
            GridView_Region.SelectedIndex = -1;
            string Region_id = e.CommandArgument.ToString();
            Guid   region_id = new Guid(Region_id);
            Session["REgion_id"] = e.CommandArgument.ToString();
            GridView1_RegionPeople.DataSource = PCB.S_CRMRBI_CRMCIF(region_id);
            GridView1_RegionPeople.DataBind();
            UpdatePanel_RegionPeople.Update();

            return;
        }
    } //linkbutton链接按钮根据自身Commandname来触发不同事件
Exemple #3
0
    }  //读取go前textbox,导航到指定页面

    #endregion

    #region
    protected void GridView_RegionPeople_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        = GridView1_RegionPeople.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 >= GridView1_RegionPeople.PageCount ? GridView1_RegionPeople.PageCount - 1 : newPageIndex;

        // specify the NewPageIndex
        GridView1_RegionPeople.PageIndex = newPageIndex;

        GridView1_RegionPeople.PageIndex = newPageIndex;
        Guid id = new Guid(Session["REgion_id"].ToString());

        GridView1_RegionPeople.DataSource = PCB.S_CRMRBI_CRMCIF(id);
        GridView1_RegionPeople.DataBind();
        UpdatePanel_RegionPeople.Update();
    }  //读取go前textbox,导航到指定页面
Exemple #4
0
 protected void Btn_return_Click(object sender, EventArgs e)
 {
     Panel_RegionPeople.Visible = false;
     UpdatePanel_RegionPeople.Update();
 }