protected void bt_ComputeMixRate_Click(object sender, EventArgs e)
    {
        if (ViewState["ClientID"] != null && ViewState["Month"] != null)
        {
            int client = (int)ViewState["ClientID"];
            int month = (int)ViewState["Month"];
            int brand = ConfigHelper.GetConfigInt("MixesBrandID");

            decimal mixesrate = new CM_ClientBLL(client).GetBrandSalesVolumeRate(month, brand);

            decimal InvoiceCost, DiscountRate, RebateRate, WriteOffCost, WriteOffCost2;
            if (decimal.TryParse(tbx_InvoiceCost.Text, out InvoiceCost) &&
                decimal.TryParse(tbx_DiscountRate.Text, out DiscountRate) &&
                decimal.TryParse(tbx_RebateRate.Text, out RebateRate))
            {
                decimal summary = InvoiceCost * (1 - DiscountRate / 100) * RebateRate / 100;

                WriteOffCost = summary * (1 - mixesrate);
                WriteOffCost2 = summary * mixesrate;

                if (ViewState["AvailCost"] != null && WriteOffCost > (decimal)ViewState["AvailCost"])
                {
                    WriteOffCost = (decimal)ViewState["AvailCost"];
                }

                tbx_WriteOffCost.Text = WriteOffCost.ToString("0.00");
                tbx_WriteOffCost2.Text = WriteOffCost2.ToString("0.00");

                MessageBox.Show(this, string.Format("合计总报销金额:{0:0.##元},冲调占当月该客户销量的{1:0.0%},冲调需承担{2:0.00元}费用!", summary, mixesrate, WriteOffCost2));
            }

        }
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            if ((int)ViewState["ID"] > 0)
            {
                BindData();
            }
            if (Request.QueryString["ClientID"] != null)
            {
                int clientid = int.Parse(Request.QueryString["ClientID"]);

                MCSSelectControl control = (MCSSelectControl)UC_DetailView1.FindControl("CM_LinkMan_ClientID");
                if (control != null)
                {
                    CM_ClientBLL client = new CM_ClientBLL(clientid);
                    control.SelectValue = clientid.ToString();
                    control.SelectText = client.Model.FullName;
                    control.Enabled = false;
                }
            }
        }
    }
    protected void bt_AddApply_Click(object sender, EventArgs e)
    {
        bt_OK_Click(null, null);
        if (CM_LinkManBLL.GetModelList("ClientID=" + ViewState["ClientID"].ToString()).Count == 0)
        {
            MessageBox.Show(this, "对不起,请至少提供一名客户联系人!");
            return;
        }
        CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);

        NameValueCollection dataobjects = new NameValueCollection();
        dataobjects.Add("ID", bll.Model.ID.ToString());
        dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
        dataobjects.Add("ClientName", bll.Model.FullName);
        dataobjects.Add("Channel", bll.Model["RTChannel"]);
        dataobjects.Add("StoreAnalysis", bll.Model["Store_Analysis"]);
        dataobjects.Add("IsACClient", bll.Model["IsACClient"]);

        int TaskID = EWF_TaskBLL.NewTask("Add_Retailer", (int)Session["UserID"], "终端门店名称:" + bll.Model.FullName, "~/SubModule/CM/RT/RetailerDetail.aspx?ClientID=" + ViewState["ClientID"].ToString(), dataobjects);
        if (TaskID > 0)
        {
            bll.Model["TaskID"] = TaskID.ToString();
            bll.Model["State"] = "2";
            bll.Update();
            //new EWF_TaskBLL(TaskID).Start();        //直接启动流程
        }

        Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindDropDown();

            string path = Request.QueryString["ReportPath"] != null ? Request.QueryString["ReportPath"] : "";

            if (path == "" && Session["ReportPath"] != null)
                path = Session["ReportPath"].ToString();

            if (path != "")
            {
                ViewState["ReportPath"] = path;
                ViewState["ReportServerUrl"] = Request.QueryString["ReportServerUrl"] != null ? Request.QueryString["ReportServerUrl"] : "";

                if (ViewState["ReportServerUrl"].ToString() == string.Empty)
                    ViewState["ReportServerUrl"] = ConfigHelper.GetConfigString("ReportServerUrl");

                //ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
                //ReportViewer1.ServerReport.ReportPath = ViewState["ReportPath"].ToString();
                //ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());
            }
            string ClientID = Request.QueryString["ClientID"] != null ? Request.QueryString["ClientID"] : Session["ClientID"] == null ? "" : Session["ClientID"].ToString();
            if (string.IsNullOrEmpty(ClientID))
            {
                Response.Redirect("../CM/DI/DistributorList.aspx");
            }
            select_Client.PageUrl = "../CM/PopSearch/Search_SelectClient.aspx?ClientType=2";
            CM_ClientBLL client = new CM_ClientBLL(int.Parse(ClientID));
            select_Client.SelectText = client.Model.FullName;
            select_Client.SelectValue = ClientID;
        }
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            ViewState["TradeClient"] = Request.QueryString["TradeClient"] != null ? int.Parse(Request.QueryString["TradeClient"]) : 0;

            tbx_begin.Text = DateTime.Now.ToString("yyyy-MM-01");
            tbx_end.Text = DateTime.Now.ToString("yyyy-MM-dd");

            BindDropDown();

            if ((int)ViewState["TradeClient"] != 0)
            {
                CM_Client c = new CM_ClientBLL((int)ViewState["TradeClient"]).Model;
                if (c != null)
                {
                    select_TradeClient.SelectText = c.FullName;
                    select_TradeClient.SelectValue = c.ID.ToString();
                }
            }

            BindGrid();
        }
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                Session["ClientID"] = ViewState["ClientID"];
            }
            else if (Session["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
            }

            if (ViewState["ClientID"] != null)
            {
                CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);
                select_Retailer.SelectValue = ViewState["ClientID"].ToString();
                select_Retailer.SelectText = client.Model.FullName;
                BindGrid();
                bt_Add.Enabled = true;
            }
            else
                bt_Add.Enabled = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                Session["ClientID"] = ViewState["ClientID"];
            }
            else if (Session["ClientID"] != null)
                ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());

            BindDropDown();

            if (ViewState["ClientID"] != null)
            {
                CM_ClientBLL _r = new CM_ClientBLL((int)ViewState["ClientID"]);
                select_Client.SelectText = _r.Model.FullName;
                select_Client.SelectValue = _r.Model.ID.ToString();
                tr_OrganizeCity.SelectValue = _r.Model.OrganizeCity.ToString();

                tr_OrganizeCity.Enabled = false;
                select_Client.Enabled = false;
                ViewState["ClientType"] = _r.Model.ClientType;
            }

            select_Client.PageUrl = "~/SubModule/CM/PopSearch/Search_SelectClient.aspx?ClientType=2";
            BindGrid();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 获取页面参数
            if (Request.QueryString["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                Session["ClientID"] = ViewState["ClientID"];
            }
            else if (Session["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
            }
            ViewState["ClientType"] = Request.QueryString["ClientType"] == null ? 2 : int.Parse(Request.QueryString["ClientType"]); //客户类型,2:经销商,3:终端门店
            #endregion

            BindDropDown();

            if (ViewState["ClientID"] != null)
            {
                CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);
                if (Request.QueryString["ClientType"] != null && client.Model.ClientType != (int)ViewState["ClientType"])
                {
                    Session["ClientID"] = null;
                    Response.Redirect(Request.Url.PathAndQuery);
                }
                ViewState["ClientType"] = client.Model.ClientType;

                select_Client.SelectValue = client.Model.ID.ToString();
                select_Client.SelectText = client.Model.FullName;
                select_Client.PageUrl = "~/SubModule/CM/PopSearch/Search_SelectClient.aspx?ClientType=" + ViewState["ClientType"].ToString();

                switch (client.Model.ClientType)
                {
                    case 2:
                        lb_ClientInfo.NavigateUrl = "~/SubModule/CM/DI/DistributorDetail.aspx?ClientID=" + ViewState["ClientID"].ToString();
                        break;
                    case 3:
                        lb_ClientInfo.NavigateUrl = "~/SubModule/CM/RT/RetailerDetail.aspx?ClientID=" + ViewState["ClientID"].ToString();
                        break;
                    case 5:
                        lb_ClientInfo.NavigateUrl = "~/SubModule/CM/Hospital/HospitalDetail.aspx?ClientID=" + ViewState["ClientID"].ToString();
                        break;
                    case 6:
                        lb_ClientInfo.NavigateUrl = "~/SubModule/CM/PD/PropertyDetail.aspx?ClientID=" + ViewState["ClientID"].ToString();
                        break;
                    default:
                        lb_ClientInfo.Visible = false;
                        break;
                }

                BindGrid();
            }
            else
            {
                MessageBox.ShowAndRedirect(this, "请先在‘零售商列表’中选择要查看的零售商!", "../CM/RT/RetailerList.aspx?URL=" + Request.Url.PathAndQuery);
            }
        }
    }
        /// <summary>
        /// 获取所有行政城市
        /// </summary>
        /// <param name="AuthKey"></param>
        /// <returns></returns>
        public static List<OfficialCity> GetAllOfficialCitys(UserInfo User)
        {
            LogWriter.WriteLog("OfficialCitySerice.GetAllOfficialCitys:UserName="******"MCS_SYS.dbo.Addr_OfficialCity", c.OfficialCity, 1);
                    if (prov > 0)
                        citys = Addr_OfficialCityBLL.GetModelList("Level<=3 AND Level1_SuperID=" + prov.ToString());
                }
            }

            if (citys == null) citys = Addr_OfficialCityBLL.GetModelList("Level<=3");

            List<OfficialCity> lists = new List<OfficialCity>(citys.Count);
            foreach (Addr_OfficialCity item in citys)
            {
                lists.Add(new OfficialCity(item));
            }
            return lists;
        }
    private void Bind()
    {
        CM_ContractBLL _cmbll = new CM_ContractBLL((int)ViewState["ContractID"]);
        lb_Code.Text = _cmbll.Model.ContractCode;
        lb_Supplier.InnerText = lb_Supplier2.InnerText = getSupplier(_cmbll.Model.Client);

        CM_ClientBLL _client = new CM_ClientBLL(_cmbll.Model.Client);
        lb_Client.InnerText = lb_Client3.InnerText = _client.Model.FullName;
        if (_client.Model["IsRMSClient"] != "2" && _client.Model["IsRMSClient"] != "0")
        {
            lbl_fjfjp.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;α金装袋装400G 、能慧全品项、新配方全品项、米粉全品项&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_fjffl.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_fjfxdcp.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;α金装三联包&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_fjfxdcpfl.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_jfcp.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_jffl.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_wfljf.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;雅士利金装、超级金装、普装安贝慧全品项、α金装罐装900G及盒装400G&nbsp;&nbsp;&nbsp;&nbsp;";
        }
        else
        {
            lbl_fjfjp.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;α金装袋装400G 、能慧全品项、新配方全品项、米粉全品项&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_fjffl.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_fjfxdcp.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;α金装三联包&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_fjfxdcpfl.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_jfcp.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;普装安贝慧全品项、α金装罐装900G及盒装400G &nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_jffl.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            lbl_wfljf.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;雅士利金装及超级金装 &nbsp;&nbsp;&nbsp;&nbsp;";
        }
        lb_StartTime.InnerText = _cmbll.Model.BeginDate.ToString("yyyy年MM月dd日");
        lb_EndTime.InnerText = _cmbll.Model.EndDate.ToString("yyyy年MM月dd日");
        lb_ClientAccount.InnerText = _cmbll.Model["BankAccountNo"].ToString();
        lb_AccountName.InnerText = _cmbll.Model["BankName"].ToString();
        lb_Client2.InnerText = _cmbll.Model["AccountName"];
        //lb_Percent.InnerText = "甲方:" + _cmbll.Model["RebateRate"] + "+" + "乙方:" + _cmbll.Model["DIRebateRate"] + "=" + ((decimal.Parse(_cmbll.Model["RebateRate"]) + decimal.Parse(_cmbll.Model["DIRebateRate"])).ToString("0.##"));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 获取页面参数
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
            int _relateclient = 0;
            if (staff.Model["RelateClient"] != "" && int.TryParse(staff.Model["RelateClient"], out _relateclient))
            {
                ViewState["ClientID"] = _relateclient;
                select_Client.Enabled = false;
            }
            else
            {
                if (Request.QueryString["ClientID"] != null)
                {
                    ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                    Session["ClientID"] = ViewState["ClientID"];
                }
                else if (Session["ClientID"] != null && Request.QueryString["State"] == null && Request.QueryString["ApproveFlag"] == null)
                {
                    ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
                }
            }
            #endregion

            if (ViewState["ClientID"] != null)
            {
                CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);
                select_Client.SelectValue = ViewState["ClientID"].ToString();
                select_Client.SelectText = client.Model.FullName;

            }
        }
    }
    protected void gv_List_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        int id = (int)gv_List.DataKeys[e.NewSelectedIndex][0];

        CM_ClientBLL bll = new CM_ClientBLL(id);
        Response.Redirect("~/SubModule/SVM/SalesVolumeBatchInput.aspx?Type=2&ClientID=" + id.ToString());
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            ViewState["ClientID"] = Request.QueryString["ClientID"] == null ? 0 : int.Parse(Request.QueryString["ClientID"]);
            if ((int)ViewState["ID"] == 0)
            {

                if (ViewState["ClientID"] != null)
                {
                    CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);
                    MCSSelectControl select_Client = UC_DetailView1.FindControl("FNA_ClientPaymentForcast_Client") == null ? null : (MCSSelectControl)UC_DetailView1.FindControl("FNA_ClientPaymentForcast_Client");
                    if (select_Client != null)
                    {
                        select_Client.SelectValue = ViewState["ClientID"].ToString();
                        select_Client.SelectText = client.Model.FullName;
                        select_Client.Enabled = false;
                    }
                }
                bt_Approve.Visible = false;
                btn_CancleApprove.Visible = false;
            }
            else
            {
                BindData();
            }
        }
    }
    protected void bt_BatchInput2_Click(object sender, EventArgs e)
    {
        int clientid = 0;

        switch ((int)ViewState["Type"])
        {
            case 1:     //办事处仓库出货(经销商进货)
            case 2:     //经销商出货(终端门店进货)
            case 4:     //办事处仓库进货
                int.TryParse(select_Client.SelectValue, out clientid);
                break;
            case 3:     //终端门店销售
                int.TryParse(select_Supplier.SelectValue, out clientid);
                break;
        }

        if (clientid == 0)
        {
            MessageBox.Show(this, "请选择客户!");
            return;
        }

        CM_ClientBLL _r = new CM_ClientBLL(clientid);
        if (_r.Model.ExtPropertys["DIClassify"].ToString() == "3")
        {
            MessageBox.Show(this, "经销商子户头不可以录入销量!");
            return;
        }

        Response.Redirect("SalesVolumeBatchInput.aspx?Type=" + ViewState["Type"].ToString() + "&ClientID=" + clientid.ToString() + "&IsCXP=1");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                Session["ClientID"] = ViewState["ClientID"];
            }
            else if (Session["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
            }

            BindDropDown();

            if (ViewState["ClientID"] != null)
            {
                CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);

                select_Client.SelectValue = ViewState["ClientID"].ToString();
                select_Client.SelectText = client.Model.FullName;

                tr_OrganizeCity.SelectValue = client.Model.OrganizeCity.ToString();

                select_Client.Enabled = false;
                tr_OrganizeCity.Enabled = false;
            }
        }
    }
    protected void bt_AddApply_Click(object sender, EventArgs e)
    {
        bt_OK_Click(null, null);
        if ((int)ViewState["ClientID"] == 0)
        {
            MessageBox.Show(this, "对不起,请您先保存后在发起申请");
            return;
        }

        CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);

        NameValueCollection dataobjects = new NameValueCollection();
        dataobjects.Add("ID", ViewState["ClientID"].ToString());
        dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
        dataobjects.Add("ClientName", bll.Model.FullName.ToString());
        dataobjects.Add("OperateClassify", bll.Model["OperateClassify"]);
        dataobjects.Add("DIClassify", bll.Model["DIClassify"]);

        int TaskID = EWF_TaskBLL.NewTask("Add_Distributor", (int)Session["UserID"], "新增经销商流程,经销商名称:" + bll.Model.FullName, "~/SubModule/CM/DI/DistributorDetail.aspx?ClientID=" + ViewState["ClientID"].ToString(), dataobjects);
        if (TaskID > 0)
        {
            bll.Model["TaskID"] = TaskID.ToString();
            bll.Model["State"] = "2";
            bll.Update();
            //new EWF_TaskBLL(TaskID).Start();        //直接启动流程
        }

        Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
    }
    protected void bt_In_Click(object sender, EventArgs e)
    {
        Save();

        CM_Client client = new CM_ClientBLL((int)ViewState["ClientID"]).Model;
        if (client == null) return;

        PDT_StandardPriceBLL standardprice = new PDT_StandardPriceBLL((int)ViewState["StandardPrice"]);

        foreach (GridViewRow row in gv_List_FacProd.Rows)
        {
            CheckBox cb_check = (CheckBox)row.FindControl("cb_Check");
            if (cb_check.Checked)
            {
                PDT_ProductPriceBLL _bll;
                if ((int)ViewState["PriceID"] != 0)
                    _bll = new PDT_ProductPriceBLL((int)ViewState["PriceID"]);
                else
                    return;

                PDT_ProductPrice_Detail pd = new PDT_ProductPrice_Detail();
                pd.PriceID = (int)ViewState["PriceID"];
                pd.Product = int.Parse(gv_List_FacProd.DataKeys[row.RowIndex]["ID"].ToString());

                #region 将标准价表中的价格设置到价表中
                if ((int)ViewState["StandardPrice"] > 0)
                {
                    PDT_StandardPrice_Detail d = standardprice.Items.FirstOrDefault(p => p.Product == pd.Product);
                    if (d != null)
                    {
                        pd.FactoryPrice = d.FactoryPrice;

                        if (client.ClientType == 3)      //门店
                        {
                            pd.BuyingPrice = d.TradeInPrice;
                            pd.SalesPrice = d.StdPrice;
                        }
                        else if (client.ClientType == 2)
                        {
                            if (client["DIClassify"] == "1")    //一级经销商
                            {
                                pd.BuyingPrice = d.FactoryPrice;
                                pd.SalesPrice = d.TradeInPrice;
                            }
                            else if (client["DIClassify"] == "2")     //分销商
                            {
                                pd.BuyingPrice = d.TradeOutPrice;
                                pd.SalesPrice = d.TradeInPrice;
                            }
                        }
                    }
                }
                #endregion

                _bll.AddDetail(pd);
            }
        }
        Response.Redirect("PDT_ProductPriceDetail2.aspx?PriceID=" + ViewState["PriceID"].ToString());
    }
 private void BindData()
 {
     CM_Client m = new CM_ClientBLL((int)Session["OwnerClient"]).Model;
     if (m != null)
         pl_detail.BindData(m);
     else
         MessageBox.Show(this, "找不到经销商!");
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 获取页面参数
            if (Request.QueryString["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                Session["ClientID"] = ViewState["ClientID"];
            }
            else if (Session["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
            }
            ViewState["ClientType"] = Request.QueryString["ClientType"] == null ? 0 : int.Parse(Request.QueryString["ClientType"]); //客户类型,2:经销商,3:终端门店

            #endregion

            tbx_begin.Text = DateTime.Now.AddMonths(-3).ToString("yyyy-MM-dd");
            tbx_end.Text = DateTime.Now.ToString("yyyy-MM-dd");

            if (ViewState["ClientID"] != null)
            {
                CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);

                if (Request.QueryString["ClientType"] != null && client.Model.ClientType != (int)ViewState["ClientType"])
                {
                    Session["ClientID"] = null;
                    Response.Redirect(Request.Url.PathAndQuery);
                }
                ViewState["ClientType"] = client.Model.ClientType;

                select_Client.SelectValue = ViewState["ClientID"].ToString();
                select_Client.SelectText = client.Model.FullName;
                select_Client.PageUrl = "~/SubModule/CM/PopSearch/Search_SelectClient.aspx?ClientType=" +
                    client.Model.ClientType.ToString();// +"&OrganizeCity=" + client.Model.OrganizeCity.ToString();

                UploadFile1.RelateID = (int)ViewState["ClientID"];
                BindGrid();

                Header.Attributes["WebPageSubCode"] = "ClientType=" + ViewState["ClientType"].ToString();
            }
            else
            {
                if ((int)Session["AccountType"] == 2)
                {
                    Response.Redirect("ClientPictureList.aspx?ClientID=" + Session["UserID"].ToString());
                }
                else
                {
                    if ((int)ViewState["ClientType"] == 2)
                        MessageBox.ShowAndRedirect(this, "请先在‘经销商列表’中选择要查看的经销商!", "DI/DistributorList.aspx?URL=" + Request.Url.PathAndQuery);
                    else
                        MessageBox.ShowAndRedirect(this, "请先在‘零售商列表’中选择要查看的零售商!", "RT/RetailerList.aspx?URL=" + Request.Url.PathAndQuery);
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            #region 获取页面参数
            if (Request.QueryString["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                Session["ClientID"] = ViewState["ClientID"];
            }
            else if (Session["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
            }
            ViewState["ClientType"] = Request.QueryString["ClientType"] == null ? 2 : int.Parse(Request.QueryString["ClientType"]); //客户类型,2:经销商,3:终端门店
            #endregion

            BindDropDown();

            if (ViewState["ClientID"] != null)
            {
                CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);

                if (Request.QueryString["ClientType"] != null && client.Model.ClientType != (int)ViewState["ClientType"])
                {
                    Session["ClientID"] = null;
                    Response.Redirect(Request.Url.PathAndQuery);
                }
                ViewState["ClientType"] = client.Model.ClientType;

                tr_OrganizeCity.SelectValue = client.Model.OrganizeCity.ToString();
                tr_OrganizeCity.Enabled = false;
                select_Client.SelectValue = ViewState["ClientID"].ToString();
                select_Client.SelectText = client.Model.FullName;
                select_Client.PageUrl = "~/SubModule/CM/PopSearch/Search_SelectClient.aspx?ClientType=" + ViewState["ClientType"].ToString() + "&OrganizeCity=" + tr_OrganizeCity.SelectValue;
                select_Client_SelectChange(null, null);

                BindGrid();

            }
            else
            {

            }
            Header.Attributes["WebPageSubCode"] = "ClientType=" + ViewState["ClientType"].ToString();
            select_Client.PageUrl = "~/SubModule/CM/PopSearch/Search_SelectClient.aspx?ClientType=" + ViewState["ClientType"].ToString();
            //else
            //{
            //    if ((int)ViewState["ClientType"] == 2)
            //        MessageBox.ShowAndRedirect(this, "请先在‘经销商列表’中选择要查看的经销商!", "../CM/DI/DistributorList.aspx?URL=" + Request.Url.PathAndQuery);
            //    else if ((int)ViewState["ClientType"] == 3)
            //        MessageBox.ShowAndRedirect(this, "请先在‘零售商列表’中选择要查看的零售商!", "../CM/RT/RetailerList.aspx?URL=" + Request.Url.PathAndQuery);
            //    else
            //        MessageBox.ShowAndRedirect(this, "请先在‘仓库列表’中选择要查看的仓库!", "../CM/Store/StoreList.aspx?URL=" + Request.Url.PathAndQuery);
            //}
        }
    }
 private string getSupplier(int ID)
 {
     CM_ClientBLL c = new CM_ClientBLL(ID);
     while (c.Model.ClientType >= 2 && c.Model["DIClassify"] != "1")
     {
         c = new CM_ClientBLL(c.Model.Supplier);
     }
     return c.Model.FullName;
 }
Exemplo n.º 22
0
 protected void bt_Approve_Click(object sender, EventArgs e)
 {
     if ((int)ViewState["ClientID"] != 0)
     {
         CM_ClientBLL _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
         _bll.Model.ApproveFlag = 1;
         _bll.Update();
         MessageBox.ShowAndRedirect(this, "审核仓库资料成功!", "StoreDetail.aspx?ClientID=" + ViewState["ClientID"].ToString());
     }
 }
Exemplo n.º 23
0
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        CM_ClientBLL _bll = null;
        if (ViewState["ClientID"] == null)
        {
            _bll = new CM_ClientBLL();
        }
        else
        {
            _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
        }

        pl_detail.GetData(_bll.Model);

        #region 判断必填项
        if (_bll.Model.OrganizeCity == 0)
        {
            MessageBox.Show(this, "所属的管理片区必填!");
            return;
        }
        if (_bll.Model.OfficalCity == 0)
        {
            MessageBox.Show(this, "所属的行政城市必填!");
            return;
        }
        if (_bll.Model.OrganizeCity > 1 && _bll.Model.Supplier == 0)
        {
            MessageBox.Show(this, "供货商信息必填!");
            return;
        }
        #endregion

        #region 判断活跃标志
        if (_bll.Model.ActiveFlag == 1 && _bll.Model.CloseTime != new DateTime(1900, 1, 1))
            _bll.Model.CloseTime = new DateTime(1900, 1, 1);

        if (_bll.Model.ActiveFlag == 2 && _bll.Model.CloseTime == new DateTime(1900, 1, 1))
            _bll.Model.CloseTime = DateTime.Now;
        #endregion

        if (ViewState["ClientID"] == null)
        {
            _bll.Model.ClientType = 1;
            _bll.Model.ApproveFlag = 2;
            _bll.Model.InsertStaff = (int)Session["UserID"];
            ViewState["ClientID"] = _bll.Add();
        }
        else
        {
            _bll.Model.UpdateStaff = (int)Session["UserID"];
            _bll.Update();
        }

        MessageBox.ShowAndRedirect(this, "保存仓库资料成功!", "StoreDetail.aspx?ClientID=" + ViewState["ClientID"].ToString());
    }
 protected void select_OrgSupplier_SelectChange(object sender, MCSControls.MCSWebControls.SelectChangeEventArgs e)
 {
     if (select_OrgSupplier.SelectValue != "")
     {
         CM_Client client = new CM_ClientBLL(int.Parse(select_OrgSupplier.SelectValue)).Model;
         if (client != null)
         {
             lb_Prompt.Text = "注意:该操作将会替换原" + ((int)ViewState["Supplier"] != 0?"成品":"赠品")+ "供货商为【" + client.FullName + "】的所有客户(含分销商及零售商),请小心操作!";
         }
     }
 }
Exemplo n.º 25
0
 protected string ShowClient(int id)
 {
     string clientname = "";
     IList<CM_DIUsers> lists = CM_DIUsersBLL.GetModelList("ShipID=" + id.ToString());
     foreach (CM_DIUsers item in lists)
     {
         CM_Client c = new CM_ClientBLL(item.Client).Model;
         if (c != null) clientname += "<a href='DistributorDetail.aspx?ClientID=" + c.ID.ToString() + "' target='_blank' class='listViewTdLinkS1'>"
             + c.FullName + "</a><br/>";
     }
     return clientname;
 }
Exemplo n.º 26
0
    private void BindData()
    {
        lb_ID.Text = ViewState["ClientID"].ToString();

        CM_Client m = new CM_ClientBLL((int)ViewState["ClientID"]).Model;

        pl_detail.BindData(m);

        if (m.ApproveFlag == 1)
        {
            bt_Approve.Visible = false;
        }
    }
 protected void select_Client_SelectChange(object sender, MCSControls.MCSWebControls.SelectChangeEventArgs e)
 {
     if (e.SelectValue != "" && e.SelectValue != "0")
     {
         CM_ClientBLL _bll = new CM_ClientBLL(int.Parse(e.SelectValue));
         if (_bll.Model["LastMonthIsRMSClient"] == "1")
         {
             bt_BatchInput.Visible  = false;
             bt_BatchInput2.Visible = false;
         }
         tr_OrganizeCity.SelectValue = _bll.Model.OrganizeCity.ToString();
     }
 }
 protected void bt_Approve_Click(object sender, EventArgs e)
 {
     if ((int)ViewState["ClientID"] != 0)
     {
         CM_ClientBLL _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
         _bll.Model.ApproveFlag = 1;
         _bll.Model.ActiveFlag = 1;
         if (_bll.Model.OpenTime.Year == 1900) _bll.Model.OpenTime = DateTime.Today;
         _bll.Model.CloseTime = new DateTime(1900, 1, 1);
         _bll.Update();
         MessageBox.ShowAndRedirect(this, "审核物业资料成功!", "PropertyDetail.aspx?ClientID=" + ViewState["ClientID"].ToString());
     }
 }
    private void BindData2()
    {
        CM_Client client = new CM_ClientBLL((int)ViewState["Supplier2"]).Model;
        if (client != null)
        {
            select_OrgSupplier.SelectText = client.FullName;
            select_OrgSupplier.SelectValue = client.ID.ToString();

            lb_Prompt.Text = "注意:该操作将会替换原赠品供货商为【" + client.FullName + "】的所有客户(含分销商及零售商),请小心操作!";
        }

        select_OrgSupplier.PageUrl += "&OrganizeCity=" + client.OrganizeCity;
        select_NewSupplier.PageUrl += "&OrganizeCity=" + client.OrganizeCity;
    }
    protected void select_RelateClient_SelectChange(object sender, MCSControls.MCSWebControls.SelectChangeEventArgs e)
    {
        if (!string.IsNullOrEmpty(select_RelateClient.SelectValue))
        {
            int       client = int.Parse(select_RelateClient.SelectValue);
            CM_Client c      = new CM_ClientBLL(client).Model;

            if (c != null && c.OfficalCity != 0)
            {
                tr_OfficailCity.SelectValue = c.OfficalCity.ToString();
                tr_OfficailCity.Enabled     = false;
            }
        }
    }
    private void BindData()
    {
        CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);

        pl_detail.BindData(bll.Model);

        if (bll.Model.ApproveFlag == 1)
        {
            Header.Attributes["WebPageSubCode"] = "Modify";
            bt_Approve.Visible = false;
        }

        BindGrid();
    }
Exemplo n.º 32
0
    protected string setmap(int id)
    {
        CM_ClientBLL     client = new CM_ClientBLL(id);
        CM_ClientGeoInfo info   = CM_ClientGeoInfoBLL.GetGeoInfoByClient(id);

        if (info == null)
        {
            return("showmap('',0,0)");
        }
        else
        {
            return(string.Format("showmap(\"{0}\",{1},{2})", client.Model.FullName, info.Longitude, info.Latitude));
        }
    }
    protected void bt_AddContract3_Click(object sender, EventArgs e)
    {
        bt_OK_Click(null, null);
        CM_ClientBLL _cm = new CM_ClientBLL((int)ViewState["ClientID"]);
        IList <PM_PromotorInRetailer> pms = PM_PromotorInRetailerBLL.GetModelList("Client=" + ViewState["ClientID"] + "AND EXISTS (SELECT 1 FROM MCS_Promotor.dbo.PM_Promotor " +
                                                                                  " WHERE Dimission=1 AND ApproveFlag=1 AND PM_Promotor.ID=PM_PromotorInRetailer.Promotor)");

        if (_cm.Model.ClientManager == 0 || pms.Count == 0)
        {
            MessageBox.Show(this, "门店无负责人或者无导购不能新增导购协议!");
            return;
        }
        Response.Redirect("RetailerContractDetail.aspx?ClientID=" + ViewState["ClientID"].ToString() + "&Classify=3");
    }
Exemplo n.º 34
0
    private void select_RelateClient_SelectChange(object sender, SelectChangeEventArgs e)
    {
        int _clientid = 0;

        if (!string.IsNullOrEmpty(select_RelateClient.SelectValue) && int.TryParse(select_RelateClient.SelectValue, out _clientid))
        {
            TextBox      tbx_Address = (TextBox)pl_detail.FindControl("JN_Journal_Address");
            CM_ClientBLL _c          = new CM_ClientBLL(_clientid);
            if (tbx_Address != null && _c.Model != null)
            {
                tbx_Address.Text = _c.Model.Address;
            }
        }
    }
 protected void bt_Search_Click(object sender, EventArgs e)
 {
     int client = 0;
     if (int.TryParse(select_Client.SelectValue, out client))
     {
         CM_ClientBLL _bll = new CM_ClientBLL(client);
         if (_bll.Model.ClientType==2&&_bll.Model["DIClassify"] == "1")
         {
             Response.Redirect("JXCSummary_List.aspx?ClientID=" + _bll.Model.ID.ToString() + "&ClientType=2");
         }
     }
     gv_List.PageIndex = 0;
     BindGrid();
 }
Exemplo n.º 36
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            ViewState["PrepareMode"] = Request.QueryString["PrepareMode"] != null?int.Parse(Request.QueryString["PrepareMode"]) : 0;

            tbx_begin.Text = DateTime.Today.AddDays(-7).ToString("yyyy-MM-dd");
            tbx_end.Text   = DateTime.Today.ToString("yyyy-MM-dd");

            BindDropDown();

            if (!string.IsNullOrEmpty(Request.QueryString["Classify"]) && ddl_Classify.Items.FindByValue(Request.QueryString["Classify"]) != null)
            {
                ddl_Classify.SelectedValue = Request.QueryString["Classify"];
                ddl_Classify.Enabled       = false;
            }
            if (!string.IsNullOrEmpty(Request.QueryString["State"]) && ddl_State.Items.FindByValue(Request.QueryString["State"]) != null)
            {
                ddl_State.SelectedValue = Request.QueryString["State"];
                ddl_State.Enabled       = false;
            }
            if ((int)ViewState["PrepareMode"] > 1)
            {
                bt_Add.Visible = false;
            }

            if (!string.IsNullOrEmpty(Request.QueryString["BeginDate"]))
            {
                tbx_begin.Text = Request.QueryString["BeginDate"];
            }
            if (!string.IsNullOrEmpty(Request.QueryString["EndDate"]))
            {
                tbx_end.Text = Request.QueryString["EndDate"];
            }
            if (!string.IsNullOrEmpty(Request.QueryString["ClientID"]))
            {
                int clientid = 0;
                int.TryParse(Request.QueryString["ClientID"], out clientid);
                CM_Client c = new CM_ClientBLL(clientid).Model;
                if (c != null)
                {
                    select_Client.SelectValue = c.ID.ToString();
                    select_Client.SelectText  = c.FullName;
                }
            }

            BindGrid();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 获取页面参数
            if (Request.QueryString["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                Session["ClientID"]   = ViewState["ClientID"];
            }
            else if (Session["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
            }

            ViewState["ContractID"] = Request.QueryString["ContractID"] == null ? 0 : int.Parse(Request.QueryString["ContractID"]);
            #endregion

            BindDropDown();

            if ((int)ViewState["ContractID"] != 0)
            {
                CM_Contract _contract = new CM_ContractBLL((int)ViewState["ContractID"]).Model;
                if (_contract != null)
                {
                    ViewState["ClientID"] = _contract.Client;
                }
            }

            if (ViewState["ClientID"] != null && (int)ViewState["ClientID"] > 0)
            {
                CM_Client c = new CM_ClientBLL((int)ViewState["ClientID"]).Model;
                select_Client.SelectText  = c.FullName;
                select_Client.SelectValue = c.ID.ToString();
                select_Client_SelectChange(null, null);
                //tr_OrganizeCity.SelectValue = c.OrganizeCity.ToString();
            }

            if ((int)ViewState["ContractID"] != 0)
            {
                ListItem item = ddl_Contract.Items.FindByValue(ViewState["ContractID"].ToString());
                if (item != null)
                {
                    ddl_Contract.ClearSelection();
                    item.Selected = true;
                    ddl_Contract_SelectedIndexChanged(null, null);
                }
            }
        }
    }
Exemplo n.º 38
0
    private void BindData(string username)
    {
        MembershipUser user = Membership.GetUser(username, false);

        if (user != null)
        {
            lb_Username.Text = user.UserName;

            Org_Staff staff = UserBLL.GetStaffByUsername(user.UserName);
            if (staff != null)
            {
                select_Staff.SelectText  = staff.RealName;
                select_Staff.SelectValue = staff.ID.ToString();
            }
            else
            {
                CM_Client client = new CM_ClientBLL(UserBLL.GetClientIDByUsername(user.UserName)).Model;
                if (client != null)
                {
                    //商业客户
                    select_Client.SelectValue = client.ID.ToString();
                    select_Client.SelectText  = client.FullName;
                }
                else
                {
                    //导购
                    MCSFramework.Model.Promotor.PM_Promotor p =
                        new MCSFramework.BLL.Promotor.PM_PromotorBLL(UserBLL.GetPromotorIDByUsername(user.UserName)).Model;
                    if (p != null)
                    {
                        select_Promotor.SelectValue = p.ID.ToString();
                        select_Promotor.SelectText  = p.Name;
                    }
                }
            }
            tbx_Email.Text = user.Email;

            bt_Unlock.Visible    = user.IsLockedOut;
            bt_UnApprove.Visible = user.IsApproved;
            bt_Approve.Visible   = !user.IsApproved;

            BindUserInRole();
            BindGrid();
        }
        else
        {
            MessageBox.ShowAndRedirect(this, "用户名不存在!", "UserList.aspx");
        }
    }
Exemplo n.º 39
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面

        if (!Page.IsPostBack)
        {
            #region 获取当前员工的关联经销商
            Org_StaffBLL staff         = new Org_StaffBLL((int)Session["UserID"]);
            int          _relateclient = 0;
            if (staff.Model["RelateClient"] != "" && int.TryParse(staff.Model["RelateClient"], out _relateclient))
            {
                ViewState["ClientID"] = _relateclient;
                select_Client.Enabled = false;
            }
            else
            {
                if (Request.QueryString["ClientID"] != null)
                {
                    ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                    Session["ClientID"]   = ViewState["ClientID"];
                }
                else if (Session["ClientID"] != null)
                {
                    ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
                }
            }
            #endregion

            BindDropDown();
            // Session["MCSMenuControl_FirstSelectIndex"] = "12";
            MCSTabControl1.SelectedIndex = 0;

            if (ViewState["ClientID"] != null)
            {
                CM_Client client = new CM_ClientBLL((int)ViewState["ClientID"]).Model;
                select_Client.SelectValue = ViewState["ClientID"].ToString();
                select_Client.SelectText  = client.FullName;
                if (client.ClientType != 2)
                {
                    MessageBox.ShowAndRedirect(this, "请先在‘经销商列表’中选择要查看的经销商!", "DistributorList.aspx?URL=" + Request.Url.PathAndQuery);
                }
                BindGrid();
            }
            //else
            //{
            //    MessageBox.ShowAndRedirect(this, "请先在‘经销商列表’中选择要查看的经销商!", "DistributorList.aspx?URL=" + Request.Url.PathAndQuery);
            //}
        }
    }
    protected void bt_Search_Click(object sender, EventArgs e)
    {
        int client = 0;

        if (int.TryParse(select_Client.SelectValue, out client))
        {
            CM_ClientBLL _bll = new CM_ClientBLL(client);
            if (_bll.Model["DIClassify"] == "2")
            {
                Response.Redirect("JXCSummary_ListSub.aspx?ClientID=" + _bll.Model.ID.ToString() + "&ClientType=2");
            }
        }
        gv_List.PageIndex = 0;
        BindGrid();
    }
