Beispiel #1
0
        /// <summary>
        /// 检查客户类别,显示是否分配会员及负责会员
        /// </summary>
        /// <param name="custid">客户编号</param>
        /// <returns></returns>
        private bool CheckShowMember(string custid)
        {
            bool isShow = false;

            BitAuto.YanFa.Crm2009.Entities.CustInfo model = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(custid);
            if (model != null)
            {
                //判断客户类型:综合店、特许经销商、4S、展厅、集团显示
                if (model.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.SynthesizedShop).ToString() ||
                    model.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Licence).ToString() ||
                    model.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.FourS).ToString() ||
                    model.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Showroom).ToString() ||
                    model.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Bloc).ToString())
                {
                    isShow = true;
                }
            }
            //判断客户下面有开通的易湃会员显示
            List <DMSMember> list = BitAuto.YanFa.Crm2009.BLL.DMSMember.Instance.GetDMSMemberByCustID(custid);

            if (list.Count > 0 && isShow)
            {
                rtpMemberList.DataSource = list;
                rtpMemberList.DataBind();
            }
            else
            {
                isShow = false;
            }
            return(isShow);
        }
Beispiel #2
0
        /// <summary>
        /// 根据客户ID,返回客户所属厂商、品牌ID
        /// </summary>
        /// <param name="RequestCustID"></param>
        /// <param name="msg"></param>
        private void GetCustPidsAndBrandIDs(string CustID, out string msg)
        {
            msg = "'GetInfo':'no'";
            BitAuto.YanFa.Crm2009.Entities.CustInfo cust = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(CustID);
            if (cust != null)
            {
                string   pid         = cust.Pid;
                string   pidName     = "";
                string   custPid     = cust.CustPid; //所属厂商
                string   custPidName = "";
                string[] array       = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetBrandIDsAndNamesByCustID(CustID);
                string   brandIDs    = array[0]; //主营品牌IDs
                string   brandNames  = array[1]; //主营品牌Names

                if (!string.IsNullOrEmpty(custPid))
                {
                    BitAuto.YanFa.Crm2009.Entities.CustInfo custPidModel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(cust.CustPid);
                    if (custPidModel != null)
                    {
                        custPidName = custPidModel.CustName;
                    }
                }
                if (!string.IsNullOrEmpty(pid))
                {
                    BitAuto.YanFa.Crm2009.Entities.CustInfo pidModel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(pid);
                    if (pidModel != null)
                    {
                        pidName = pidModel.CustName;
                    }
                }
                msg = "'GetInfo':'yes','CustPid':'" + custPid + "','CustPidName':'" + custPidName + "','Pid':'" + pid + "','PidName':'" + pidName + "','BrandIDs':'" + brandIDs + "','BrandNames':'" + brandNames + "'";
            }
        }
Beispiel #3
0
        private void GetCustInfoByMemberCode(out string msg)
        {
            msg = string.Empty;
            if (!string.IsNullOrEmpty(MemberCode))
            {
                BitAuto.YanFa.Crm2009.Entities.DMSMember model = BitAuto.YanFa.Crm2009.BLL.DMSMember.Instance.GetDMSMemberByMemberCode(MemberCode);

                if (model != null)
                {
                    BitAuto.YanFa.Crm2009.Entities.CustInfo custinfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(model.CustID);
                    if (custinfo != null)
                    {
                        msg = "{result:'true',CustName:'" + custinfo.CustName + "',CustID:'" + model.CustID + "',PrivinceID:'" + custinfo.ProvinceID + "',CityID:'" + custinfo.CityID + "',CountyID:'" + custinfo.CountyID + "'}";
                    }
                    else
                    {
                        msg = "{result:'false'}";
                    }
                }
                else
                {
                    msg = "{result:'false'}";
                }
            }
        }
        protected bool CustVerify(string tid)
        {
            bool result = true;

            Entities.ProjectTaskInfo taskInfo = BLL.ProjectTaskInfo.Instance.GetProjectTaskInfo(tid);
            if (taskInfo != null)
            {
                if (taskInfo.Source == 1)
                {
                    Response.Write("<script type='text/javascript'>$.jAlert('此客户属于新增客户,请进入新增客户核实页进行核实操作!');window.location.href='/CustCheck/CrmCustCheck/Main.aspx';</script>");
                    result = false;
                }
                else if (taskInfo.Source == 2)
                {
                    BitAuto.YanFa.Crm2009.Entities.CustInfo custInfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(taskInfo.CrmCustID);
                    if (custInfo != null)
                    {
                        if (custInfo.CarType == 2)
                        {
                            Response.Write("<script type='text/javascript'>$.jAlert('此客户是二手车客户,请进入相应的核实页进行操作!');window.location.href='/CustCheck/CrmCustCheck/Main.aspx';</script>");
                            result = false;
                        }
                    }
                }
            }
            else
            {
                Response.Write("<script type='text/javascript'>$.jAlert('不存在此任务ID');window.location.href='/CustCheck/CrmCustCheck/Main.aspx';</script>");
                result = false;
            }

            return(result);
        }
 private void BindCustName(string custID)
 {
     BitAuto.YanFa.Crm2009.Entities.CustInfo model = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(custID);
     if (model != null)
     {
         CustName = model.CustName;
     }
 }
Beispiel #6
0
        public void ProcessRequest(HttpContext context)
        {
            BitAuto.YanFa.SysRightManager.Common.UserInfo.Check();
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");

            currentContext = context;
            BitAuto.YanFa.SysRightManager.Common.UserInfo.Check();
            if ((context.Request["getCustInfo"] + "").Trim() == "yesbycustid")
            {
                BitAuto.YanFa.Crm2009.Entities.CustInfo custInfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(RequestCustID);
                if (custInfo != null)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.Append("{'TypeID':'" + custInfo.TypeID + "','Name':'" + custInfo.CustName + "'}");
                    message = sb.ToString();
                    //如果客户类别是 个人、经纪公司、交易市场,则选中二手车,其他选择新车
                    //switch (custInfo.TypeID)
                    //{
                    //    case "20010":
                    //    case "20011":
                    //    case "20012": this.chkTypeSnd.Checked = true; break;
                    //    default: this.chkTypeNew.Checked = true; break;
                    //}


                    //BindText();
                    //litCustName.InnerText = custInfo.CustName;
                }
                context.Response.Write("[" + message + "]");
                context.Response.End();
            }
            else if ((context.Request["getCustInfo"] + "").Trim() == "binddata")
            {
                DataTable dt_cc_returnVisit = BLL.ProjectTask_ReturnVisit.Instance.GetTable(RequestCustID);
                if (dt_cc_returnVisit.Rows.Count > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.Append("{'VisitType':'" + dt_cc_returnVisit.Rows[0]["VisitType"].ToString() + "','RVType':'" + dt_cc_returnVisit.Rows[0]["RVType"].ToString() +
                              "','Remark':'" + dt_cc_returnVisit.Rows[0]["Remark"].ToString() + "','TypeID':'" + dt_cc_returnVisit.Rows[0]["TypeID"].ToString() + "'}");

                    message = sb.ToString();
                }

                context.Response.Write("[" + message + "]");
                context.Response.End();
            }
            else
            {
                success = false;
                message = "request error";
                BitAuto.ISDC.CC2012.BLL.AJAXHelper.WrapJsonResponse(success, result, message);
            }
        }
