Beispiel #1
0
        public int Add(CustomerInfo entity)
        {
            int id = CommonDataProvider.Instance().AddCustomer(entity);

            if (id > 0)
            {
                RefreshCustomerCache(entity);

                CustomerMoveRecordInfo minfo = new CustomerMoveRecordInfo()
                {
                    CustomerID = id,
                    CustomerStatus = entity.CustomerStatus,
                    OwnerID = entity.OwnerID,
                    Owner = entity.Owner,
                    LastUpdateUserID = entity.LastUpdateUserID,
                    LastUpdateUser = entity.LastUpdateUser,
                    CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
                    SystemMsg = entity.SystemRemark
                };

                CustomerMoveRecords.Instance.Add(minfo);
            }

            return id;
        }
Beispiel #2
0
 public abstract int UpdateCustomerLastConnect(CustomerInfo entity);
Beispiel #3
0
 public abstract int UpdateCustomer(CustomerInfo entity);
Beispiel #4
0
 public abstract int AddCustomer(CustomerInfo entity);
Beispiel #5
0
        public static CustomerInfo PopulateCustomerInfo(IDataReader reader)
        {
            CustomerInfo entity = new CustomerInfo()
            {
                ID = (int)reader["ID"],
                Name = reader["Name"] as string,
                Phone = reader["Phone"] as string,
                PhoneVest = reader["PhoneVest"] as string,
                BackupPhone = reader["BackupPhone"] as string,
                ProvinceID = (int)reader["ProvinceID"],
                CityID = (int)reader["CityID"],
                DistrictID = (int)reader["DistrictID"],
                Address = reader["Address"] as string,
                WeixinAccount = reader["WeixinAccount"] as string,
                InfoTypeID = (int)reader["InfoTypeID"],
                InfoSourceID = (int)reader["InfoSourceID"],
                PaymentWayID = (int)reader["PaymentWayID"],
                IbuyCarBrandID = (int)reader["IbuyCarBrandID"],
                IbuyCarSeriesID = (int)reader["IbuyCarSeriesID"],
                IbuyCarModelID = (int)reader["IbuyCarModelID"],
                IbuyTimeID = (int)reader["IbuyTimeID"],
                QuotedpriceInfo = reader["QuotedpriceInfo"] as string,
                PromotionInfo = reader["PromotionInfo"] as string,
                RemarkInfo = reader["RemarkInfo"] as string,
                CreateUserID = (int)reader["CreateUserID"],
                CreateUser = reader["CreateUser"] as string,
                CreateTime = reader["CreateTime"] as string,
                OwnerID = (int)reader["OwnerID"],
                Owner = reader["Owner"] as string,
                OwnerPowerGroupID = (int)reader["OwnerPowerGroupID"],
                CustomerSex = (int)reader["CustomerSex"],
                TracktagID = reader["TracktagID"] as string,
                Tracktag = reader["Tracktag"] as string,
                CustomerStatusSource = (int)reader["CustomerStatusSource"],
                CustomerStatus = (int)reader["CustomerStatus"],
                LastCustomerLevelID = (int)reader["LastCustomerLevelID"],
                LastConnectwayID = (int)reader["LastConnectwayID"],
                LastConnectTime = reader["LastConnectTime"] as string,
                LastConnectUserID = (int)reader["LastConnectUserID"],
                LastConnectUser = reader["LastConnectUser"] as string,
                LastConnectDetail = reader["LastConnectDetail"] as string,
                ReservationTime = reader["ReservationTime"] as string,
                VisitTime = reader["VisitTime"] as string,
                LeaveTime = reader["LeaveTime"] as string,
                VisitDuration = (int)reader["VisitDuration"],
                VisitNumber = (int)reader["VisitNumber"],
                IsVisit = (int)reader["IsVisit"],
                ConnectTimes = (int)reader["ConnectTimes"],
                LastUpdateUserID = (int)reader["LastUpdateUserID"],
                LastUpdateUser = reader["LastUpdateUser"] as string,
                LastUpdateTime = reader["LastUpdateTime"] as string,
                SbuyCarBrandID = (int)reader["SbuyCarBrandID"],
                SbuyCarSeriesID = (int)reader["SbuyCarSeriesID"],
                SbuyCarModelID = (int)reader["SbuyCarModelID"],
                OrderNumber = reader["OrderNumber"] as string,
                KnockdownPrice = reader["KnockdownPrice"] as string,
                PlaceOrderTime = reader["PlaceOrderTime"] as string,
                PicupcarTime = reader["PicupcarTime"] as string,
                GiveupCauseID = (int)reader["GiveupCauseID"],
                FailureCauseAnalyze = reader["FailureCauseAnalyze"] as string,
                MarketDirectorID = (int)reader["MarketDirectorID"],
                MarketDirector = reader["MarketDirector"] as string,
                DCCDirectorID = (int)reader["DCCDirectorID"],
                DCCDirector = reader["DCCDirector"] as string,
                ExhibitionDirectorID = (int)reader["ExhibitionDirectorID"],
                ExhibitionDirector = reader["ExhibitionDirector"] as string,
                DirectorID = (int)reader["DirectorID"],
                Director = reader["Director"] as string,
                SystemRemark = reader["SystemRemark"] as string,
                LurkStatus = (int)reader["LurkStatus"],
                CheckStatus = (int)reader["CheckStatus"],
                DelState = (bool)reader["DelState"] ? 1 : 0,
                PostTime = reader["PostTime"] as string,
                CorporationID = (int)reader["CorporationID"]
            };

            return entity;
        }