Exemplo n.º 41
0
 /// <summary>
 /// 绑定客户信息
 /// </summary>
 /// <param name="transferoutclient">调出客户</param>
 /// <param name="transferinclient">调进客户</param>
 private void BindClientInfo(int transferoutclient, int transferinclient)
 {
     if (transferoutclient > 0)
     {
         CM_ClientBLL _s = new CM_ClientBLL(transferoutclient);
         select_Supplier.SelectText  = _s.Model.FullName;
         select_Supplier.SelectValue = _s.Model.ID.ToString();
     }
     if (transferinclient > 0)
     {
         CM_ClientBLL _r = new CM_ClientBLL(transferinclient);
         select_Client.SelectText  = _r.Model.FullName;
         select_Client.SelectValue = _r.Model.ID.ToString();
     }
 }
Exemplo n.º 42
0
    private void BindData2()
    {
        CM_Client client = new CM_ClientBLL((int)ViewState["Supplier2"]).Model;

        if (client != null)
        {
            select_OrgSupplier.SelectText  = client.FullName;
            select_OrgSupplier.SelectValue = client.ID.ToString();

            lb_Prompt.Text = "注意:该操作将会替换原赠品供货商为【" + client.FullName + "】的所有客户(含分销商及零售商),请小心操作!";
        }

        select_OrgSupplier.PageUrl += "&OrganizeCity=" + client.OrganizeCity;
        select_NewSupplier.PageUrl += "&OrganizeCity=" + client.OrganizeCity;
    }
    private void BindDropDown()
    {
        ddl_Supplier.DataSource = CM_ClientBLL.GetSupplierByTDP((int)Session["OwnerClient"]).OrderBy(p => p.FullName);
        ddl_Supplier.DataBind();

        CM_Client _c = new CM_ClientBLL((int)Session["OwnerClient"]).Model;
        if (_c != null && ddl_Supplier.Items.FindByValue(_c.OwnerClient.ToString()) != null)
            ddl_Supplier.SelectedValue = _c.OwnerClient.ToString();

        ddl_ClientWareHouse.DataSource = CM_WareHouseBLL.GetByClient((int)Session["OwnerClient"]).Where(p => p.Classify == 1);
        ddl_ClientWareHouse.DataBind();

        ddl_Salesman.DataSource = Org_StaffBLL.GetStaffList("Org_Staff.OwnerClient=" + Session["OwnerClient"].ToString() + " AND Org_Staff.Dimission=1");
        ddl_Salesman.DataBind();
    }