Beispiel #7
0
 /// <summary>
 /// 客户是否停用
 /// </summary>
 /// <returns></returns>
 internal void CustIsLock()
 {
     Entities.ProjectTaskInfo task = BLL.ProjectTaskInfo.Instance.GetProjectTaskInfo(TID);
     BitAuto.YanFa.Crm2009.Entities.CustInfo custInfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(task.CrmCustID);
     if (custInfo != null)
     {
         if (custInfo.Lock == 1)
         {
             throw new Exception("此会员已锁定,无法进行停用操作!");
         }
     }
 }
        private void BindData()
        {
            DataTable dtMember = new DataTable();

            Entities.ProjectTaskInfo model = BLL.ProjectTaskInfo.Instance.GetProjectTaskInfo(RequestTID);
            if (model != null)
            {
                DataSource = model.Source.ToString();
                if (model.Source == 1)//Excel导入客户
                {
                    Entities.ProjectTaskInfo cccustModel = BLL.ProjectTaskInfo.Instance.GetProjectTaskInfo(RequestTID);
                    if (cccustModel != null)
                    {
                        txtCustName.Value = cccustModel.CustName;
                        List <Entities.ProjectTask_DMSMember> ccmemberList = new List <Entities.ProjectTask_DMSMember>();
                        ccmemberList = BitAuto.ISDC.CC2012.BLL.ProjectTask_DMSMember.Instance.GetProjectTask_DMSMemberByTID(RequestTID);

                        //*add by qizhiqiang 取新建车商通会员信息 2012-4-20
                        List <Entities.ProjectTask_CSTMember> cc_cstmemberList = new List <Entities.ProjectTask_CSTMember>();
                        cc_cstmemberList = BitAuto.ISDC.CC2012.BLL.ProjectTask_CSTMember.Instance.GetProjectTask_CSTMemberByTID(RequestTID);
                        //*

                        //*updateby qizhiqiang 2012-4-20
                        BindMemberDDL(ccmemberList, cc_cstmemberList);
                        //*

                        hidCustID.Value = model.RelationID;
                    }
                }
                else if (model.Source == 2)//CRM库客户
                {
                    BitAuto.YanFa.Crm2009.Entities.CustInfo custModel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(model.RelationID);
                    if (custModel != null)
                    {
                        txtCustName.Value    = custModel.CustName;
                        spanCustID.InnerHtml = custModel.CustID;
                        hidCustID.Value      = custModel.CustID;

                        List <Entities.ProjectTask_DMSMember> ccmemberList = new List <Entities.ProjectTask_DMSMember>();
                        ccmemberList = BitAuto.ISDC.CC2012.BLL.ProjectTask_DMSMember.Instance.GetProjectTask_DMSMemberByTID(RequestTID);

                        //*add byqizhiqiang 2012-4-20
                        List <Entities.ProjectTask_CSTMember> cc_cstmemberList = new List <Entities.ProjectTask_CSTMember>();
                        cc_cstmemberList = BitAuto.ISDC.CC2012.BLL.ProjectTask_CSTMember.Instance.GetProjectTask_CSTMemberByTID(RequestTID);
                        //*

                        //*updateby qizhiqiang 2012-4-20
                        BindMemberDDL(ccmemberList, cc_cstmemberList);
                        //*
                    }
                }
            }
        }
Beispiel #9
0
 /// <summary>
 /// 插入到审核对照表,类型为:客户名称变化
 /// </summary>
 /// <param name="cc_Custs">呼叫中心客户实体</param>
 /// <param name="custInfo">CRM系统客户实体</param>
 public int InsertByCustNameChange(Entities.ProjectTask_Cust cc_Custs, BitAuto.YanFa.Crm2009.Entities.CustInfo custInfo)
 {
     Entities.ProjectTask_AuditContrastInfo model = new Entities.ProjectTask_AuditContrastInfo();
     model.PTID               = cc_Custs.PTID;
     model.CustID             = custInfo.CustID;
     model.ContrastInfoInside = "CustName:('" + BLL.Util.EscapeString(custInfo.CustName) + "','" + BLL.Util.EscapeString(cc_Custs.CustName) + "')";
     model.ContrastInfo       = "客户名称由:" + custInfo.CustName + ",改为:" + cc_Custs.CustName;
     model.ExportStatus       = 0;//0-未导出,1-已导出
     model.ContrastType       = 1;
     model.CreateTime         = DateTime.Now;
     model.CreateUserID       = BLL.Util.GetLoginUserID();
     model.DisposeStatus      = 0;//未处理
     return(Insert(model));
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            //判断登录
            if (!IsPostBack)
            {
                GetInfoByTaskID();

                BitAuto.YanFa.Crm2009.Entities.CustInfo ci = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(this.CustID);
                if (ci != null)
                {
                    this.UCCust1.CustInfo       = ci;
                    this.UCCust1.DeleteMemberID = this.DeleteMemberID;
                }
            }
        }
Beispiel #11
0
        public int SCID        = 0; //分类ID

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BitAuto.YanFa.Crm2009.Entities.CustInfo ci = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(this.CustID);
                if (ci != null)
                {
                    CustName = ci.CustName;

                    this.UCCust1.CustInfo = ci;
                }
                LoginUserID = BLL.Util.GetLoginUserID();
                BGID        = BitAuto.ISDC.CC2012.BLL.SurveyCategory.Instance.GetSelfBGIDByUserID(LoginUserID);
                SCID        = BitAuto.ISDC.CC2012.BLL.SurveyCategory.Instance.GetSelfSCIDByUserID(LoginUserID);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //判断登录
                UserID = BLL.Util.GetLoginUserID().ToString();
                SCID   = BLL.SurveyCategory.Instance.GetSCIDByName("客户核实").ToString();
                GetInfoByTaskID();

                BitAuto.YanFa.Crm2009.Entities.CustInfo ci = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(this.CustID);
                if (ci != null)
                {
                    CustName                    = ci.CustName;
                    CRMCustID                   = ci.CustID;
                    this.UCCust1.CustInfo       = ci;
                    this.UCCust1.DeleteMemberID = this.DeleteMemberID;
                }
            }
        }
Beispiel #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                #region 判断部门是否显示功能 个人不显示部门
                BitAuto.YanFa.Crm2009.Entities.CustInfo model = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(Request["CustID"]);
                if (model != null)
                {
                    TypeID = model.TypeID;
                    if (model.TypeID == "20010")
                    {
                        DepartmenDisplay = "none";
                    }
                }
                #endregion

                //是否显示负责会员列表
                _isShowMember = CheckShowMember(CustID);

                FillPage();
            }
        }