Beispiel #6
0
 /// <summary>
 /// 更新客户线索缓存
 /// </summary>
 /// <param name="entity"></param>
 public void RefreshCustomerCache(CustomerInfo entity)
 {
     string key = GlobalKey.CUSTOMER_LIST + "_corp" + entity.CorporationID;
     List<CustomerInfo> list = MangaCache.Get(key) as List<CustomerInfo>;
     entity = GetCustomerByID(entity.ID);
     if (list != null && list.Exists(c => c.ID == entity.ID))
     {
         list[list.FindIndex(c => c.ID == entity.ID)] = entity;
     }
     else if (list == null)
     {
         GetCustomerListByCorporation(entity.CorporationID, true);
     }
     else
         list.Add(entity);
 }
Beispiel #7
0
        public int UpdateCustomerLastConnect(CustomerInfo entity)
        {
            int result = 0;
            result = CommonDataProvider.Instance().UpdateCustomerLastConnect(entity);

            if (result > 0)
            {
                RefreshCustomerCache(entity);
            }

            return result;
        }
 public override int UpdateCustomerLastConnect(CustomerInfo entity)
 {
     string sql = @"
     UPDATE ComOpp_Customer  SET
         [LastConnectTime] = @LastConnectTime
         ,[LastConnectDetail] = @LastConnectDetail
         ,[LastConnectUserID] = @LastConnectUserID
         ,[LastConnectUser] = @LastConnectUser
         ,[LastConnectwayID] = @LastConnectwayID
         ,[LastCustomerLevelID] = @LastCustomerLevelID
         ,[LastUpdateTime] = @LastUpdateTime
         ,[LastUpdateUserID] = @LastUpdateUserID
         ,[LastUpdateUser] = @LastUpdateUser
         ,[ConnectTimes] = @ConnectTimes
     WHERE [ID] = @ID
     ";
     SqlParameter[] p =
     {
         new SqlParameter("@ID",entity.ID),
         new SqlParameter("@LastConnectTime",entity.LastConnectTime),
         new SqlParameter("@LastConnectDetail",entity.LastConnectDetail),
         new SqlParameter("@LastConnectUserID",entity.LastConnectUserID),
         new SqlParameter("@LastConnectUser",entity.LastConnectUser),
         new SqlParameter("@LastConnectwayID",entity.LastConnectwayID),
         new SqlParameter("@LastCustomerLevelID",entity.LastCustomerLevelID),
         new SqlParameter("@LastUpdateTime",entity.LastUpdateTime),
         new SqlParameter("@LastUpdateUserID",entity.LastUpdateUserID),
         new SqlParameter("@LastUpdateUser",entity.LastUpdateUser),
         new SqlParameter("@ConnectTimes",entity.ConnectTimes)
     };
     return DataConvert.SafeInt(SqlHelper.ExecuteNonQuery(_con, CommandType.Text, sql, p));
 }
 public override int AddCustomer(CustomerInfo entity)
 {
     string sql = @"
         INSERT INTO ComOpp_Customer(
             [Name],[Phone],[BackupPhone],[ProvinceID],[CityID],[DistrictID],[Address],[WeixinAccount],[InfoTypeID],[InfoSourceID],[PaymentWayID],[IbuyCarBrandID]
             ,[IbuyCarSeriesID],[IbuyCarModelID],[IbuyTimeID],[QuotedpriceInfo],[PromotionInfo],[RemarkInfo],[OwnerID],[Owner],[OwnerPowerGroupID],[CustomerSex],[TracktagID]
             ,[Tracktag],[CustomerStatus],[CreateTime],[CreateUserID],[CreateUser],[LastUpdateUserID],[LastUpdateUser],[LastUpdateTime],[VisitTime],[VisitNumber],[IsVisit],[CorporationID],[PostTime],[SystemRemark]
         )VALUES(
             @Name,@Phone,@BackupPhone,@ProvinceID,@CityID,@DistrictID,@Address,@WeixinAccount,@InfoTypeID,@InfoSourceID,@PaymentWayID,@IbuyCarBrandID
             ,@IbuyCarSeriesID,@IbuyCarModelID,@IbuyTimeID,@QuotedpriceInfo,@PromotionInfo,@RemarkInfo,@OwnerID,@Owner,@OwnerPowerGroupID,@CustomerSex,@TracktagID
             ,@Tracktag,@CustomerStatus,@CreateTime,@CreateUserID,@CreateUser,@LastUpdateUserID,@LastUpdateUser,@LastUpdateTime,@VisitTime,@VisitNumber,@IsVisit,@CorporationID,@PostTime,@SystemRemark
         );
         SELECT @@IDENTITY;
     ";
     SqlParameter[] p =
     {
         new SqlParameter("@Name",entity.Name),
         new SqlParameter("@Phone",entity.Phone),
         new SqlParameter("@BackupPhone",entity.BackupPhone),
         new SqlParameter("@ProvinceID",entity.ProvinceID),
         new SqlParameter("@CityID",entity.CityID),
         new SqlParameter("@DistrictID",entity.DistrictID),
         new SqlParameter("@Address",entity.Address),
         new SqlParameter("@WeixinAccount",entity.WeixinAccount),
         new SqlParameter("@InfoTypeID",entity.InfoTypeID),
         new SqlParameter("@InfoSourceID",entity.InfoSourceID),
         new SqlParameter("@PaymentWayID",entity.PaymentWayID),
         new SqlParameter("@IbuyCarBrandID",entity.IbuyCarBrandID),
         new SqlParameter("@IbuyCarSeriesID",entity.IbuyCarSeriesID),
         new SqlParameter("@IbuyCarModelID",entity.IbuyCarModelID),
         new SqlParameter("@IbuyTimeID",entity.IbuyTimeID),
         new SqlParameter("@QuotedpriceInfo",entity.QuotedpriceInfo),
         new SqlParameter("@PromotionInfo",entity.PromotionInfo),
         new SqlParameter("@RemarkInfo",entity.RemarkInfo),
         new SqlParameter("@OwnerID",entity.OwnerID),
         new SqlParameter("@Owner",entity.Owner),
         new SqlParameter("@OwnerPowerGroupID",entity.OwnerPowerGroupID),
         new SqlParameter("@CustomerSex",entity.CustomerSex),
         new SqlParameter("@TracktagID",entity.TracktagID),
         new SqlParameter("@Tracktag",entity.Tracktag),
         new SqlParameter("@CustomerStatus",entity.CustomerStatus),
         new SqlParameter("@CreateTime",entity.CreateTime),
         new SqlParameter("@CreateUserID",entity.CreateUserID),
         new SqlParameter("@CreateUser",entity.CreateUser),
         new SqlParameter("@LastUpdateUserID",entity.LastUpdateUserID),
         new SqlParameter("@LastUpdateUser",entity.LastUpdateUser),
         new SqlParameter("@LastUpdateTime",entity.LastUpdateTime),
         new SqlParameter("@VisitTime",entity.VisitTime),
         new SqlParameter("@VisitNumber",entity.VisitNumber),
         new SqlParameter("@IsVisit",entity.IsVisit),
         new SqlParameter("@CorporationID",entity.CorporationID),
         new SqlParameter("@PostTime",entity.PostTime),
         new SqlParameter("@SystemRemark",entity.SystemRemark)
     };
     entity.ID = DataConvert.SafeInt(SqlHelper.ExecuteScalar(_con, CommandType.Text, sql, p));
     return entity.ID;
 }
