protected void Binddr() { DropDownList1.DataSource = pt.Select_SalesMan(""); DropDownList2.DataSource = pt.Select_SalesMan(""); DropDownList1.DataTextField = "SMSM_Name"; DropDownList1.DataValueField = "SMSM_Name"; DropDownList2.DataTextField = "SMSM_Name"; DropDownList2.DataValueField = "SMSM_Name"; DropDownList1.DataBind(); DropDownList2.DataBind(); UpdatePanel_NewClient.Update(); UpdatePanel_ChangeClient.Update(); }
protected void Btn_ChanClientOk_Click(object sender, EventArgs e) { Guid CRMCIF_ID = new Guid(Session["client_id"].ToString()); string CRMCIF_Name = TextBox_ChanClientName.Text.Trim().ToString(); string CRMRBI_Name = DropDownList_ChangeClientRegion.Text.Trim().ToString(); string CRMCSBD_Name = DropDownList_ChanClientSort.Text.Trim().ToString(); string CRMCIF_Address = TextBox_ChanClientAdress.Text.Trim().ToString(); string CRMCIF_BinTag = DropDownList_ChanIsLabel.Text.Trim().ToString(); string man = DropDownList2.SelectedValue.ToString(); PCI.U_CRMCustomerInfo(CRMCIF_ID, CRMCIF_Name, CRMRBI_Name, CRMCSBD_Name, CRMCIF_Address, CRMCIF_BinTag, man); GridView_Client.DataSource = PCI.SList_CRMCustomerInfoBind(); GridView_Client.DataBind(); UpdatePanel_ClientInfo.Update(); ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('修改成功!')", true); Panel_ChangeClient.Visible = false; UpdatePanel_ChangeClient.Update(); return; }
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; } }
protected void Btn_ChanClientCancel_Click(object sender, EventArgs e) { Panel_ChangeClient.Visible = false; UpdatePanel_ChangeClient.Update(); }