示例#1
0
        public AjaxMessage GetSaleSource(string SaleSourceId)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                if (!string.IsNullOrEmpty(SaleSourceId))
                {
                    FD_SaleSource m_saleSource = _SaleSourceSerrvice.GetById(SaleSourceId.ToString().ToInt32());

                    if (m_saleSource != null)
                    {
                        ajax.IsSuccess = true;
                        ajax.Data      = m_saleSource;
                    }
                    //else
                    //{
                    //    ajax.Data = null;
                    //}
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
                ajax.Data    = null;
            }
            return(ajax);
        }
示例#2
0
        public AjaxMessage CreateSaleSource(FD_SaleSource saleSource)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                if (saleSource != null)
                {
                    saleSource.CreateDate     = DateTime.Now;
                    saleSource.CreateEmployee = LoginInfo.UserInfo.EmployeeId;
                    saleSource.Status         = (byte)SysStatus.Enable;
                    saleSource.letter         = PinYin.GetFirstLetter(saleSource.SourceName);

                    var result = _SaleSourceSerrvice.Add(saleSource);
                    if (result != null)
                    {
                        ajax.Message   = "添加成功";
                        ajax.IsSuccess = true;
                    }
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }
            return(ajax);
        }
示例#3
0
        /// <summary>
        /// 根据渠道Id获取名称
        /// </summary>
        /// <param name="Source"></param>
        /// <returns></returns>
        public string GetSaleSourceName(object Source)
        {
            string saleSource = string.Empty;

            if (Source != null)
            {
                int           sourceId     = Source.ToString().ToInt32();
                FD_SaleSource m_saleSource = _saleSourceService.GetById(sourceId);
                if (m_saleSource != null)
                {
                    saleSource = m_saleSource.SourceName;
                }
            }
            return(saleSource);
        }