Beispiel #14
0
        private void CustInfoShow()
        {
            BitAuto.YanFa.Crm2009.Entities.CustInfo ci = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(CustID);
            if (ci != null)
            {
                spanCustName.InnerText = ci.CustName;
                spanCustType.InnerText = BLL.Util.GetEnumOptText(typeof(BitAuto.YanFa.Crm2009.Entities.EnumCustomType), CommonFunction.ObjectToInteger(ci.TypeID));
                CustType = ci.TypeID;
                //客户主营品牌
                BitAuto.YanFa.Crm2009.Entities.QueryBrandInfo queryBrandInfo = new BitAuto.YanFa.Crm2009.Entities.QueryBrandInfo();
                queryBrandInfo.CustID = ci.CustID;
                int       o;
                string    s  = "";
                DataTable dt = BitAuto.YanFa.Crm2009.BLL.CarBrand.Instance.GetCustBrandInfo(queryBrandInfo, "", 1, 10000, out o);
                if (dt != null && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        s += dt.Rows[i]["name"] + " ";
                    }
                }
                spanBrandName.InnerText = s;

                //客户地区
                string provinceCity = "";
                if (!string.IsNullOrEmpty(ci.ProvinceID))
                {
                    provinceCity += BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ci.ProvinceID);
                }
                if (!string.IsNullOrEmpty(ci.CityID))
                {
                    provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ci.CityID);
                }
                if (!string.IsNullOrEmpty(ci.CountyID))
                {
                    provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ci.CountyID);
                }
                spanArea.InnerText = provinceCity;

                spanAddress.InnerText     = ci.Address;
                spanContactName.InnerText = ci.contactName;
                //crm客户的电话
                spanOfficeTel.InnerText = ci.Officetel;
                OfficeTel             = ci.Officetel;
                ContactName           = ci.contactName;
                spanZipcode.InnerText = ci.zipcode;

                if (ci.Lock == 1)
                {
                    //spanLock.InnerText = "是";
                    spanLock.Style["display"] = "block";
                }
                else
                {
                    //spanLock.InnerText = "否";
                    spanLock.Style["display"] = "none";
                }
                if (ci.Status == 0)
                {
                    //spanStatus.InnerText = "在用";
                    spanStatus.Style["display"] = "none";
                }
                else
                {
                    //spanStatus.InnerText = "停用";
                    spanStatus.Style["display"] = "block";
                }

                List <BitAuto.YanFa.Crm2009.Entities.DMSMember> list = BitAuto.YanFa.Crm2009.BLL.DMSMember.Instance.GetDMSMember(ci.CustID);
                rptMember.DataSource = list;
                rptMember.DataBind();

                if (list != null && list.Count > 0)
                {
                    FirstMemberCode = list[0].MemberCode;
                    FirstMemberName = list[0].Name;
                }
            }
            else
            {
                Response.Write(@"<script language='javascript'>javascript:alert('该Crm客户可能不存在或者已经删除!');
                                            try {
                                                  window.external.MethodScript('/browsercontrol/closepage');
                                                } catch (e) {
                                                    window.opener = null; window.open('', '_self'); window.close();
                                                };</script>");
            }
        }