Exemplo n.º 44
0
    private void BindDropDown()
    {
        ddl_Supplier.DataSource = CM_ClientBLL.GetSupplierByTDP((int)Session["OwnerClient"]).OrderBy(p => p.FullName);
        ddl_Supplier.DataBind();
        ddl_Supplier.Items.Insert(0, new ListItem("请选择...", "0"));

        //ddl_State.DataSource = DictionaryBLL.GetDicCollections("PBM_DeliveryState");
        //ddl_State.DataBind();
        //ddl_State.Items.Insert(0, new ListItem("请选择...", "0"));

        ddl_Salesman.DataSource = Org_StaffBLL.GetStaffList("Org_Staff.ID IN (SELECT SalesMan FROM MCS_PBM.dbo.PBM_Delivery WHERE Supplier=" + Session["OwnerClient"].ToString() +
                                                            " AND InsertTime>DATEADD(MONTH,-6,GETDATE()) ) AND Org_Staff.Dimission = 1");
        ddl_Salesman.DataBind();
        ddl_Salesman.Items.Insert(0, new ListItem("请选择...", "0"));
    }
    public void BindDropDown()
    {
        CM_Client m = new CM_ClientBLL((int)ViewState["ClientID"]).Model;
        ddl_Promotor.DataTextField = "Name";
        ddl_Promotor.DataValueField = "ID";
        ddl_Promotor.DataSource = PM_PromotorBLL.GetModelList(" OrganizeCity in (" + m.OrganizeCity + @") AND Dimission=1 AND ApproveFlag=1 AND
            (MCS_SYS.dbo.UF_Spilt2('MCS_Promotor.dbo.PM_Promotor',ExtPropertys,'Classfiy')='2' OR ID NOT IN (SELECT Promotor FROM MCS_Promotor.dbo.PM_PromotorInRetailer))");
        ddl_Promotor.DataBind();
        ddl_Promotor.Items.Insert(0, new ListItem("请选择", "0"));

        ddl_state.DataSource = DictionaryBLL.GetDicCollections("CM_ContractState");
        ddl_state.DataBind();
        ddl_state.Items.Insert(0, new ListItem("所有", "0"));
        ddl_state.SelectedValue = "3";
    }
    protected void select_StageClient_SelectChange(object sender, SelectChangeEventArgs e)
    {
        MCSSelectControl select_StageClient = (MCSSelectControl)pl_detail.FindControl("CAT_Activity_StageClient");
        int client = 0;

        if (int.TryParse(select_StageClient.SelectValue, out client) && client > 0)
        {
            CM_ClientBLL _c          = new CM_ClientBLL(client);
            TextBox      tbx_Address = (TextBox)pl_detail.FindControl("CAT_Activity_Address");
            if (tbx_Address != null && _c.Model != null)
            {
                tbx_Address.Text = _c.Model.Address;
            }
        }
    }
    private void BindGrid()
    {
        if (ViewState["ClientID"] != null)
        {
            CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);

            #region 绑定住宿人员
            gv_Staff.ConditionString = "MCS_CM.dbo.CM_StaffInProperty.Client = " + ViewState["ClientID"].ToString() + " AND Org_Staff.Dimission=1";
            gv_Staff.BindGrid();
            #endregion

            #region 绑定兼管片区
            if (bll.Model.OrganizeCity > 1)
            {
                ddl_PropertyInOrganizeCity.Items.Clear();

                int superid = new Addr_OrganizeCityBLL(bll.Model.OrganizeCity).Model.SuperID;
                IList <Addr_OrganizeCity> lists = Addr_OrganizeCityBLL.GetModelList("SuperID = " + superid.ToString() +
                                                                                    " AND ID <> " + bll.Model.OrganizeCity.ToString() +
                                                                                    " AND ID NOT IN (SELECT OrganizeCity FROM MCS_CM.dbo.CM_PropertyInOrganizeCity WHERE Client=" + bll.Model.ID.ToString() + ")");
                if (lists.Count > 0)
                {
                    foreach (Addr_OrganizeCity city in lists)
                    {
                        ddl_PropertyInOrganizeCity.Items.Add(new ListItem("(" + city.Code + ")" + city.Name, city.ID.ToString()));
                    }
                }

                ddl_PropertyInOrganizeCity.Items.Insert(0, new ListItem("请选择...", "0"));

                gv_PropertyInOrganizeCity.BindGrid <Addr_OrganizeCity>(bll.ClientInOrganizeCity_GetOrganizeCitys());
            }
            else
            {
                tr_PropertyInOrganizeCity.Visible = false;
            }
            #endregion

            #region 绑定电话列表
            gv_Telephone.ConditionString = "Client=" + bll.Model.ID.ToString();
            gv_Telephone.BindGrid();
            #endregion

            #region 绑定合同列表
            gv_List_Contract.BindGrid(CM_ContractBLL.GetModelList("Client=" + bll.Model.ID.ToString()));
            #endregion
        }
    }
    private void BindDropDown()
    {
        ddl_Supplier.DataSource = CM_ClientBLL.GetSupplierByTDP((int)Session["OwnerClient"]).OrderBy(p => p.FullName);
        ddl_Supplier.DataBind();

        CM_Client _c = new CM_ClientBLL((int)Session["OwnerClient"]).Model;

        if (_c != null && ddl_Supplier.Items.FindByValue(_c.OwnerClient.ToString()) != null)
        {
            ddl_Supplier.SelectedValue = _c.OwnerClient.ToString();
        }

        ddl_AgentStaff.DataSource = Org_StaffBLL.GetStaffList("Org_Staff.OwnerClient=" + Session["OwnerClient"].ToString() + " AND Org_Staff.Dimission=1");
        ddl_AgentStaff.DataBind();
        ddl_AgentStaff.Items.Insert(0, new ListItem("请选择", "0"));
    }
