示例#1
0
    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
 protected void Btn_ClientSearchCancel_Click(object sender, EventArgs e)
 {
     DropDownList_ClientRegion.DataSource = PCI.SList_CRMRegionBasicInfoDrop();
     DropDownList_ClientRegion.DataBind();
     DropDownList_ClientSort.DataSource = PCI.SList_CRMCustomerSortBasicDataDrop();
     DropDownList_ClientSort.DataBind();
     GridView_Client.DataSource = PCI.SList_CRMCustomerInfoBind();
     GridView_Client.DataBind();
     UpdatePanel_ClientInfo.Update();
 }
示例#3
0
    protected void Btn_NewClientOk_Click(object sender, EventArgs e)
    {
        string CRMCIF_Name    = TextBox_NewCliengName.Text.Trim().ToString();
        string CRMRBI_Name    = DropDownList_NewClientRegion.Text.Trim().ToString();
        string CRMCSBD_Name   = DropDownList_NewClientSort.Text.Trim().ToString();
        string CRMCIF_Address = TextBox_NewClientAdress.Text.Trim().ToString();
        string CRMCIF_BinTag  = DropDownList_NewIsLabel.Text.Trim().ToString();
        string salesman       = DropDownList1.SelectedValue.ToString();

        PCI.I_CRMCustomerInfo(CRMCIF_Name, CRMRBI_Name, CRMCSBD_Name, CRMCIF_Address, CRMCIF_BinTag, salesman);
        GridView_Client.DataSource = PCI.SList_CRMCustomerInfoBind();
        GridView_Client.DataBind();
        UpdatePanel_ClientInfo.Update();
        ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('新增成功!')", true);
        Panel_NewClient.Visible = false;
        UpdatePanel_NewClient.Update();
        return;
    }
示例#4
0
    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;
    }
示例#5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Binddr();
         if (Request.QueryString["status"] == "ClientInfoSee")//出入库类别查看权限
         {
             Title = "客户信息查看";
             GridView_Client.Columns[7].Visible = false;
             GridView_Client.Columns[8].Visible = false;
             Btn_NewClient.Visible      = false;
             Btn_NewClientPhone.Visible = false;
             GridView_ClientPhone.Columns[11].Visible = false;
             GridView_ClientPhone.Columns[10].Visible = false;
             GridView_ClientPhone.Columns[9].Visible  = false;
             GridView_ClientLabel.Columns[5].Visible  = false;
             GridView_ClientLabel.Columns[6].Visible  = false;
             Button_NewLabel.Visible = false;
             DropDownList_ClientRegion.DataSource = PCI.SList_CRMRegionBasicInfoDrop();
             DropDownList_ClientRegion.DataBind();
             DropDownList_ClientSort.DataSource = PCI.SList_CRMCustomerSortBasicDataDrop();
             DropDownList_ClientSort.DataBind();
             GridView_Client.DataSource = PCI.SList_CRMCustomerInfoBind();
             GridView_Client.DataBind();
             UpdatePanel_ClientInfo.Update();
         }
         else if (Request.QueryString["status"] == "ClientInfoMange")//出入库类别查看权限
         {
             Title = "客户类别维护";
             Button_NewLabel.Visible = true;
             DropDownList_ClientRegion.DataSource = PCI.SList_CRMRegionBasicInfoDrop();
             DropDownList_ClientRegion.DataBind();
             DropDownList_ClientSort.DataSource = PCI.SList_CRMCustomerSortBasicDataDrop();
             DropDownList_ClientSort.DataBind();
             GridView_Client.DataSource = PCI.SList_CRMCustomerInfoBind();
             GridView_Client.DataBind();
             UpdatePanel_ClientInfo.Update();
             GridView_ClientLabel.Columns[5].Visible = true;
             GridView_ClientLabel.Columns[6].Visible = true;
         }
     }
 }
示例#6
0
    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;
        }
    }
示例#7
0
    protected void GridView_Client_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_Client.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_Client.PageCount ? GridView_Client.PageCount - 1 : newPageIndex;

        // specify the NewPageIndex
        GridView_Client.PageIndex = newPageIndex;
        GridView_Client.PageIndex = newPageIndex;
        if (Label16.Text == "search")
        {
            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();
        }
        else
        {
            GridView_Client.DataSource = PCI.SList_CRMCustomerInfoBind();
            GridView_Client.DataBind();
        }

        UpdatePanel_ClientInfo.Update();
    }  //读取go前textbox,导航到指定页面