Beispiel #15
0
        private void BindCCCustomerInfo()
        {
            Entities.ProjectTask_Cust ccCust = BLL.ProjectTask_Cust.Instance.GetProjectTask_Cust(this.Task.PTID);
            CCCust = ccCust;
            #region 客户信息
            if (ccCust != null)
            {
                CarType = ccCust.CarType;
                spanCustName.InnerText = ccCust.CustName;
                spanCustAbbr.InnerText = ccCust.AbbrName;
                spanAddress.InnerText  = ccCust.Address;
                //经营范围
                if (ccCust.CarType == 1)
                {
                    spanCarType.InnerText = "新车";
                }
                else if (ccCust.CarType == 2)
                {
                    spanCarType.InnerText = "二手车";
                }
                else if (ccCust.CarType == 3)
                {
                    spanCarType.InnerText = "新车/二手车";
                }

                #region Modify=masj,Date=2012-04-13 注释掉
                ////车商通会员ID
                //if (ccCust.CstMemberID != "" && ccCust.CstMemberID != null)
                //{
                //    string[] strCstMemberID = ccCust.CstMemberID.Split(',');
                //    spanCstMemberID.InnerHtml = "";
                //    for (int k = 0; k < strCstMemberID.Length; k++)
                //    {
                //        spanCstMemberID.InnerHtml += "<a href='/CustCheck/CSTMember/CSTMemberInfo.aspx?CSTMemberID=" + strCstMemberID[k] + "' target='_blank'>" + strCstMemberID[k] + "</a>";
                //        if (k != strCstMemberID.Length - 1)
                //        {
                //            spanCstMemberID.InnerHtml += ",";
                //        }
                //    }
                //}
                #endregion
                ////车商通会员ID
                //if (!string.IsNullOrEmpty(ccCust.CstMemberID))
                //{
                //    spanCstMemberID.InnerHtml = "<a href='/CustCheck/CSTMember/CSTMemberInfo.aspx?CSTMemberID=" + ccCust.CstMemberID + "' target='_blank'>" + ccCust.CstMemberID.ToString() + "</a>";
                //    CSTMemberID = spanCstMemberID.InnerText;
                //}
                //else
                //{
                //    spanCstMemberID.InnerText = "";
                //}

                //二手车经营类型 置换型:1;零售型:2
                if (ccCust.UsedCarBusinessType == "1")
                {
                    spanUsedCarBusiness.InnerText = "置换型";
                }
                else if (ccCust.UsedCarBusinessType == "2")
                {
                    spanUsedCarBusiness.InnerText = "零售型";
                }

                //所属交易市场
                if (ccCust.TradeMarketID != null)
                {
                    BitAuto.YanFa.Crm2009.Entities.CustInfo custinfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.TradeMarketID.ToString());
                    if (custinfo != null)
                    {
                        spanTradeMarketID.InnerText = custinfo.CustName;
                    }
                }

                spanContactName.InnerText = ccCust.ContactName;
                spanFax.InnerText         = ccCust.Fax;
                if (!string.IsNullOrEmpty(ccCust.IndustryID))
                {
                    spanCustIndustry.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.IndustryID));
                }
                if (!string.IsNullOrEmpty(ccCust.LevelID))
                {
                    spanCustLevel.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.LevelID));
                }


                spanNotes.InnerText     = ccCust.Notes;
                spanOfficeTel.InnerText = ccCust.OfficeTel;
                string provinceCity = "";
                if (!string.IsNullOrEmpty(ccCust.ProvinceID))
                {
                    provinceCity += BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ccCust.ProvinceID);
                }
                if (!string.IsNullOrEmpty(ccCust.CityID))
                {
                    provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ccCust.CityID);
                }
                if (!string.IsNullOrEmpty(ccCust.CountyID))
                {
                    provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ccCust.CountyID);
                }
                spanArea.InnerText = provinceCity;
                if (!string.IsNullOrEmpty(ccCust.TypeID))
                {
                    spanCustType.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.TypeID));
                }
                spanZipcode.InnerText = ccCust.Zipcode;

                if (!string.IsNullOrEmpty(ccCust.OriginalCustID))
                {
                    if (ccCust.Status != null)
                    {
                        switch (ccCust.Status.Value)
                        {
                        case 0:
                            imgCustStatus.Src = "/Images/xt.gif";
                            imgCustStatus.Attributes.Add("title", "在用");
                            break;

                        case 1:
                            imgCustStatus.Src = "/Images/xt_1.gif";
                            imgCustStatus.Attributes.Add("title", "停用");
                            break;

                        default:
                            break;
                        }
                    }

                    if (ccCust.Lock != null && ccCust.Lock.Value == 1)
                    {
                        imgCustStatusLock.Src = "/Images/lock.gif";
                        imgCustStatusLock.Attributes.Add("title", "锁定");
                    }
                    else if (ccCust.Lock != null && ccCust.Lock.Value == 0)
                    {
                        imgCustStatusLock.Src = "/Images/unlock.gif";
                        imgCustStatusLock.Attributes.Add("title", "未锁定");
                    }

                    liCustStatus.Style.Remove("display");
                    liCustLock.Style.Remove("display");
                }
            }
            #endregion
        }
        /// <summary>
        /// 从CC_Custs中读取客户信息与会员信息。
        /// </summary>
        private void LoadInfoFromCC_Cust(Entities.ProjectTaskInfo task)
        {
            #region 加载客户信息
            Entities.ProjectTask_Cust ccCust = BLL.ProjectTask_Cust.Instance.GetProjectTask_Cust(task.PTID);

            CarType = ccCust.CarType.ToString();

            this.OriginalCustID = ccCust.OriginalCustID;

            this.tfCustName.Value = ccCust.CustName;
            this.tfCustAbbr.Value = ccCust.AbbrName;
            ListItem li = this.selCustType.Items.FindByValue(ccCust.TypeID);
            this.selCustType.SelectedIndex = this.selCustType.Items.IndexOf(li);
            //如果客户类型为特许经销商,显示所属4S
            if (ccCust.TypeID == Convert.ToString((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Licence))
            {
                //lbl4S.Style["display"] = "blank";
            }
            if (task.Source == 2)                                   //CRM库来源
            {
                selCustType.Attributes.Add("disabled", "disabled"); //不能编辑客户类别
            }

            li = this.selCustIndustry.Items.FindByValue(ccCust.IndustryID);
            this.selCustIndustry.SelectedIndex = this.selCustIndustry.Items.IndexOf(li);

            this.InitialProvinceID = ccCust.ProvinceID;
            this.InitialCityID     = ccCust.CityID;
            this.InitialCountyID   = ccCust.CountyID;
            this.tfAddress.Value   = ccCust.Address;
            this.tfZipcode.Value   = ccCust.Zipcode;
            if (!string.IsNullOrEmpty(ccCust.TradeMarketID))
            {
                BitAuto.YanFa.Crm2009.Entities.CustInfo custInfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.TradeMarketID.ToString());
                if (custInfo != null)
                {
                    tfCustPidName1.Value = custInfo.CustName;
                    tfCustPid1.Value     = ccCust.TradeMarketID.ToString();
                }
            }
            #region Modify=masj,Date=2012-04-13 注释掉
            //if (ccCust.CstMemberID != "" && ccCust.CstMemberID != null)
            //{
            //    this.txtCtsMemberID.Value = ccCust.CstMemberID;
            //}
            #endregion
            if (ccCust.CarType == 3)
            {
                this.chkOldCarType.Checked = true;
                if (!string.IsNullOrEmpty(ccCust.UsedCarBusinessType))
                {
                    this.sltUsedCarBusinessType.Value = ccCust.UsedCarBusinessType.ToString();
                }
                if (!string.IsNullOrEmpty(ccCust.TradeMarketID))
                {
                    BitAuto.YanFa.Crm2009.Entities.CustInfo custInfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.TradeMarketID.ToString());
                    if (custInfo != null)
                    {
                        tfCustPidName1.Value = custInfo.CustName;
                        tfCustPid1.Value     = ccCust.TradeMarketID.ToString();
                    }
                }
            }

            if (!string.IsNullOrEmpty(ccCust.OriginalCustID))
            {
                if (ccCust.Status != null)
                {
                    switch (ccCust.Status.Value)
                    {
                    case 0:
                        imgCustStatus.Src = "/Images/xt.gif";
                        imgCustStatus.Attributes.Add("title", "在用");
                        break;

                    case 1:
                        imgCustStatus.Src = "/Images/xt_1.gif";
                        imgCustStatus.Attributes.Add("title", "停用");
                        break;

                    default:
                        break;
                    }
                }

                if (ccCust.Lock != null && ccCust.Lock.Value == 1)
                {
                    imgCustStatusLock.Src = "/Images/lock.gif";
                    imgCustStatusLock.Attributes.Add("title", "锁定");
                }
                else if (ccCust.Lock != null && ccCust.Lock.Value == 0)
                {
                    imgCustStatusLock.Src = "/Images/unlock.gif";
                    imgCustStatusLock.Attributes.Add("title", "未锁定");
                }

                liCustStatus.Style.Remove("display");
                liCustLock.Style.Remove("display");
            }

            li = this.selCustLevel.Items.FindByValue(ccCust.LevelID);
            this.selCustLevel.SelectedIndex = this.selCustLevel.Items.IndexOf(li);

            BitAuto.YanFa.Crm2009.Entities.CustInfo crmCust = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.CustPid);
            if (crmCust != null)
            {
                this.tfCustPid.Value = crmCust.CustID; this.tfCustPidName.Value = crmCust.CustName;
            }

            crmCust = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.Pid);
            if (crmCust != null)
            {
                this.tfPid.Value = crmCust.CustID; this.tfPidName.Value = crmCust.CustName;
            }

            crmCust = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.FoursPid);
            if (crmCust != null)
            {
                this.tf4sPid.Value = crmCust.CustID; this.tf4sName.Value = crmCust.CustName;
            }


            li = this.selShopLevel.Items.FindByValue(ccCust.ShopLevel);
            this.selShopLevel.SelectedIndex = this.selShopLevel.Items.IndexOf(li);

            this.tfBrand.Value     = BLL.Util.List2String(ccCust.BrandIDs, ",", "", "");
            this.tfBrandName.Value = BLL.Util.List2String(ccCust.BrandNames, ",", "", "");

            this.tfOfficeTel.Value   = ccCust.OfficeTel;
            this.tfFax.Value         = ccCust.Fax;
            this.tfContactName.Value = ccCust.ContactName;
            this.tfNotes.Value       = ccCust.Notes;

            #endregion

            #region 加载会员信息(如果没有会员,并且从excel中加载,加载一个空会员控件)
            List <Entities.ProjectTask_DMSMember> ccMembers = BLL.ProjectTask_DMSMember.Instance.GetProjectTask_DMSMemberByTID(task.PTID);
            if (ccMembers.Count > 0)
            {
                Control ctl;
                foreach (Entities.ProjectTask_DMSMember m in ccMembers)
                {
                    //在CRM中有会员
                    if (string.IsNullOrEmpty(m.OriginalDMSMemberID) == false)
                    {
                        HasMembersInCrm = true;
                    }

                    ctl = this.LoadControl("~/CustInfo/EditVWithCalling/UCEditMember.ascx", m);
                    this.PlaceHolder.Controls.Add(ctl);
                }
            }
            else
            {
                if (task.Source == 1)
                {
                    Control ctl = this.LoadControl("~/CustInfo/EditVWithCalling/UCEditMember.ascx", task.PTID);
                    this.PlaceHolder.Controls.Add(ctl);
                }
            }
            #endregion

            #region 加载车商通会员信息
            //如果是新车二手车或二手车
            if (ccCust.CarType == 2 || ccCust.CarType == 3)
            {
                Entities.ProjectTask_CSTMember queryCstMember = new Entities.ProjectTask_CSTMember();

                List <Entities.ProjectTask_CSTMember> ccCstMembers = BLL.ProjectTask_CSTMember.Instance.GetProjectTask_CSTMemberByTID(task.PTID);
                if (ccCstMembers.Count > 0)
                {
                    Control ctl;
                    foreach (Entities.ProjectTask_CSTMember m in ccCstMembers)
                    {
                        ////在CRM中有会员
                        //if (string.IsNullOrEmpty(m.OriginalDMSMemberID) == false) { HasMembersInCrm = true; }

                        ctl = this.LoadControl("~/CustInfo/EditVWithCalling/UCEditCstMember.ascx", m);
                        this.PlaceHolderCstMember.Controls.Add(ctl);
                    }
                }
            }
            //如果是新车客户,显示车商通的会员
            if (ccCust.CarType == 1)
            {
                List <Entities.ProjectTask_CSTMember> ccMemberList = BLL.ProjectTask_CSTMember.Instance.GetProjectTask_CSTMemberByTID(this.Task.PTID);

                Control ctl;
                foreach (Entities.ProjectTask_CSTMember m in ccMemberList)
                {
                    ctl = this.LoadControl("~/CustInfo/DetailV/UCCstMemberFromCC.ascx", m);
                    this.PlaceHolderShowCstMember.Controls.Add(ctl);
                }
            }
            #endregion
        }