Beispiel #10
0
 public abstract void UpdateCustomerPhoneVest(CustomerInfo entity);
        public override int UpdateCustomer(CustomerInfo entity)
        {
            string sql = @"
                UPDATE ComOpp_Customer SET
                [Name] = @Name
                ,[Phone] = @Phone
                ,[BackupPhone] = @BackupPhone
                ,[ProvinceID] = @ProvinceID
                ,[CityID] = @CityID
                ,[DistrictID] = @DistrictID
                ,[Address] = @Address
                ,[WeixinAccount] = @WeixinAccount
                ,[InfoTypeID] = @InfoTypeID
                ,[InfoSourceID] = @InfoSourceID
                ,[PaymentWayID] = @PaymentWayID
                ,[IbuyCarBrandID] = @IbuyCarBrandID
                ,[IbuyCarSeriesID] = @IbuyCarSeriesID
                ,[IbuyCarModelID] = @IbuyCarModelID
                ,[IbuyTimeID] = @IbuyTimeID
                ,[QuotedpriceInfo] = @QuotedpriceInfo
                ,[PromotionInfo] = @PromotionInfo
                ,[RemarkInfo] = @RemarkInfo
                ,[OwnerID] = @OwnerID
                ,[Owner] = @Owner
                ,[OwnerPowerGroupID] = @OwnerPowerGroupID
                ,[CustomerSex] = @CustomerSex
                ,[TracktagID] = @TracktagID
                ,[Tracktag] = @Tracktag
                ,[CustomerStatusSource] = @CustomerStatusSource
                ,[CustomerStatus] = @CustomerStatus
                ,[ReservationTime] = @ReservationTime
                ,[VisitTime] = @VisitTime
                ,[LeaveTime] = @LeaveTime
                ,[VisitDuration] = @VisitDuration
                ,[VisitNumber] = @VisitNumber
                ,[IsVisit] = @IsVisit
                ,[LastUpdateUserID] = @LastUpdateUserID
                ,[LastUpdateUser] = @LastUpdateUser
                ,[LastUpdateTime] = @LastUpdateTime
                ,[SbuyCarBrandID] = @SbuyCarBrandID
                ,[SbuyCarSeriesID] = @SbuyCarSeriesID
                ,[SbuyCarModelID] = @SbuyCarModelID
                ,[OrderNumber] = @OrderNumber
                ,[KnockdownPrice] = @KnockdownPrice
                ,[PlaceOrderTime] = @PlaceOrderTime
                ,[PicupcarTime] = @PicupcarTime
                ,[GiveupCauseID] = @GiveupCauseID
                ,[FailureCauseAnalyze] = @FailureCauseAnalyze
                ,[SystemRemark] = @SystemRemark
                ,[CheckStatus] = @CheckStatus
                ,[LurkStatus] = @LurkStatus
                ,[DelState] = @DelState
                ,[PostTime] = @PostTime
            WHERE [ID] = @ID
            ";

            SqlParameter[] p =
            {
                new SqlParameter("@ID",entity.ID),
                new SqlParameter("@Name",entity.Name),
                new SqlParameter("@Phone",entity.Phone),
                new SqlParameter("@BackupPhone",entity.BackupPhone),
                new SqlParameter("@ProvinceID",entity.ProvinceID),
                new SqlParameter("@CityID",entity.CityID),
                new SqlParameter("@DistrictID",entity.DistrictID),
                new SqlParameter("@Address",entity.Address),
                new SqlParameter("@WeixinAccount",entity.WeixinAccount),
                new SqlParameter("@InfoTypeID",entity.InfoTypeID),
                new SqlParameter("@InfoSourceID",entity.InfoSourceID),
                new SqlParameter("@PaymentWayID",entity.PaymentWayID),
                new SqlParameter("@IbuyCarBrandID",entity.IbuyCarBrandID),
                new SqlParameter("@IbuyCarSeriesID",entity.IbuyCarSeriesID),
                new SqlParameter("@IbuyCarModelID",entity.IbuyCarModelID),
                new SqlParameter("@IbuyTimeID",entity.IbuyTimeID),
                new SqlParameter("@QuotedpriceInfo",entity.QuotedpriceInfo),
                new SqlParameter("@PromotionInfo",entity.PromotionInfo),
                new SqlParameter("@RemarkInfo",entity.RemarkInfo),
                new SqlParameter("@OwnerID",entity.OwnerID),
                new SqlParameter("@Owner",entity.Owner),
                new SqlParameter("@OwnerPowerGroupID",entity.OwnerPowerGroupID),
                new SqlParameter("@CustomerSex",entity.CustomerSex),
                new SqlParameter("@TracktagID",entity.TracktagID),
                new SqlParameter("@Tracktag",entity.Tracktag),
                new SqlParameter("@CustomerStatusSource",entity.CustomerStatusSource),
                new SqlParameter("@CustomerStatus",entity.CustomerStatus),
                new SqlParameter("@ReservationTime",entity.ReservationTime),
                new SqlParameter("@VisitTime",entity.VisitTime),
                new SqlParameter("@LeaveTime",entity.LeaveTime),
                new SqlParameter("@VisitDuration",entity.VisitDuration),
                new SqlParameter("@VisitNumber",entity.VisitNumber),
                new SqlParameter("@IsVisit",entity.IsVisit),
                new SqlParameter("@LastUpdateUserID",entity.LastUpdateUserID),
                new SqlParameter("@LastUpdateUser",entity.LastUpdateUser),
                new SqlParameter("@LastUpdateTime",entity.LastUpdateTime),
                new SqlParameter("@SbuyCarBrandID",entity.SbuyCarBrandID),
                new SqlParameter("@SbuyCarSeriesID",entity.SbuyCarSeriesID),
                new SqlParameter("@SbuyCarModelID",entity.SbuyCarModelID),
                new SqlParameter("@OrderNumber",entity.OrderNumber),
                new SqlParameter("@KnockdownPrice",entity.KnockdownPrice),
                new SqlParameter("@PlaceOrderTime",entity.PlaceOrderTime),
                new SqlParameter("@PicupcarTime",entity.PicupcarTime),
                new SqlParameter("@GiveupCauseID",entity.GiveupCauseID),
                new SqlParameter("@FailureCauseAnalyze",entity.FailureCauseAnalyze),
                new SqlParameter("@SystemRemark",entity.SystemRemark),
                new SqlParameter("@CheckStatus",entity.CheckStatus),
                new SqlParameter("@LurkStatus",entity.LurkStatus),
                new SqlParameter("@DelState",entity.DelState),
                new SqlParameter("@PostTime",entity.PostTime)
            };
            return DataConvert.SafeInt(SqlHelper.ExecuteNonQuery(_con, CommandType.Text, sql, p));
        }