Exemplo n.º 49
0
    protected string ShowClient(int id)
    {
        string             clientname = "";
        IList <CM_DIUsers> lists      = CM_DIUsersBLL.GetModelList("ShipID=" + id.ToString());

        foreach (CM_DIUsers item in lists)
        {
            CM_Client c = new CM_ClientBLL(item.Client).Model;
            if (c != null)
            {
                clientname += "<a href='DistributorDetail.aspx?ClientID=" + c.ID.ToString() + "' target='_blank' class='listViewTdLinkS1'>"
                              + c.FullName + "</a><br/>";
            }
        }
        return(clientname);
    }
Exemplo n.º 50
0
    private void BindClient()
    {
        CM_Client _r = new CM_ClientBLL((int)ViewState["ClientID"]).Model;

        lbl_Client.Text         = _r.FullName;
        ViewState["ClientType"] = _r.ClientType;

        if (_r.ClientType == 3)
        {
            Header.Attributes["WebPageSubCode"] += "ClientType=3";
        }
        else if (_r.ClientType == 2)
        {
            Header.Attributes["WebPageSubCode"] += "ClientType=2&DIClassify=" + _r["DIClassify"];
        }
    }
    protected string PromotorInClient(int promotor)
    {
        string clientname = "";
        IList <PM_PromotorInRetailer> lists = PM_PromotorInRetailerBLL.GetModelList("Promotor=" + promotor.ToString());

        foreach (PM_PromotorInRetailer item in lists)
        {
            CM_Client c = new CM_ClientBLL(item.Client).Model;
            if (c != null)
            {
                clientname += "<a href='../CM/RT/RetailerDetail.aspx?ClientID=" + c.ID.ToString() + "' target='_blank' class='listViewTdLinkS1'>"
                              + c.FullName + "</a><br/>";
            }
        }
        return(clientname);
    }
