Ejemplo n.º 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来触发不同事件
Ejemplo n.º 2
0
    protected void Button1_Click(object sender, EventArgs e)//确认修改区域
    {
        Guid   id     = new Guid(label1.Text.ToString());
        string name   = TextBox_Changregion.Text.Trim().ToString();
        string detail = TextBox_ChangeDetail.Text.Trim().ToString();

        cb.U_CRMCusSort(id, name, detail);
        ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('修改成功!')", true);
        Bindlingyu();
        Panel_ChangeRegion.Visible = false;
        UpdatePanel_ChangeRegion.Update();
        TextBox_Changregion.Text  = "";
        TextBox_ChangeDetail.Text = "";
    }
Ejemplo n.º 3
0
    protected void Button1_Click(object sender, EventArgs e)//确认修改区域
    {
        Guid   id     = new Guid(Session["region_id"].ToString());
        string name   = TextBox_Changregion.Text.Trim().ToString();
        string detail = TextBox_ChangeDetail.Text.Trim().ToString();

        PCB.U_CRMRegionBasicInfo(id, name, detail);
        GridView_Region.DataSource = PCB.SList_CRMRegionBasicInfo();
        GridView_Region.DataBind();
        UpdatePanel_RegionBasicInfo.Update();
        ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('修改成功!')", true);
        Panel_ChangeRegion.Visible = false;
        UpdatePanel_ChangeRegion.Update();
        return;
    }
Ejemplo n.º 4
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来触发不同事件
Ejemplo n.º 5
0
 protected void Btn_cancelChangeRE_Click(object sender, EventArgs e)//取消修改区域,
 {
     Panel_ChangeRegion.Visible = false;
     UpdatePanel_ChangeRegion.Update();
 }