protected void Btn_NewLabelOk_Click(object sender, EventArgs e) { Guid CRMCIF_ID = new Guid(Session["ClientLabel_id"].ToString()); string Label_Product = TextBox_LablProduct.Text.Trim().ToString(); string Label_Name = TextBox_LabelName.Text.Trim().ToString(); string Label_Number = TextBox_LabelNumber.Text.Trim().ToString(); PCI.I_CRMCustomerBinTagDetail(CRMCIF_ID, Label_Product, Label_Name, Label_Number); GridView_ClientLabel.DataSource = PCI.SList_CRMCustomerBinTagDetail(CRMCIF_ID); GridView_ClientLabel.DataBind(); Panel_UpdatePanel_ClientLabel.Visible = true; Panel_New_Label.Visible = false; UpdatePanel_NewLabel.Update(); UpdatePanel_ClientLabel.Update(); }
protected void Btn_ChangeLabel_Click(object sender, EventArgs e) { Guid CRMCBTD_ID = new Guid(Session["ChangeLabel_id"].ToString()); Guid CRMCIF_ID = new Guid(Session["ClientLabel_id"].ToString()); string ChanLabelPro = TextBox_ChanLabelPro.Text.Trim().ToString(); string ChanLabelWu = TextBox_ChanLabelWu.Text.Trim().ToString(); string ChanLabelWuName = TextBox_ChanLabelWuName.Text.Trim().ToString(); PCI.Proc_U_CRMCustomerBinTagDetail(CRMCBTD_ID, ChanLabelPro, ChanLabelWu, ChanLabelWuName); GridView_ClientLabel.DataSource = PCI.SList_CRMCustomerBinTagDetail(CRMCIF_ID); GridView_ClientLabel.DataBind(); Panel_UpdatePanel_ClientLabel.Visible = true; Panel_ChangeLabel.Visible = false; UpdatePanel_ChangeLabel.Update(); ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('修改成功!')", true); UpdatePanel_ClientLabel.Update(); }
} //读取go前textbox,导航到指定页面 protected void GridView_ClientLabel_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "bianji") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_ClientLabel.SelectedIndex = row.RowIndex; GridView_ClientLabel.SelectedIndex = -1; string Label_id = e.CommandArgument.ToString(); Guid contact_id = new Guid(Label_id); Session["ChangeLabel_id"] = e.CommandArgument.ToString(); TextBox_ChanLabelName.Text = row.Cells[1].Text.Trim().ToString(); TextBox_ChanLabelPro.Text = row.Cells[2].Text.Trim().ToString(); TextBox_ChanLabelWu.Text = row.Cells[3].Text.Trim().ToString(); TextBox_ChanLabelWuName.Text = row.Cells[4].Text.Trim().ToString(); Panel_ChangeLabel.Visible = true; UpdatePanel_ChangeLabel.Update(); } else if (e.CommandName == "shanchu") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_ClientLabel.SelectedIndex = row.RowIndex; string label_id = e.CommandArgument.ToString(); Guid CRMCBTD_ID = new Guid(label_id); PCI.Proc_D_CRMCustomerBinTagDetail(CRMCBTD_ID); Guid CRMCIF_ID = new Guid(Session["ClientLabel_id"].ToString()); GridView_ClientLabel.DataSource = PCI.SList_CRMCustomerBinTagDetail(CRMCIF_ID); GridView_ClientLabel.DataBind(); Panel_UpdatePanel_ClientLabel.Visible = true; Panel_ChangeLabel.Visible = false; UpdatePanel_ChangeLabel.Update(); ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!')", true); UpdatePanel_ClientLabel.Update(); } }
} //读取go前textbox,导航到指定页面 #endregion #region 客户标签表 protected void GridView_ClientLabel_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_ClientLabel.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_ClientLabel.PageCount ? GridView_ClientLabel.PageCount - 1 : newPageIndex; // specify the NewPageIndex GridView_ClientLabel.PageIndex = newPageIndex; GridView_ClientLabel.PageIndex = newPageIndex; GridView_ClientLabel.DataSource = PCI.SList_CRMCustomerBinTagDetail(new Guid(Session["ClientLabel_id"].ToString())); GridView_ClientLabel.DataBind(); UpdatePanel_ClientLabel.Update(); } //读取go前textbox,导航到指定页面
protected void GridView_Client_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Change") { DropDownList_ChangeClientRegion.DataSource = PCI.SList_CRMRegionBasicInfoDrop(); DropDownList_ChangeClientRegion.DataBind(); DropDownList_ChanClientSort.DataSource = PCI.SList_CRMCustomerSortBasicDataDrop(); DropDownList_ChanClientSort.DataBind(); GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Client.SelectedIndex = row.RowIndex; GridView_Client.SelectedIndex = -1; string Client_id = e.CommandArgument.ToString(); Guid client_id = new Guid(Client_id); Session["client_id"] = e.CommandArgument.ToString(); if (row.Cells[11].Text.ToString() != "" && row.Cells[11].Text.ToString() != " ") { DropDownList2.SelectedValue = row.Cells[11].Text.ToString(); } TextBox_ChanClientName.Text = row.Cells[1].Text.Trim().ToString().Replace(" ", ""); DropDownList_ChanClientSort.Text = row.Cells[2].Text.Trim().ToString().Replace(" ", ""); DropDownList_ChangeClientRegion.Text = row.Cells[3].Text.Trim().ToString().Replace(" ", ""); TextBox_ChanClientAdress.Text = ((Label)(row.Cells[4].FindControl("Adress1"))).Text.Trim().ToString().Replace(" ", ""); //DropDownList_ChanIsLabel.Text = row.Cells[6].Text.Trim().ToString().Replace(" ", ""); Panel_ChangeClient.Visible = true; UpdatePanel_ChangeClient.Update(); return; } else if (e.CommandName == "dele") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Client.SelectedIndex = row.RowIndex; GridView_Client.SelectedIndex = -1; string Client_id = e.CommandArgument.ToString(); Guid client_id = new Guid(Client_id); PCI.Proc_D_CRMCustomerInfo(client_id); string ClientName = TextBox_Clientname1.Text.Trim().ToString(); string ClientRegion = DropDownList_ClientRegion.Text.Trim().ToString(); string ClientSort = DropDownList_ClientSort.SelectedValue.Trim().ToString(); string ClientIslabel = DropDownList_IsLabel.SelectedValue.Trim().ToString(); if (ClientName.Trim().ToString() == "".ToString()) { ClientName = (string)"123"; } if (ClientRegion.Trim().ToString() == (string)"请选择".Trim().ToString()) { ClientRegion = (string)"123"; } if (ClientSort == (string)"请选择".Trim().ToString()) { ClientSort = (string)"123"; } if (ClientIslabel.Trim().ToString() == (string)"请选择".Trim().ToString()) { ClientIslabel = (string)"123"; } GridView_Client.DataSource = PCI.S_SearchClientInfo(ClientName, ClientRegion, ClientSort, ClientIslabel); GridView_Client.DataBind(); UpdatePanel_ClientInfo_Search.Update(); UpdatePanel_ClientInfo.Update(); ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!')", true); return; } else if (e.CommandName == "Phone") { Label1.Text = e.CommandArgument.ToString(); GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Client.SelectedIndex = row.RowIndex; GridView_Client.SelectedIndex = -1; string Client_id = e.CommandArgument.ToString(); Guid client_id = new Guid(Client_id); Session["ClientPhoneq_Name"] = row.Cells[1].Text.Trim().ToString(); Session["ClientPhoneq_id"] = Client_id; GridView_ClientPhone.DataSource = PCI.SList_CRMCustomerContact(client_id); GridView_ClientPhone.DataBind(); Panel_ClientPhone.Visible = true; UpdatePanel_ClientPhone.Update(); Panel_NewClientPhone.Visible = false; UpdatePanel_NewClientPhone.Update(); } else if (e.CommandName == "Label") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_Client.SelectedIndex = row.RowIndex; GridView_Client.SelectedIndex = -1; string Client_id = e.CommandArgument.ToString(); Guid client_id = new Guid(Client_id); Session["ClientLabel_Name"] = row.Cells[1].Text.Trim().ToString(); Session["ClientLabel_id"] = e.CommandArgument.ToString(); GridView_ClientLabel.DataSource = PCI.SList_CRMCustomerBinTagDetail(client_id); GridView_ClientLabel.DataBind(); Panel_UpdatePanel_ClientLabel.Visible = true; UpdatePanel_ClientLabel.Update(); return; } }