Exemplo n.º 52
0
    void BindGeoCode(int city)
    {
        if (city > 0)
        {
            DropDownList ddl_GeoCode = (DropDownList)pl_detail.FindControl("CM_ClientManufactInfo_GeoCode");
            if (ddl_GeoCode != null)
            {
                ddl_GeoCode.DataValueField = "ID";
                ddl_GeoCode.DataTextField  = "Name";

                ddl_GeoCode.DataSource = CM_GeoCodeBLL.GetListByCityCode(CM_ClientBLL.GetORGCOD2ByCity(city));
                ddl_GeoCode.DataBind();
                ddl_GeoCode.Items.Insert(0, new ListItem("请选择...", "0"));
            }
        }
    }
 protected void bt_Approve_Click(object sender, EventArgs e)
 {
     if ((int)ViewState["ClientID"] != 0)
     {
         CM_ClientBLL _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
         _bll.Model.ActiveFlag = 1;
         if (_bll.Model.OpenTime.Year == 1900)
         {
             _bll.Model.OpenTime = DateTime.Today;
         }
         _bll.Model.CloseTime   = new DateTime(1900, 1, 1);
         _bll.Model.ApproveFlag = 1;
         _bll.Update();
         MessageBox.ShowAndRedirect(this, "审核经销商资料成功!", "DistributorDetail.aspx?ClientID=" + ViewState["ClientID"].ToString());
     }
 }
    public void BindDropDown()
    {
        CM_Client m = new CM_ClientBLL((int)ViewState["ClientID"]).Model;

        ddl_Promotor.DataTextField  = "Name";
        ddl_Promotor.DataValueField = "ID";
        ddl_Promotor.DataSource     = PM_PromotorBLL.GetModelList(" OrganizeCity in (" + m.OrganizeCity + @") AND Dimission=1 AND ApproveFlag=1 AND 
            (MCS_SYS.dbo.UF_Spilt2('MCS_Promotor.dbo.PM_Promotor',ExtPropertys,'Classfiy')='2' OR ID NOT IN (SELECT Promotor FROM MCS_Promotor.dbo.PM_PromotorInRetailer))");
        ddl_Promotor.DataBind();
        ddl_Promotor.Items.Insert(0, new ListItem("请选择", "0"));

        ddl_state.DataSource = DictionaryBLL.GetDicCollections("CM_ContractState");
        ddl_state.DataBind();
        ddl_state.Items.Insert(0, new ListItem("所有", "0"));
        ddl_state.SelectedValue = "3";
    }
Exemplo n.º 55
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 获取页面参数
            Org_StaffBLL staff         = new Org_StaffBLL((int)Session["UserID"]);
            int          _relateclient = 0;
            if (staff.Model["RelateClient"] != "" && int.TryParse(staff.Model["RelateClient"], out _relateclient))
            {
                ViewState["ClientID"] = _relateclient;
                select_Client.Enabled = false;
            }
            else
            {
                if (Request.QueryString["ClientID"] != null)
                {
                    ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                    Session["ClientID"]   = ViewState["ClientID"];
                }
                else if (Session["ClientID"] != null && Request.QueryString["State"] == null && Request.QueryString["ApproveFlag"] == null)
                {
                    ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
                }
            }
            #endregion

            BindDropDown();
            if (Request.QueryString["ApproveFlag"] != null)
            {
                rbl_ApproveFlag.SelectedValue = Request.QueryString["ApproveFlag"];
            }
            else if (Request.QueryString["State"] != null)
            {
                ddl_State.SelectedValue = Request.QueryString["State"];
            }

            if (ViewState["ClientID"] != null)
            {
                CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);
                select_Client.SelectValue   = ViewState["ClientID"].ToString();
                select_Client.SelectText    = client.Model.FullName;
                tr_OrganizeCity.SelectValue = client.Model.OrganizeCity.ToString();
            }

            BindGrid();
        }
    }
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        CM_ContractBLL _bll   = new CM_ContractBLL((int)ViewState["ContractID"]);
        CM_Client      client = new CM_ClientBLL(_bll.Model.Client).Model;

        if (_bll.Items.Count == 0)
        {
            MessageBox.Show(this, "对不起,物业租赁合同必须要录入合同具体的付款科目才能提交申请!");
            return;
        }
        decimal applycost = _bll.Items.Sum(p => p.ApplyLimit);

        NameValueCollection dataobjects = new NameValueCollection();

        dataobjects.Add("ID", _bll.Model.ID.ToString());
        dataobjects.Add("Classify", _bll.Model.Classify.ToString());
        dataobjects.Add("ApplyCost", applycost.ToString("0.##"));

        dataobjects.Add("OrganizeCityID", client.OrganizeCity.ToString());
        dataobjects.Add("PDClassify", client["PDClassify"]);        //物业类别

        #region 组织任务标题
        string _title    = "";
        Label  lb_Client = (Label)pl_detail.FindControl("CM_Contract_Client");
        if (lb_Client != null)
        {
            _title += "物业名称:" + lb_Client.Text;
        }

        if (_bll.Model.ContractCode != "")
        {
            _title += " 合同编码:" + _bll.Model.ContractCode;
        }
        #endregion

        int TaskID = EWF_TaskBLL.NewTask("CM_Contract_Flow", (int)Session["UserID"], _title,
                                         "~/SubModule/CM/PD/PropertyDetail.aspx?ClientID=" + _bll.Model.Client.ToString(), dataobjects);
        if (TaskID > 0)
        {
            _bll.Model.State       = 2;
            _bll.Model.ApproveTask = TaskID;
            _bll.Update();
            new EWF_TaskBLL(TaskID).Start();        //直接启动流程
        }

        Response.Redirect("~/SubModule/EWF/TaskDetail.aspx?TaskID=" + TaskID.ToString());
    }