Beispiel #17
0
        private void BindCCCustomerInfo()
        {
            Entities.ProjectTask_Cust ccCust = BLL.ProjectTask_Cust.Instance.GetProjectTask_Cust(this.Task.PTID);
            CCCust = ccCust;
            if (ccCust != null)
            {
                CarType = ccCust.CarType;
                TypeID  = ccCust.TypeID;
                spanCustName.InnerText = ccCust.CustName;
                spanCustAbbr.InnerText = ccCust.AbbrName;
                spanAddress.InnerText  = ccCust.Address;

                spanBrandName.InnerText   = BLL.Util.List2String(ccCust.BrandNames, ",", "", "");
                spanContactName.InnerText = ccCust.ContactName;
                spanFax.InnerText         = ccCust.Fax;
                if (!string.IsNullOrEmpty(ccCust.IndustryID))
                {
                    spanCustIndustry.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.IndustryID));
                }
                if (!string.IsNullOrEmpty(ccCust.LevelID))
                {
                    spanCustLevel.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.LevelID));
                }

                // 集团 厂商 没有 [所属集团 所属厂商]; 没有新增会员按钮
                if (ccCust.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Company).ToString() || ccCust.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Bloc).ToString())
                {
                    liPid.Visible     = false;
                    liCustPid.Visible = false;
                }
                else
                {
                    if (ccCust.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.SynthesizedShop).ToString())
                    {
                        liCustPid.Visible = false;
                        //综合店 没有厂商
                    }
                    if (ccCust.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Licence).ToString())
                    {
                        liFourS.Visible = true;
                        if (!string.IsNullOrEmpty(ccCust.FoursPid))
                        {
                            BitAuto.YanFa.Crm2009.Entities.CustInfo pmodel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.FoursPid);
                            if (pmodel != null)
                            {
                                spanFourPidName.InnerText = pmodel.CustName;
                            }
                        }
                    }
                }

                spanNotes.InnerText     = ccCust.Notes;
                spanOfficeTel.InnerText = ccCust.OfficeTel;
                if (!string.IsNullOrEmpty(ccCust.Pid))
                {
                    BitAuto.YanFa.Crm2009.Entities.CustInfo pmodel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.Pid);
                    if (pmodel != null)
                    {
                        spanPidName.InnerText = pmodel.CustName;
                    }
                }
                if (!string.IsNullOrEmpty(ccCust.CustPid))
                {
                    BitAuto.YanFa.Crm2009.Entities.CustInfo pmodel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.CustPid);
                    if (pmodel != null)
                    {
                        spanCustPidName.InnerText = pmodel.CustName;
                    }
                }
                //if (!string.IsNullOrEmpty(model.ProducerID) && model.ProducerID != "-1")
                //{
                //    Entities.ProducerInfo producerInfo = BLL.ProducerInfo.Instance.GetProducerInfo(model.ProducerID);
                //    if (model != null)
                //    {
                //        spanProducer.InnerText = producerInfo.ChinaName;
                //    }
                //}
                string provinceCity = "";
                if (!string.IsNullOrEmpty(ccCust.ProvinceID))
                {
                    provinceCity += BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ccCust.ProvinceID);
                }
                if (!string.IsNullOrEmpty(ccCust.CityID))
                {
                    provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ccCust.CityID);
                }
                if (!string.IsNullOrEmpty(ccCust.CountyID))
                {
                    provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ccCust.CountyID);
                }
                spanArea.InnerText = provinceCity;
                //if (!string.IsNullOrEmpty(model.SaleOrgID) && model.SaleOrgID != "-1")
                //{
                //    Entities.SalesNetwork salesNetwork = BLL.SalesNetwork.Instance.GetSalesNetwork(model.SaleOrgID);
                //    if (model != null)
                //    {
                //        spanSaleNetwork.InnerText = salesNetwork.SnName;
                //    }
                //}
                if (!string.IsNullOrEmpty(ccCust.ShopLevel))
                {
                    spanShopLevel.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.ShopLevel));
                }
                if (!string.IsNullOrEmpty(ccCust.TypeID))
                {
                    spanCustType.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.TypeID));
                }
                spanZipcode.InnerText = ccCust.Zipcode;



                //经营范围
                if (ccCust.CarType == 1)
                {
                    spanCarType.InnerText = "新车";
                }
                else if (ccCust.CarType == 2 || ccCust.CarType == 3)
                {
                    if (ccCust.CarType == 2)
                    {
                        spanCarType.InnerText = "二手车";
                    }
                    else if (ccCust.CarType == 3)
                    {
                        spanCarType.InnerText = "新车/二手车";
                    }
                    //二手车经营类型 置换型:1;零售型:2
                    if (ccCust.UsedCarBusinessType == "1")
                    {
                        spanUsedCarBusiness.InnerText = "置换型";
                    }
                    else if (ccCust.UsedCarBusinessType == "2")
                    {
                        spanUsedCarBusiness.InnerText = "零售型";
                    }

                    //所属交易市场
                    if (!string.IsNullOrEmpty(ccCust.TradeMarketID))
                    {
                        BitAuto.YanFa.Crm2009.Entities.CustInfo custinfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.TradeMarketID.ToString());
                        if (custinfo != null)
                        {
                            spanTradeMarketID.InnerText = custinfo.CustName;
                        }
                    }
                }
                else if (ccCust.CarType == 3)
                {
                    spanCarType.InnerText = "新车/二手车";
                }

                #region Modify=masj,Date=2012-04-13 注释掉
                ////车商通会员ID
                //if (ccCust.CstMemberID != "" && ccCust.CstMemberID != null)
                //{
                //    string[] strCstMemberID = ccCust.CstMemberID.Split(',');
                //    spanCstMemberID.InnerHtml = "";
                //    for (int k = 0; k < strCstMemberID.Length; k++)
                //    {
                //        spanCstMemberID.InnerHtml += "<a href='/CustCheck/CSTMember/CSTMemberInfo.aspx?CSTMemberID=" + strCstMemberID[k] + "' target='_blank'>" + strCstMemberID[k] + "</a>";
                //        if (k != strCstMemberID.Length - 1)
                //        {
                //            spanCstMemberID.InnerHtml += ",";
                //        }
                //    }
                //}
                #endregion

                if (!string.IsNullOrEmpty(ccCust.OriginalCustID))
                {
                    if (ccCust.Status != null)
                    {
                        switch (ccCust.Status.Value)
                        {
                        case 0:
                            imgCustStatus.Src = "/Images/xt.gif";
                            imgCustStatus.Attributes.Add("title", "在用");
                            break;

                        case 1:
                            imgCustStatus.Src = "/Images/xt_1.gif";
                            imgCustStatus.Attributes.Add("title", "停用");
                            break;

                        default:
                            break;
                        }
                    }

                    if (ccCust.Lock != null && ccCust.Lock.Value == 1)
                    {
                        imgCustStatusLock.Src = "/Images/lock.gif";
                        imgCustStatusLock.Attributes.Add("title", "锁定");
                    }
                    else if (ccCust.Lock != null && ccCust.Lock.Value == 0)
                    {
                        imgCustStatusLock.Src = "/Images/unlock.gif";
                        imgCustStatusLock.Attributes.Add("title", "未锁定");
                    }

                    liCustStatus.Style.Remove("display");
                    liCustLock.Style.Remove("display");
                }
            }
        }