示例#4
0
        public AjaxMessage UpdateSaleSource(FD_SaleSource saleSource, string SourceId)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                if (!string.IsNullOrEmpty(SourceId))
                {
                    int           Id           = SourceId.ToString().ToInt32();
                    FD_SaleSource m_saleSource = _SaleSourceSerrvice.GetById(Id);

                    if (m_saleSource != null)
                    {
                        m_saleSource.SourceName      = saleSource.SourceName;
                        m_saleSource.SaleTypeId      = saleSource.SaleTypeId;
                        m_saleSource.IsRebate        = saleSource.IsRebate;
                        m_saleSource.SourceAddress   = saleSource.SourceAddress;
                        m_saleSource.CommoandName    = saleSource.CommoandName;
                        m_saleSource.CommondPhone    = saleSource.CommondPhone;
                        m_saleSource.CommondBankName = saleSource.CommondBankName;
                        m_saleSource.CommondBankCard = saleSource.CommondBankCard;
                        m_saleSource.Description     = saleSource.Description;

                        //执行修改
                        int result = _SaleSourceSerrvice.Update(m_saleSource);
                        if (result > 0)
                        {
                            ajax.Message   = "修改成功";
                            ajax.IsSuccess = true;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }
            return(ajax);
        }
示例#5
0
        public AjaxMessage SetSingleStatus(string SaleSourceId)
        {
            AjaxMessage ajax = new AjaxMessage();

            ajax.IsSuccess = false;
            ajax.Message   = "";
            try
            {
                if (!string.IsNullOrEmpty(SaleSourceId))
                {
                    int SourceId = SaleSourceId.ToString().ToInt32();
                    Expression <Func <FD_SaleSource, bool> > pars = c => c.SourceId == SourceId;
                    FD_SaleSource m_saleSource = _SaleSourceSerrvice.GetModel(pars);
                    if (m_saleSource.Status == (byte)SysStatus.Enable)
                    {
                        m_saleSource.Status = (byte)SysStatus.Disable;
                        ajax.Message        = "禁用成功";
                    }
                    else
                    {
                        m_saleSource.Status = (byte)SysStatus.Enable;
                        ajax.Message        = "启用成功";
                    }


                    int result = _SaleSourceSerrvice.Update(m_saleSource);
                    if (result > 0)
                    {
                        ajax.IsSuccess = true;
                    }
                }
            }
            catch (Exception e)
            {
                ajax.Message = e.Message;
            }
            return(ajax);
        }
        /// <summary>
        /// 数据绑定
        /// </summary>
        public void BinderData()
        {
            if (Request["CustomerId"] != null)
            {
                Guid        customerId = new Guid(Request["CustomerId"].ToString());
                FL_Customer m_customer = _customerService.GetById(customerId);
                if (m_customer != null)
                {
                    //主要联系人
                    if (m_customer.ContactMan == m_customer.Groom)
                    {
                        rdoContactMan.SelectedValue = "0";
                    }
                    else if (m_customer.ContactMan == m_customer.Bride)
                    {
                        rdoContactMan.SelectedValue = "1";
                    }
                    else
                    {
                        rdoContactMan.SelectedValue = "2";
                    }

                    txtBride.Value              = m_customer.Bride;
                    txtGroom.Value              = m_customer.Groom;
                    txtOperator.Value           = m_customer.Operator;
                    txtBridePhone.Value         = m_customer.BridePhone;
                    txtGroomPhone.Value         = m_customer.GroomPhone;
                    txtOperatorPhone.Value      = m_customer.OperatorPhone;
                    ddlHotel.SelectedValue      = m_customer.Hotel.ToString();
                    txtPartyDate.Value          = m_customer.PartyDate.ToString().ToDateTime().ToString("yyyy-MM-dd");
                    txtDeskCount.Value          = m_customer.DeskCount.ToString();
                    txtBudget.Value             = m_customer.Budget.ToString();
                    rdoVip.SelectedValue        = m_customer.IsVip.ToString();
                    rdoBanqueType.SelectedValue = m_customer.BanqueType.ToString();
                    txtState.Value              = GetCustomerState(m_customer.State);
                    switch (m_customer.IsFinish)
                    {
                    case 0:
                        txtIsFinish.Value = "未完成";
                        break;

                    case 1:
                        txtIsFinish.Value = "已完成";
                        break;

                    case 2:
                        txtIsFinish.Value = "已完结";
                        break;
                    }
                    if (m_customer.EvalState == 0)
                    {
                        txtEvalState.Value = "未评价(" + txtIsFinish.Value + ")";
                    }
                    else
                    {
                        txtEvalState.Value = "已评价(" + txtIsFinish.Value + ")";
                    }
                }

                //渠道类型
                FD_SaleType m_saleType = _saleTypeService.GetById(m_customer.SaleType);
                ddlSaleType.SelectedValue = m_customer.SaleType.ToString();


                //渠道名称条件
                List <Expression <Func <FD_SaleSource, bool> > > parmList = new List <Expression <Func <FD_SaleSource, bool> > >();
                parmList.Add(c => c.SaleTypeId == m_saleType.SaleTypeID);
                ddlSaleSource.DataSource = _saleSourceService.GetListBy(parmList);
                ddlSaleSource.DataBind();

                //渠道名称
                FD_SaleSource m_saleSource = _saleSourceService.GetById(m_customer.Channel);;
                ddlSaleSource.SelectedValue = m_customer.Channel.ToString();
                txtReCommand.Value          = m_saleSource.CommoandName;

                txtCreateEmployee.Value = GetEmployeeNames(m_customer.CreateEmployee);
                txtCreateDate.Value     = m_customer.CreateDate.ToString();


                SS_Report m_report = _reportService.GetByCustomerId(customerId);
                txtInviteEmployee.Value = GetEmployeeNames(m_report.InviteEmployee);
                txtOrderEmployees.Value = GetEmployeeNames(m_report.OrderEmployee);
                txtQuotedEmployee.Value = GetEmployeeNames(m_report.QuotedEmployee);

                txtDescription.Text = m_customer.Description;


                //邀约沟通记录
                var dataList = _inviteService.GetDataListByCustomerId(customerId);

                if (dataList.Count > 0)         //有沟通记录
                {
                    tr_noInvite.Visible         = false;
                    repInviteContent.DataSource = dataList;
                    repInviteContent.DataBind();
                }
                else
                {
                    tr_noInvite.Visible = true;
                }


                //跟单沟通记录
                var orderList = _orderService.GetDataListByCustomerId(customerId);

                if (orderList.Count > 0)         //有沟通记录
                {
                    tr_noOrder.Visible         = false;
                    repOrderContent.DataSource = orderList;
                    repOrderContent.DataBind();
                }
                else
                {
                    tr_noOrder.Visible = true;
                }
            }
        }