Beispiel #12
0
 public abstract int UpdateCustomerLastConnect(CustomerInfo entity);
Beispiel #13
0
 public abstract int UpdateCustomer(CustomerInfo entity);
Beispiel #14
0
 public abstract int AddCustomer(CustomerInfo entity);
Beispiel #15
0
        public static CustomerInfo PopulateCustomerInfo(IDataReader reader)
        {
            CustomerInfo entity = new CustomerInfo()
            {
                ID                   = (int)reader["ID"],
                Name                 = reader["Name"] as string,
                Phone                = reader["Phone"] as string,
                PhoneVest            = reader["PhoneVest"] as string,
                BackupPhone          = reader["BackupPhone"] as string,
                ProvinceID           = (int)reader["ProvinceID"],
                CityID               = (int)reader["CityID"],
                DistrictID           = (int)reader["DistrictID"],
                Address              = reader["Address"] as string,
                WeixinAccount        = reader["WeixinAccount"] as string,
                InfoTypeID           = (int)reader["InfoTypeID"],
                InfoSourceID         = (int)reader["InfoSourceID"],
                PaymentWayID         = (int)reader["PaymentWayID"],
                IbuyCarBrandID       = (int)reader["IbuyCarBrandID"],
                IbuyCarSeriesID      = (int)reader["IbuyCarSeriesID"],
                IbuyCarModelID       = (int)reader["IbuyCarModelID"],
                IbuyTimeID           = (int)reader["IbuyTimeID"],
                QuotedpriceInfo      = reader["QuotedpriceInfo"] as string,
                PromotionInfo        = reader["PromotionInfo"] as string,
                RemarkInfo           = reader["RemarkInfo"] as string,
                CreateUserID         = (int)reader["CreateUserID"],
                CreateUser           = reader["CreateUser"] as string,
                CreateTime           = reader["CreateTime"] as string,
                OwnerID              = (int)reader["OwnerID"],
                Owner                = reader["Owner"] as string,
                OwnerPowerGroupID    = (int)reader["OwnerPowerGroupID"],
                CustomerSex          = (int)reader["CustomerSex"],
                TracktagID           = reader["TracktagID"] as string,
                Tracktag             = reader["Tracktag"] as string,
                CustomerStatusSource = (int)reader["CustomerStatusSource"],
                CustomerStatus       = (int)reader["CustomerStatus"],
                LastCustomerLevelID  = (int)reader["LastCustomerLevelID"],
                LastConnectwayID     = (int)reader["LastConnectwayID"],
                LastConnectTime      = reader["LastConnectTime"] as string,
                LastConnectUserID    = (int)reader["LastConnectUserID"],
                LastConnectUser      = reader["LastConnectUser"] as string,
                LastConnectDetail    = reader["LastConnectDetail"] as string,
                ReservationTime      = reader["ReservationTime"] as string,
                VisitTime            = reader["VisitTime"] as string,
                LeaveTime            = reader["LeaveTime"] as string,
                VisitDuration        = (int)reader["VisitDuration"],
                VisitNumber          = (int)reader["VisitNumber"],
                IsVisit              = (int)reader["IsVisit"],
                ConnectTimes         = (int)reader["ConnectTimes"],
                LastUpdateUserID     = (int)reader["LastUpdateUserID"],
                LastUpdateUser       = reader["LastUpdateUser"] as string,
                LastUpdateTime       = reader["LastUpdateTime"] as string,
                SbuyCarBrandID       = (int)reader["SbuyCarBrandID"],
                SbuyCarSeriesID      = (int)reader["SbuyCarSeriesID"],
                SbuyCarModelID       = (int)reader["SbuyCarModelID"],
                OrderNumber          = reader["OrderNumber"] as string,
                KnockdownPrice       = reader["KnockdownPrice"] as string,
                PlaceOrderTime       = reader["PlaceOrderTime"] as string,
                PicupcarTime         = reader["PicupcarTime"] as string,
                GiveupCauseID        = (int)reader["GiveupCauseID"],
                FailureCauseAnalyze  = reader["FailureCauseAnalyze"] as string,
                MarketDirectorID     = (int)reader["MarketDirectorID"],
                MarketDirector       = reader["MarketDirector"] as string,
                DCCDirectorID        = (int)reader["DCCDirectorID"],
                DCCDirector          = reader["DCCDirector"] as string,
                ExhibitionDirectorID = (int)reader["ExhibitionDirectorID"],
                ExhibitionDirector   = reader["ExhibitionDirector"] as string,
                DirectorID           = (int)reader["DirectorID"],
                Director             = reader["Director"] as string,
                SystemRemark         = reader["SystemRemark"] as string,
                LurkStatus           = (int)reader["LurkStatus"],
                CheckStatus          = (int)reader["CheckStatus"],
                DelState             = (bool)reader["DelState"] ? 1 : 0,
                PostTime             = reader["PostTime"] as string,
                CorporationID        = (int)reader["CorporationID"]
            };

            return(entity);
        }
 public override void UpdateCustomerPhoneVest(CustomerInfo entity)
 {
     string sql = "UPDATE ComOpp_Customer SET [PhoneVest] = @PhoneVest WHERE [ID] = @ID";
     SqlParameter[] p =
     {
         new SqlParameter("@PhoneVest",entity.PhoneVest),
         new SqlParameter("@ID",entity.ID)
     };
     SqlHelper.ExecuteNonQuery(_con, CommandType.Text, sql, p);
 }