Beispiel #18
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            currentContext = context;
            BitAuto.YanFa.SysRightManager.Common.UserInfo.Check();
            if ((context.Request["showMemberInfo"] + "").Trim() == "yes")
            {
                List <BitAuto.YanFa.Crm2009.Entities.DMSMember> listDMSMember = BitAuto.YanFa.Crm2009.BLL.DMSMember.Instance.GetDMSMember(RequestCustID);
                StringBuilder sb = new StringBuilder();
                if (listDMSMember.Count > 0)
                {
                    foreach (BitAuto.YanFa.Crm2009.Entities.DMSMember newDMSMember in listDMSMember)
                    {
                        sb.Append("{'ID':'" + newDMSMember.MemberCode + "','Name':'" + newDMSMember.Name + "'},");
                    }
                    message = sb.ToString().TrimEnd(",".ToCharArray());
                }
                else
                {
                    message = sb.ToString();
                }
                context.Response.Write("[" + message + "]");
                context.Response.End();
            }
            else if ((context.Request["showMemberInfo"] + "").Trim() == "yesbycustid")
            {
                List <BitAuto.YanFa.Crm2009.Entities.DMSMember> listDMSMember = BitAuto.YanFa.Crm2009.BLL.DMSMember.Instance.GetDMSMemberByCustID(RequestCustID);
                StringBuilder sb = new StringBuilder();
                if (listDMSMember.Count > 0)
                {
                    foreach (BitAuto.YanFa.Crm2009.Entities.DMSMember newDMSMember in listDMSMember)
                    {
                        sb.Append("{'ID':'" + newDMSMember.MemberCode + "','Name':'" + newDMSMember.Name + "'},");
                    }
                    message = sb.ToString().TrimEnd(",".ToCharArray());
                }
                else
                {
                    message = sb.ToString();
                }
                context.Response.Write("[" + message + "]");
                context.Response.End();
            }
            else if ((context.Request["getCustInfo"] + "").Trim() == "yesbycustid")
            {
                BitAuto.YanFa.Crm2009.Entities.CustInfo custInfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(RequestCustID);
                if (custInfo != null)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.Append("{'TypeID':'" + custInfo.TypeID + "','Name':'" + custInfo.CustName + "'}");
                    message = sb.ToString();
                    //如果客户类别是 个人、经纪公司、交易市场,则选中二手车,其他选择新车
                    //switch (custInfo.TypeID)
                    //{
                    //    case "20010":
                    //    case "20011":
                    //    case "20012": this.chkTypeSnd.Checked = true; break;
                    //    default: this.chkTypeNew.Checked = true; break;
                    //}


                    //BindText();
                    //litCustName.InnerText = custInfo.CustName;
                }
            }
            else
            {
                success = false;
                message = "request error";
                BitAuto.ISDC.CC2012.BLL.AJAXHelper.WrapJsonResponse(success, result, message);
            }
        }
        private void BindCustomerInfo()
        {
            CarType = this.CustInfo.CarType;
            spanCustName.InnerText = this.CustInfo.CustName;
            spanCustAbbr.InnerText = this.CustInfo.AbbrName;
            spanAddress.InnerText  = this.CustInfo.Address;

            BitAuto.YanFa.Crm2009.Entities.QueryBrandInfo queryBrandInfo = new BitAuto.YanFa.Crm2009.Entities.QueryBrandInfo();
            queryBrandInfo.CustID = this.CustInfo.CustID;
            int       o;
            string    s  = "";
            DataTable dt = BitAuto.YanFa.Crm2009.BLL.CarBrand.Instance.GetCustBrandInfo(queryBrandInfo, "", 1, 10000, out o);

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    s += dt.Rows[i]["name"] + " ";
                }
            }
            spanBrandName.InnerText   = s;
            spanContactName.InnerText = this.CustInfo.contactName;
            ContactName       = this.CustInfo.contactName;
            spanFax.InnerText = this.CustInfo.Fax;
            if (!string.IsNullOrEmpty(this.CustInfo.IndustryID))
            {
                spanCustIndustry.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(this.CustInfo.IndustryID));
            }
            if (!string.IsNullOrEmpty(this.CustInfo.LevelID))
            {
                spanCustLevel.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(this.CustInfo.LevelID));
            }

            // 集团 厂商 没有 [所属集团 所属厂商]; 没有新增会员按钮
            if (this.CustInfo.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Company).ToString() || this.CustInfo.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Bloc).ToString())
            {
                liPid.Visible     = false;
                liCustPid.Visible = false;
            }
            else
            {
                if (this.CustInfo.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.SynthesizedShop).ToString())
                {
                    liCustPid.Visible = false;
                    //综合店 没有厂商
                }
            }

            spanNotes.InnerText     = this.CustInfo.Notes;
            spanOfficeTel.InnerText = this.CustInfo.Officetel;
            OfficeTel = this.CustInfo.Officetel;
            if (!string.IsNullOrEmpty(this.CustInfo.Pid))
            {
                BitAuto.YanFa.Crm2009.Entities.CustInfo pmodel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(this.CustInfo.Pid);
                if (pmodel != null)
                {
                    spanPidName.InnerText = pmodel.CustName;
                }
            }
            if (!string.IsNullOrEmpty(this.CustInfo.CustPid))
            {
                BitAuto.YanFa.Crm2009.Entities.CustInfo pmodel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(this.CustInfo.CustPid);
                if (pmodel != null)
                {
                    spanCustPidName.InnerText = pmodel.CustName;
                }
            }
            string provinceCity = "";

            if (!string.IsNullOrEmpty(this.CustInfo.ProvinceID))
            {
                provinceCity += BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(this.CustInfo.ProvinceID);
            }
            if (!string.IsNullOrEmpty(this.CustInfo.CityID))
            {
                provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(this.CustInfo.CityID);
            }
            if (!string.IsNullOrEmpty(this.CustInfo.CountyID))
            {
                provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(this.CustInfo.CountyID);
            }
            spanArea.InnerText = provinceCity;
            if (!string.IsNullOrEmpty(this.CustInfo.ShopLevel))
            {
                spanShopLevel.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(this.CustInfo.ShopLevel));
            }
            if (!string.IsNullOrEmpty(this.CustInfo.TypeID))
            {
                spanCustType.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(this.CustInfo.TypeID));
            }
            spanZipcode.InnerText = this.CustInfo.zipcode;
        }