Exemplo n.º 57
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DropDownList ddl_PayType = UC_DetailView1.FindControl("FNA_ClientPaymentInfo_PayType") == null ? null : (DropDownList)UC_DetailView1.FindControl("FNA_ClientPaymentInfo_PayType");

        if (ddl_PayType != null)
        {
            ddl_PayType.SelectedIndexChanged += new EventHandler(ddl_PayType_SelectedIndexChanged);
            ddl_PayType.AutoPostBack          = true;
        }
        if (!IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);

            if ((int)ViewState["ID"] == 0)
            {
                if (Request.QueryString["ClientID"] != null)
                {
                    ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                    Session["ClientID"]   = ViewState["ClientID"];
                }
                else if (Session["ClientID"] != null)
                {
                    ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
                }

                if (ViewState["ClientID"] != null)
                {
                    CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);

                    MCSSelectControl select_Client = (MCSSelectControl)UC_DetailView1.FindControl("FNA_ClientPaymentInfo_Client");
                    select_Client.SelectValue = ViewState["ClientID"].ToString();
                    select_Client.SelectText  = client.Model.FullName;

                    select_Client.Enabled = false;
                }

                TextBox tbx_ConfirmDate = (TextBox)UC_DetailView1.FindControl("FNA_ClientpaymentInfo_ConfirmDate");
                bt_Approve.Visible     = false;
                btn_CanclePass.Visible = false;
                UploadFile1.Visible    = false;
            }
            else
            {
                BindData();
            }
        }
    }
 protected void bt_BatchInput2_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(select_Client.SelectValue) && select_Client.SelectValue != "0")
     {
         CM_ClientBLL _r = new CM_ClientBLL(int.Parse(select_Client.SelectValue));
         if (_r.Model.ExtPropertys["DIClassify"].ToString() == "3")
         {
             MessageBox.Show(this, "经销商子户头不可以录入库存!");
             return;
         }
         Response.Redirect("InventoryBatchInput.aspx?ClientType=" + ViewState["ClientType"].ToString() + "&ClientID=" + select_Client.SelectValue + "&IsCXP=1");
     }
     else
     {
         Response.Redirect("InventoryBatchInput.aspx?ClientType=" + ViewState["ClientType"].ToString() + "&IsCXP=1");
     }
 }