Beispiel #17
0
        public int Move(CustomerInfo entity)
        {
            int result = 0;
            CustomerMoveRecordInfo minfo = new CustomerMoveRecordInfo()
            {
                CustomerID = entity.ID,
                CustomerStatus = entity.CustomerStatus,
                CustomerStatusSource = entity.CustomerStatus,
                OwnerID = entity.OwnerID,
                Owner = entity.Owner,
                LastUpdateUserID = entity.LastUpdateUserID,
                LastUpdateUser = entity.LastUpdateUser,
                CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
                SystemMsg = DateTime.Today.ToString("yyyy年MM月dd日") + "线索批量移交"
            };

            CustomerMoveRecords.Instance.Add(minfo);

            entity.SystemRemark = minfo.SystemMsg;

            result = CommonDataProvider.Instance().UpdateCustomer(entity);

            if (result > 0)
            {
                RefreshCustomerCache(entity);
            }

            return result;
        }
Beispiel #18
0
        private void CommitData()
        {
            int result = 0;
            CustomerInfo entity = new CustomerInfo();
            int id = GetInt("id");
            if (id > 0 && CurrentCustomerInfo != null)
            {
                entity = Customers.Instance.GetCustomerByID(id);
                entity.LastUpdateUserID = AdminID;
                entity.LastUpdateUser = Admin.Realname;
                entity.LastUpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                FillData(entity);
                if (Action == "提交到导入|集客")
                {
                    entity.CustomerStatusSource = entity.CustomerStatus;
                    entity.CustomerStatus = (int)CustomerStatus.导入_集客;
                    entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                    entity.CheckStatus = 0;
                    entity.LurkStatus = 0;
                }
                if (Action == "提交到清洗|邀约")
                {
                    entity.CustomerStatusSource = entity.CustomerStatus;
                    entity.CustomerStatus = (int)CustomerStatus.清洗_邀约;
                    entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                    entity.CheckStatus = 0;
                    entity.LurkStatus = 0;
                }
                else if (Action == "提交到到店|洽谈")
                {
                    entity.CustomerStatusSource = entity.CustomerStatus;
                    entity.CustomerStatus = (int)CustomerStatus.到店_洽谈;
                    entity.ReservationTime = Request["form[invitetime]"];
                    entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                }
                else if (Action == "编辑到店|洽谈")
                {
                    entity.VisitTime = Request["form[arrivetime]"];
                    entity.LeaveTime = Request["form[leavetime]"];
                    entity.VisitDuration = DataConvert.SafeInt(Request["form[reception]"]);
                    entity.VisitNumber = DataConvert.SafeInt(Request["form[arrivepeoplenum]"]);
                    if(entity.IsVisit == 0) entity.ReservationTime = Request["form[invitetime]"];
                    entity.IsVisit = 1;
                }
                else if (Action == "提交到追踪|促成")
                {
                    entity.CustomerStatusSource = entity.CustomerStatus;
                    entity.CustomerStatus = (int)CustomerStatus.追踪_促成;
                    entity.VisitTime = Request["form[arrivetime]"];
                    entity.LeaveTime = Request["form[leavetime]"];
                    entity.VisitDuration = DataConvert.SafeInt(Request["form[reception]"]);
                    entity.VisitNumber = DataConvert.SafeInt(Request["form[arrivepeoplenum]"]);
                    entity.IsVisit = 1;
                    entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                }
                else if (Action == "提交到预订|成交")
                {
                    entity.CustomerStatusSource = entity.CustomerStatus;
                    entity.CustomerStatus = (int)CustomerStatus.预订_成交;
                    entity.PlaceOrderTime = Request["form[endtime]"];
                    entity.KnockdownPrice = Request["form[strikeprice]"];
                    entity.OrderNumber = Request["form[ordernum]"];
                    entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                }
                else if (Action == "编辑预订|成交")
                {
                    entity.PlaceOrderTime = Request["form[endtime]"];
                    entity.KnockdownPrice = Request["form[strikeprice]"];
                    entity.OrderNumber = Request["form[ordernum]"];
                }
                else if (Action == "提交到提车|回访")
                {
                    entity.CustomerStatusSource = entity.CustomerStatus;
                    entity.CustomerStatus = (int)CustomerStatus.提车_回访;
                    entity.PlaceOrderTime = Request["form[endtime]"];
                    entity.KnockdownPrice = Request["form[strikeprice]"];
                    entity.OrderNumber = Request["form[ordernum]"];
                    entity.PicupcarTime = Request["form[delivertime]"];
                    entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                }
                else if (Action == "编辑提车|回访")
                {
                    entity.PlaceOrderTime = Request["form[endtime]"];
                    entity.KnockdownPrice = Request["form[strikeprice]"];
                    entity.OrderNumber = Request["form[ordernum]"];
                    entity.PicupcarTime = Request["form[delivertime]"];
                }
                else if (Action == "提交到战败")
                {
                    entity.CustomerStatusSource = entity.CustomerStatus;
                    entity.CustomerStatus = (int)CustomerStatus.潜客_战败;
                    entity.GiveupCauseID = DataConvert.SafeInt(Request["form[giveupcause]"]);
                    entity.FailureCauseAnalyze = Request["form[failurereason]"];
                    entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                    entity.LurkStatus = 1;
                }
                else if (Action == "提交到转出|待审")
                {
                    entity.CustomerStatusSource = entity.CustomerStatus;
                    entity.CustomerStatus = (int)CustomerStatus.转出待审;
                    entity.CheckStatus = 1;
                }
                else if (Action == "提交到潜客|转出")
                {
                    if (entity.CustomerStatus != (int)CustomerStatus.转出待审)
                        entity.CustomerStatusSource = entity.CustomerStatus;
                    entity.CustomerStatus = (int)CustomerStatus.潜客_转出;
                    entity.LurkStatus = 1;
                    entity.CheckStatus = 0;
                }

                result = Customers.Instance.Update(entity);
            }
            else if(id == 0)
            {
                entity.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                entity.CreateUserID = AdminID;
                entity.CreateUser = Admin.Realname;
                entity.LastUpdateUserID = AdminID;
                entity.LastUpdateUser = Admin.Realname;
                entity.LastUpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                entity.CorporationID = GetInt("corpid");
                entity.SystemRemark = DateTime.Today.ToString("yyyy年MM月dd日") + "线索录入";
                FillData(entity);

                if (Action == "新增到店|洽谈")
                {
                    entity.VisitTime = Request["form[arrivetime]"];
                    entity.VisitNumber = DataConvert.SafeInt(Request["form[arrivepeoplenum]"]);
                    entity.IsVisit = 1;
                }

                result = Customers.Instance.Add(entity);
            }

            Response.Clear();
            Response.Write(result == 0 ? "n" : "y");
            Response.End();
        }