Beispiel #20
0
        /// <summary>
        /// 从CC_Custs中读取客户信息与会员信息。
        /// </summary>
        private void LoadInfoFromCC_Cust(Entities.ProjectTaskInfo task)
        {
            #region 加载客户信息
            Entities.ProjectTask_Cust ccCust = BLL.ProjectTask_Cust.Instance.GetProjectTask_Cust(task.PTID);

            this.OriginalCustID = ccCust.OriginalCustID;

            this.tfCustName.Value = ccCust.CustName;
            this.tfCustAbbr.Value = ccCust.AbbrName;

            ListItem li = this.selCustType.Items.FindByValue(ccCust.TypeID);
            this.selCustType.SelectedIndex = this.selCustType.Items.IndexOf(li);
            if (task.Source == 2)                                   //CRM库来源
            {
                selCustType.Attributes.Add("disabled", "disabled"); //不能编辑客户类别
            }

            li = this.selCustIndustry.Items.FindByValue(ccCust.IndustryID);
            this.selCustIndustry.SelectedIndex = this.selCustIndustry.Items.IndexOf(li);

            this.InitialProvinceID = ccCust.ProvinceID;
            this.InitialCityID     = ccCust.CityID;
            this.InitialCountyID   = ccCust.CountyID;
            this.tfAddress.Value   = ccCust.Address;
            this.tfZipcode.Value   = ccCust.Zipcode;
            if (!string.IsNullOrEmpty(ccCust.TradeMarketID))
            {
                //this.sltTradeMarket.Value = ccCust.TradeMarketID.ToString();
                BitAuto.YanFa.Crm2009.Entities.CustInfo custInfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.TradeMarketID.ToString());
                if (custInfo != null)
                {
                    tfCustPidName.Value = custInfo.CustName;
                    tfCustPid.Value     = ccCust.TradeMarketID.ToString();
                }
            }
            if (ccCust.CarType == 2)
            {
                this.chkOldCarType.Checked = true;

                #region Modify=masj,Date=2012-04-13 注释掉
                //if (ccCust.CstMemberID != "" && ccCust.CstMemberID != null)
                //{
                //    this.txtCtsMemberID.Value = ccCust.CstMemberID;
                //}
                #endregion
                //if (!string.IsNullOrEmpty(ccCust.UsedCarBusinessType))
                //{
                //    this.sltUsedCarBusinessType.Value = ccCust.UsedCarBusinessType.ToString();
                //}
            }

            if (!string.IsNullOrEmpty(ccCust.OriginalCustID))
            {
                if (ccCust.Status != null)
                {
                    switch (ccCust.Status.Value)
                    {
                    case 0:
                        imgCustStatus.Src = "/Images/xt.gif";
                        imgCustStatus.Attributes.Add("title", "在用");
                        break;

                    case 1:
                        imgCustStatus.Src = "/Images/xt_1.gif";
                        imgCustStatus.Attributes.Add("title", "停用");
                        break;

                    default:
                        break;
                    }
                }

                if (ccCust.Lock != null && ccCust.Lock.Value == 1)
                {
                    imgCustStatusLock.Src = "/Images/lock.gif";
                    imgCustStatusLock.Attributes.Add("title", "锁定");
                }
                else if (ccCust.Lock != null && ccCust.Lock.Value == 0)
                {
                    imgCustStatusLock.Src = "/Images/unlock.gif";
                    imgCustStatusLock.Attributes.Add("title", "未锁定");
                }

                liCustStatus.Style.Remove("display");
                liCustLock.Style.Remove("display");
            }

            li = this.selCustLevel.Items.FindByValue(ccCust.LevelID);
            this.selCustLevel.SelectedIndex = this.selCustLevel.Items.IndexOf(li);

            this.tfOfficeTel.Value   = ccCust.OfficeTel;
            this.tfFax.Value         = ccCust.Fax;
            this.tfContactName.Value = ccCust.ContactName;
            this.tfNotes.Value       = ccCust.Notes;

            #endregion

            BindCCMemberList();

            #region 加载车商通会员信息
            //如果是新车二手车或二手车
            if (ccCust.CarType == 2 || ccCust.CarType == 3)
            {
                Entities.QueryProjectTask_CSTMember queryCstMember = new Entities.QueryProjectTask_CSTMember();

                List <Entities.ProjectTask_CSTMember> ccCstMembers = BLL.ProjectTask_CSTMember.Instance.GetProjectTask_CSTMemberByTID(task.PTID);
                if (ccCstMembers.Count > 0)
                {
                    Control ctl;
                    foreach (Entities.ProjectTask_CSTMember m in ccCstMembers)
                    {
                        ////在CRM中有会员
                        //if (string.IsNullOrEmpty(m.OriginalDMSMemberID) == false) { HasMembersInCrm = true; }

                        ctl = this.LoadControl("~/CustInfo/EditVWithCalling/UCEditCstMember.ascx", m);
                        this.PlaceHolderCstMember.Controls.Add(ctl);
                    }
                }
                //else
                //{
                //    if (task.Source == 1)
                //    {
                //        Control ctl = this.LoadControl("~/CustInfo/EditVWithCalling/UCEditCstMember.ascx", task.TID);
                //        this.PlaceHolderCstMember.Controls.Add(ctl);
                //    }
                //}
            }
            #endregion
        }
        /// <summary>
        /// 合同和它的金额(数组:0-总金额 1-现有金额)
        /// </summary>
        //private Dictionary<string, decimal[]> contractMoney = new Dictionary<string, decimal[]>();

        /// <summary>
        /// 校验
        /// </summary>
        private bool Valid(int rowNum, IDataReader reader, List <MagezineInfoImportExceptionInfo> exceptionInfoList, Dictionary <Entities.CC_MagazineReturn, string> magezineInfoList)
        {
            bool currentSuccess = true;
            MagezineInfoImportExceptionInfo ex = new MagezineInfoImportExceptionInfo();

            #region validate

            string custId     = reader[0].ToString().Trim();
            string memberCode = reader[2].ToString().Trim();
            string contacter  = reader[4].ToString().Trim();;

            int    contractId  = -1;
            string dmsMemberID = string.Empty;

            if (string.IsNullOrEmpty(custId) && string.IsNullOrEmpty(memberCode) && string.IsNullOrEmpty(contacter))
            {
                return(currentSuccess);//此行为空行
            }

            //判断UserID参数

            int intval = 0;
            if (!int.TryParse(UserID, out intval))
            {
                ex.Info.Append("用户ID参数不正确");
                currentSuccess = false;
            }

            //客户信息验证
            if (string.IsNullOrEmpty(custId))
            {
                ex.Info.Append("第" + rowNum + "行此[客户ID]不可为空。");
                currentSuccess = false;
            }
            else
            {
                BitAuto.YanFa.Crm2009.Entities.CustInfo custInfo = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(custId);
                if (custInfo == null)
                {
                    ex.Info.Append("第" + rowNum + "行此[客户ID]不存在。");
                    currentSuccess = false;
                }
            }

            //会员信息验证
            if (string.IsNullOrEmpty(memberCode))
            {
                ex.Info.Append("第" + rowNum + "行此[会员ID]不可为空。");
                currentSuccess = false;
            }
            else
            {
                List <BitAuto.YanFa.Crm2009.Entities.DMSMember> dmsMembers = BitAuto.YanFa.Crm2009.BLL.DMSMember.Instance.GetDMSMemberByCustID(custId);

                if (dmsMembers == null)
                {
                    ex.Info.Append("第" + rowNum + "行此[会员ID]不存在。");
                    currentSuccess = false;
                }
                else
                {
                    bool isExist = false;
                    foreach (BitAuto.YanFa.Crm2009.Entities.DMSMember dmsMember in dmsMembers)
                    {
                        if (dmsMember.MemberCode == memberCode.Trim())
                        {
                            isExist     = true;
                            dmsMemberID = dmsMember.ID.ToString();
                        }
                    }
                    if (!isExist)
                    {
                        ex.Info.Append("第" + rowNum + "行此客户下不存在此[会员ID]。");
                        currentSuccess = false;
                    }
                }
            }

            if (string.IsNullOrEmpty(contacter))
            {
                ex.Info.Append("第" + rowNum + "行此[联系人]不可为空。");
                currentSuccess = false;
            }
            else
            {
                contacter = contacter.Replace(',', ',');
                string[] contacterArry = contacter.Split(',');

                foreach (string cter in contacterArry)
                {
                    BitAuto.YanFa.Crm2009.Entities.QueryContactInfo query = new BitAuto.YanFa.Crm2009.Entities.QueryContactInfo();
                    query.CustID = custId;
                    query.CName  = cter.Trim();

                    int       totalCount = 0;
                    DataTable dt         = BitAuto.YanFa.Crm2009.BLL.ContactInfo.Instance.GetContactInfo(query, "", 1, 1, out totalCount);
                    if (dt.Rows.Count <= 0)
                    {
                        ex.Info.Append("第" + rowNum + "行联系人<" + cter + ">不存在。");
                        currentSuccess = false;
                    }
                    else
                    {
                        contractId = int.Parse(dt.Rows[0]["ID"].ToString());
                    }
                }
            }

            if (string.IsNullOrEmpty(CooperationName))
            {
                ex.Info.Append("合作名称不能为空");
                currentSuccess = false;
            }
            else
            {
                Entities.QueryCC_MagazineReturn query = new Entities.QueryCC_MagazineReturn();
                query.Title       = "第" + cooperationName + "期";
                query.Status      = 0;
                query.DMSMemberID = dmsMemberID;
                int       totalCount = 0;
                DataTable dt         = BLL.CC_MagazineReturn.Instance.GetCC_MagazineReturn(query, "", 1, 1, out totalCount);
                if (dt.Rows.Count > 0)
                {
                    ex.Info.Append("第" + rowNum + "行已经存在此期的会员");
                    currentSuccess = false;
                }
            }

            #endregion
            //如通过则插入数据
            if (currentSuccess)
            {
                Entities.CC_MagazineReturn info = new Entities.CC_MagazineReturn();
                info.ContactID    = contractId;
                info.CreateTime   = DateTime.Now;
                info.CreateUserID = int.Parse(UserID);
                info.CustID       = custId;
                info.DMSMemberID  = dmsMemberID;
                info.Title        = "第" + cooperationName + "期";
                info.Status       = 0;
                magezineInfoList.Add(info, contacter);
            }
            else
            {
                exceptionInfoList.Add(ex);
            }

            return(currentSuccess);
        }
        private void BindCustInfo()
        {
            Entities.ProjectTask_Cust query = new Entities.ProjectTask_Cust();
            if (TID != string.Empty)
            {
                Task = BLL.ProjectTaskInfo.Instance.GetProjectTaskInfo(TID);
                Entities.ProjectTask_Cust ccCust = BLL.ProjectTask_Cust.Instance.GetCustInfoModelByPTID(TID);
                if (ccCust != null)
                {
                    CarType = ccCust.CarType;
                    spanCustName.InnerText    = ccCust.CustName;
                    spanCustAbbr.InnerText    = ccCust.AbbrName;
                    spanAddress.InnerText     = ccCust.Address;
                    hdnCustType.Value         = ccCust.TypeID;
                    spanBrandName.InnerText   = BitAuto.ISDC.CC2012.Web.WebUtil.Converter.List2String(ccCust.BrandNames, ",", "", "");
                    spanContactName.InnerText = ccCust.ContactName;
                    spanFax.InnerText         = ccCust.Fax;
                    if (!string.IsNullOrEmpty(ccCust.IndustryID))
                    {
                        spanCustIndustry.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.IndustryID));
                    }
                    if (!string.IsNullOrEmpty(ccCust.LevelID))
                    {
                        spanCustLevel.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.LevelID));
                    }

                    // 集团 厂商 没有 [所属集团 所属厂商]; 没有新增会员按钮
                    if (ccCust.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Company).ToString() || ccCust.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.Bloc).ToString())
                    {
                        liPid.Visible     = false;
                        liCustPid.Visible = false;
                    }
                    else
                    {
                        if (ccCust.TypeID == ((int)BitAuto.YanFa.Crm2009.Entities.EnumCustomType.SynthesizedShop).ToString())
                        {
                            liCustPid.Visible = false;
                            //综合店 没有厂商
                        }
                    }

                    spanNotes.InnerText     = ccCust.Notes;
                    spanOfficeTel.InnerText = ccCust.OfficeTel;
                    if (!string.IsNullOrEmpty(ccCust.Pid))
                    {
                        BitAuto.YanFa.Crm2009.Entities.CustInfo pmodel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.Pid);
                        if (pmodel != null)
                        {
                            spanPidName.InnerText = pmodel.CustName;
                        }
                    }
                    if (!string.IsNullOrEmpty(ccCust.CustPid))
                    {
                        BitAuto.YanFa.Crm2009.Entities.CustInfo pmodel = BitAuto.YanFa.Crm2009.BLL.CustInfo.Instance.GetCustInfo(ccCust.CustPid);
                        if (pmodel != null)
                        {
                            spanCustPidName.InnerText = pmodel.CustName;
                        }
                    }
                    string provinceCity = "";
                    if (!string.IsNullOrEmpty(ccCust.ProvinceID))
                    {
                        provinceCity += BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ccCust.ProvinceID);
                    }
                    if (!string.IsNullOrEmpty(ccCust.CityID))
                    {
                        provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ccCust.CityID);
                    }
                    if (!string.IsNullOrEmpty(ccCust.CountyID))
                    {
                        provinceCity += " " + BitAuto.YanFa.Crm2009.BLL.MainBrand.Instance.GetAreaName(ccCust.CountyID);
                    }
                    spanArea.InnerText = provinceCity;
                    if (!string.IsNullOrEmpty(ccCust.ShopLevel))
                    {
                        spanShopLevel.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.ShopLevel));
                    }
                    if (!string.IsNullOrEmpty(ccCust.TypeID))
                    {
                        spanCustType.InnerText = BitAuto.YanFa.Crm2009.BLL.Util.GetEnumOptText(Convert.ToInt32(ccCust.TypeID));
                        custid.InnerText       = ccCust.TypeID;
                    }
                    spanZipcode.InnerText = ccCust.Zipcode;

                    if (!string.IsNullOrEmpty(ccCust.OriginalCustID))
                    {
                        if (ccCust.Status != null)
                        {
                            switch (ccCust.Status.Value)
                            {
                            case 0:
                                imgCustStatus.Src = "/Images/xt.gif";
                                imgCustStatus.Attributes.Add("title", "在用");
                                imgStatusLock = 1;
                                break;

                            case 1:
                                imgCustStatus.Src = "/Images/xt_1.gif";
                                imgCustStatus.Attributes.Add("title", "停用");
                                imgStatusLock = 1;
                                break;

                            default:
                                break;
                            }
                        }

                        if (ccCust.Lock != null && ccCust.Lock.Value == 1)
                        {
                            imgCustStatusLock.Src = "/Images/lock.gif";
                            imgCustStatusLock.Attributes.Add("title", "锁定");
                            imgLock = 1;
                        }
                        else if (ccCust.Lock != null && ccCust.Lock.Value == 0)
                        {
                            imgCustStatusLock.Src = "/Images/unlock.gif";
                            imgCustStatusLock.Attributes.Add("title", "未锁定");
                            imgLock = 1;
                        }

                        liCustStatus.Style.Remove("display");
                        liCustLock.Style.Remove("display");
                    }
                }
            }
            else
            {
                throw new Exception("无法找到此任务");
            }
        }