Exemplo n.º 59
0
    protected void bt_UnApprove_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ClientID"] != 0)
        {
            bt_OK_Click(null, null);

            CM_ClientBLL          _bll         = new CM_ClientBLL((int)ViewState["ClientID"]);
            CM_ClientManufactInfo manufactinfo = _bll.GetManufactInfo((int)Session["Manufacturer"]);

            if (manufactinfo.SyncState == 2)
            {
                CM_ClientManufactInfoBLL.Approve((int)ViewState["ClientID"], (int)Session["Manufacturer"], (int)Session["UserID"], 8);

                Response.Redirect("RetailerList.aspx?SyncState=2");
            }
        }
    }
Exemplo n.º 60
0
    public void BindDropDown()
    {
        MCSTreeControl tr_OfficialCity = (MCSTreeControl)pl_detail.FindControl("CM_Client_OfficialCity");

        if (tr_OfficialCity != null)
        {
            if ((int)Session["OwnerType"] == 2 && (int)Session["OwnerClient"] > 0)
            {
                CM_Client c = new CM_ClientBLL((int)Session["OwnerClient"]).Model;
                if (c != null)
                {
                    int prov = TreeTableBLL.GetSuperIDByLevel("MCS_SYS.dbo.Addr_OfficialCity", c.OfficialCity, 1);
                    tr_OfficialCity.RootValue = prov.ToString();
                }
            }
        }
    }