Beispiel #19
0
        public int Update(CustomerInfo entity)
        {
            int result = 0;
            CustomerInfo entityold = GetCustomerByID(entity.ID);

            if (entity.CustomerStatus != entityold.CustomerStatus || entity.OwnerID != entityold.OwnerID)
            {
                CustomerMoveRecordInfo minfo = new CustomerMoveRecordInfo()
                {
                    CustomerID = entity.ID,
                    CustomerStatus = entity.CustomerStatus,
                    CustomerStatusSource = entityold.CustomerStatus,
                    OwnerID = entity.OwnerID,
                    Owner = entity.Owner,
                    LastUpdateUserID = entity.LastUpdateUserID,
                    LastUpdateUser = entity.LastUpdateUser,
                    CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm")
                };
                if (entity.CustomerStatus == (int)CustomerStatus.潜客_战败)
                    minfo.SystemMsg = DateTime.Today.ToString("yyyy年MM月dd日") + "战败";
                else if (entity.CustomerStatus == (int)CustomerStatus.潜客_转出)
                    minfo.SystemMsg = DateTime.Today.ToString("yyyy年MM月dd日") + "由" + entityold.CustomerStatusName + "转出";
                else if (entity.CustomerStatus != entityold.CustomerStatus)
                    minfo.SystemMsg = DateTime.Today.ToString("yyyy年MM月dd日") + "由" + entityold.CustomerStatusName + "转入";
                else if (entity.OwnerID != entityold.OwnerID)
                    minfo.SystemMsg = DateTime.Today.ToString("yyyy年MM月dd日") + "变更线索所有人";

                CustomerMoveRecords.Instance.Add(minfo);

                if (entity.CustomerStatus != (int)CustomerStatus.潜客_战败 && entity.CustomerStatus != (int)CustomerStatus.潜客_转出)
                    entity.SystemRemark = minfo.SystemMsg;
                if (entity.OwnerID != entityold.OwnerID)
                {
                    AdminInfo owner = Admins.Instance.GetAdmin(entity.OwnerID);
                    entity.OwnerPowerGroupID = owner.PowerGroupID;
                }
            }

            result = CommonDataProvider.Instance().UpdateCustomer(entity);

            if (result > 0)
            {
                RefreshCustomerCache(entity);
            }

            return result;
        }
