} //读取go前textbox,导航到指定页面 #endregion #region 客户联系方式表 protected void GridView_Phone_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "dele11") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_ClientPhone.SelectedIndex = row.RowIndex; string Contact_id = e.CommandArgument.ToString(); Guid contact_id = new Guid(Contact_id); PCI.Proc_D_CRMCustomerContact(contact_id); Guid DCRMCIF_ID = new Guid(Session["ClientPhoneq_id"].ToString()); GridView_ClientPhone.DataSource = PCI.SList_CRMCustomerContact(DCRMCIF_ID); GridView_ClientPhone.DataBind(); UpdatePanel_ClientPhone.Update(); return; } else if (e.CommandName == "Change") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; GridView_ClientPhone.SelectedIndex = row.RowIndex; GridView_ClientPhone.SelectedIndex = -1; string Contact_id = e.CommandArgument.ToString(); Guid contact_id = new Guid(Contact_id); Session["contact_id"] = e.CommandArgument.ToString(); TextBox_ChanPhoneName.Text = row.Cells[1].Text.Trim().ToString().Replace(" ", ""); TextBox_ChanPhonePosition.Text = row.Cells[2].Text.Trim().ToString().Replace(" ", ""); TextBox_ChanPhoneCall.Text = row.Cells[3].Text.Trim().ToString().Replace(" ", ""); TextBox_ChanPhoneMobile.Text = row.Cells[4].Text.Trim().ToString().Replace(" ", ""); TextBox_ChanPhoneFax.Text = row.Cells[5].Text.Trim().ToString().Replace(" ", ""); TextBox_ChanPhoneE_Mail.Text = row.Cells[6].Text.Trim().ToString().Replace(" ", ""); TextBox_ChanPhoneQQ.Text = row.Cells[7].Text.Trim().ToString().Replace(" ", ""); Panel_ChanClientPhone.Visible = true; UpdatePanel_ChanClientPhone.Update(); return; } else if (e.CommandName == "Important1") { sad.Update_Important(new Guid(e.CommandArgument.ToString())); Guid DCRMCIF_ID = new Guid(Session["ClientPhoneq_id"].ToString()); GridView_ClientPhone.DataSource = PCI.SList_CRMCustomerContact(DCRMCIF_ID); GridView_ClientPhone.DataBind(); UpdatePanel_ClientPhone.Update(); } }
protected void Btn_ChanPhoneOk_Click(object sender, EventArgs e) { Guid CRMCC_ID = new Guid(Session["contact_id"].ToString()); Guid CRMCIF_ID = new Guid(Session["ClientPhoneq_id"].ToString()); string CRMCC_Name = TextBox_ChanPhoneName.Text.Trim().ToString(); string CRMCC_Position = TextBox_ChanPhonePosition.Text.Trim().ToString(); string CRMCC_PhoneNum = TextBox_ChanPhoneCall.Text.Trim().ToString(); string CRMCC_TelePhoneNum = TextBox_ChanPhoneMobile.Text.Trim().ToString(); string CRMCC_FaxNum = TextBox_ChanPhoneFax.Text.Trim().ToString(); string CRMCC_Email = TextBox_ChanPhoneE_Mail.Text.Trim().ToString(); string CRMCC_QQ = TextBox_ChanPhoneQQ.Text.Trim().ToString(); PCI.Proc_U_CRMCustomerContact(CRMCC_ID, CRMCIF_ID, CRMCC_Name, CRMCC_Position, CRMCC_PhoneNum, CRMCC_TelePhoneNum, CRMCC_FaxNum, CRMCC_Email, CRMCC_QQ); GridView_ClientPhone.DataSource = PCI.SList_CRMCustomerContact(CRMCIF_ID); GridView_ClientPhone.DataBind(); Panel_ChanClientPhone.Visible = false; UpdatePanel_ChanClientPhone.Update(); UpdatePanel_ClientPhone.Update(); ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('修改成功!')", true); return; }
protected void GridView_Phone_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_ClientPhone.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_ClientPhone.PageCount ? GridView_ClientPhone.PageCount - 1 : newPageIndex; // specify the NewPageIndex GridView_ClientPhone.PageIndex = newPageIndex; GridView_ClientPhone.PageIndex = newPageIndex; //Guid CRMCIF_ID = new Guid(Session["ClientPhone_id"].ToString()); Guid CRMCIF_ID = new Guid(Label1.Text.ToString()); GridView_ClientPhone.DataSource = PCI.SList_CRMCustomerContact(CRMCIF_ID); GridView_ClientPhone.DataBind(); UpdatePanel_ClientPhone.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; } }