コード例 #1
0
ファイル: ClientInfo.aspx.cs プロジェクト: qimengcheng/xi
    protected void Btn_ClientSearch_Click(object sender, EventArgs e)
    {
        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";
        }


        Label16.Text = "search";
        GridView_Client.DataSource = PCI.S_SearchClientInfo(ClientName, ClientRegion, ClientSort, ClientIslabel);
        GridView_Client.DataBind();
        UpdatePanel_ClientInfo_Search.Update();
        UpdatePanel_ClientInfo.Update();
    }
コード例 #2
0
ファイル: ClientInfo.aspx.cs プロジェクト: qimengcheng/xi
    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;
        }
    }