Beispiel #20
0
 private void FillData(CustomerInfo entity)
 {
     entity.Name = Request["form[uname]"];
     entity.Phone = Request["form[phone]"];
     entity.BackupPhone = Request["form[sparephone]"];
     entity.ProvinceID = DataConvert.SafeInt(Request["form[province]"]);
     entity.CityID = DataConvert.SafeInt(Request["form[city]"]);
     entity.DistrictID = DataConvert.SafeInt(Request["form[district]"]);
     entity.Address = Request["form[address]"];
     entity.WeixinAccount = Request["form[weixin]"];
     entity.InfoTypeID = DataConvert.SafeInt(Request["form[infotype]"]);
     entity.InfoSourceID = DataConvert.SafeInt(Request["form[infosource]"]);
     entity.PaymentWayID = DataConvert.SafeInt(Request["form[paymentway]"]);
     if (Action == "提交到预订|成交" || Action == "编辑预订|成交" || Action == "提交到提车|回访" || Action == "编辑提车|回访")
     {
         entity.SbuyCarBrandID = DataConvert.SafeInt(Request["form[brand]"]);
         entity.SbuyCarSeriesID = DataConvert.SafeInt(Request["form[series]"]);
         entity.SbuyCarModelID = DataConvert.SafeInt(Request["form[spec]"]);
     }
     else
     {
         entity.IbuyCarBrandID = DataConvert.SafeInt(Request["form[brand]"]);
         entity.IbuyCarSeriesID = DataConvert.SafeInt(Request["form[series]"]);
         entity.IbuyCarModelID = DataConvert.SafeInt(Request["form[spec]"]);
     }
     entity.IbuyTimeID = DataConvert.SafeInt(Request["form[ibuytime]"]);
     entity.QuotedpriceInfo = Request["form[price]"];
     entity.PromotionInfo = Request["form[slogan]"];
     entity.RemarkInfo = Request["form[content]"];
     entity.OwnerID = DataConvert.SafeInt(Request["form[owneruid]"]);
     entity.Owner = new Regex("\\([\\s\\S]+\\)").Replace(Request["form[owner]"],string.Empty);
     entity.CustomerSex = DataConvert.SafeInt(Request["form[sex]"]);
     entity.TracktagID = Request["form[tracktag]"];
     entity.Tracktag = Request["form[tracktagname]"];
     entity.CustomerStatus = DataConvert.SafeInt(Request["form[customerstatus]"]);
     if (GetString("action") == "recover")
     {
         entity.DelState = 0;
         entity.CustomerStatusSource = entity.CustomerStatus;
         entity.CustomerStatus = (int)CustomerStatus.清洗_邀约;
         entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
         entity.CheckStatus = 0;
         entity.LurkStatus = 0;
     }
     AdminInfo ownerinfo = Admins.Instance.GetAdmin(entity.OwnerID);
     if(ownerinfo != null)
         entity.OwnerPowerGroupID = ownerinfo.PowerGroupID;
 }
Beispiel #21
0
 /// <summary>
 /// 更新客户号码归属地
 /// </summary>
 /// <param name="entity"></param>
 public void UpdateCustomerPhoneVest(CustomerInfo entity)
 {
     CommonDataProvider.Instance().UpdateCustomerPhoneVest(entity);
 }
Beispiel #22
0
 public abstract void UpdateCustomerPhoneVest(CustomerInfo entity);
Beispiel #23
0
 /// <summary>
 /// 更新客户号码归属地
 /// </summary>
 /// <param name="entity"></param>
 public void UpdateCustomerPhoneVest(CustomerInfo entity)
 {
     CommonDataProvider.Instance().UpdateCustomerPhoneVest(entity);
 }
Beispiel #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPost())
            {
                int corpid = GetInt("corpid");
                int state = GetInt("state");
                HttpPostedFile file = Request.Files[0];
                DataTable t = ImportDataTableFromExcel(file.InputStream, 0, 0);

                List<InfoTypeInfo> infotypelist = InfoTypes.Instance.GetListByCorpid(corpid, true);
                List<InfoSourceInfo> infosourcelist = InfoSources.Instance.GetListByCorpid(corpid, true);
                List<CarBrandInfo> brandlist = Cars.Instance.GetCarBrandList(true);
                List<AdminInfo> adminlist = Admins.Instance.GetAllAdmins();

                foreach (DataRow row in t.Rows)
                {
                    string customername = row["客户姓名"].ToString();
                    string sex = row["性别"].ToString();
                    string phone = row["客户电话"].ToString();
                    string backupphone = row["备用电话"].ToString();
                    string weixin = row["微信号"].ToString();
                    string infotype = row["信息类型"].ToString();
                    string infosource = row["信息来源"].ToString();
                    string ibuybrand = row["拟购品牌"].ToString();
                    string ibuyseries = row["拟购车系"].ToString();
                    string ibuymodel = row["拟购车型"].ToString();
                    string remark = row["备注"].ToString();
                    string owner = row["线索所有人"].ToString();
                    if (string.IsNullOrEmpty(customername) || string.IsNullOrEmpty(phone)) continue;

                    Regex rphone = new Regex(@"^1[\d]{10}$");
                    if (!rphone.IsMatch(phone)) continue;

                    if (Customers.Instance.GetCustomerByPhone(phone, corpid) == null)
                    {
                        CustomerInfo entity = new CustomerInfo()
                        {
                            Name = customername,
                            Phone = phone,
                            BackupPhone = backupphone,
                            WeixinAccount = weixin,
                            RemarkInfo = remark,
                            SystemRemark = DateTime.Today.ToString("yyyy年MM月dd日") + "导入线索"
                        };
                        switch (sex)
                        {
                            case "男":
                                entity.CustomerSex = 1;
                                break;
                            case "女":
                                entity.CustomerSex = 2;
                                break;
                            default:
                                entity.CustomerSex = 0;
                                break;
                        }
                        entity.InfoTypeID = infotypelist.Exists(l => l.Name.ToLower() == infotype.ToLower().Trim()) ? infotypelist.Find(l => l.Name.ToLower() == infotype.ToLower().Trim()).ID : 0;
                        entity.InfoSourceID = infosourcelist.Exists(l => l.Name.ToLower() == infosource.ToLower().Trim()) ? infosourcelist.Find(l => l.Name.ToLower() == infosource.ToLower().Trim()).ID : 0;
                        entity.IbuyCarBrandID = brandlist.Exists(l => l.Name.ToLower() == ibuybrand.ToLower().Trim()) ? brandlist.Find(l => l.Name.ToLower() == ibuybrand.ToLower().Trim()).ID : 0;
                        if (entity.IbuyCarBrandID > 0)
                        {
                            List<CarSeriesInfo> serieslist = Cars.Instance.GetCarSeriesListByBrandID(entity.IbuyCarBrandID, true);
                            entity.IbuyCarSeriesID = serieslist.Exists(l => l.Name.ToLower() == ibuyseries.ToLower().Trim()) ? serieslist.Find(l => l.Name.ToLower() == ibuyseries.ToLower().Trim()).ID : 0;
                        }
                        else
                            entity.IbuyCarSeriesID = 0;
                        if (entity.IbuyCarSeriesID > 0)
                        {
                            List<CarModelInfo> modellist = Cars.Instance.GetCarModelListBySeriesID(entity.IbuyCarSeriesID, true);
                            entity.IbuyCarModelID = modellist.Exists(l => l.Name.ToLower() == ibuymodel.ToLower().Trim()) ? modellist.Find(l => l.Name.ToLower() == ibuymodel.ToLower().Trim()).ID : 0;
                        }
                        else
                            entity.IbuyCarModelID = 0;

                        entity.OwnerID = AdminID;
                        entity.Owner = Admin.Realname;
                        entity.OwnerPowerGroupID = Admin.PowerGroupID;
                        if (!string.IsNullOrEmpty(owner))
                        {
                            AdminInfo ownerinfo = adminlist.Find(l => l.CorporationID == corpid && l.Realname == owner);
                            if (ownerinfo != null)
                            {
                                entity.OwnerID = ownerinfo.ID;
                                entity.Owner = ownerinfo.Realname;
                                entity.OwnerPowerGroupID = ownerinfo.PowerGroupID;
                            }
                        }

                        entity.CustomerStatus = state;
                        entity.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                        entity.CreateUserID = AdminID;
                        entity.CreateUser = Admin.Realname;
                        entity.LastUpdateUserID = AdminID;
                        entity.LastUpdateUser = Admin.Realname;
                        entity.LastUpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                        entity.PostTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                        entity.CorporationID = corpid;

                        Customers.Instance.Add(entity);
                    }
                }

                WriteSuccessMessage("操作完成", "导入数据成功!", "~/chance/chancemg.aspx");
            }
        }