Esempio n. 1
0
        public void ChangeClient(SPSClientWrapper client,
                                 DateTime changeDate,
                                 int changeUserID,
                                 decimal price,
                                 decimal interceptRate,
                                 bool syncData,
                                 int sycnNotInterceptCount,
                                 string sycnRetryTimes,
                                 SPSDataSycnSettingWrapper dataSycnSetting)
        {
            //如果存在分配客户,终止上次指令分配记录。
            if (this.ClientCodeRelation != null)
            {
                if (this.ClientCodeRelation.ClientID.Id == client.Id)
                {
                    return;
                }

                this.ClientCodeRelation.IsEnable = false;
                this.ClientCodeRelation.EndDate  = changeDate;

                SPClientCodeRelationWrapper.Update(this.ClientCodeRelation);
            }

            SPClientCodeRelationWrapper obj = new SPClientCodeRelationWrapper();

            if (syncData)
            {
                SPSDataSycnSettingWrapper.Save(dataSycnSetting);
            }

            obj.Price         = price;
            obj.InterceptRate = interceptRate;
            obj.UseClientDefaultSycnSetting = false;
            obj.SyncData       = syncData;
            obj.ClientID       = client;
            obj.CodeID         = this;
            obj.SycnRetryTimes = sycnRetryTimes;
            if (obj.SyncData)
            {
                obj.SyncDataSetting = dataSycnSetting;
            }
            obj.StartDate             = changeDate;
            obj.EndDate               = null;
            obj.IsEnable              = true;
            obj.SycnNotInterceptCount = sycnNotInterceptCount;
            obj.CreateBy              = changeUserID;
            obj.CreateAt              = changeDate;
            obj.LastModifyBy          = changeUserID;
            obj.LastModifyAt          = changeDate;


            SPClientCodeRelationWrapper.Save(obj);
        }
 public static List <SPSClientWrapper> FindAllBySyncDataSetting(SPSDataSycnSettingWrapper syncDataSetting)
 {
     return(ConvertToWrapperList(businessProxy.FindAllBySyncDataSetting(syncDataSetting.Entity)));
 }
 public static List <SPSClientWrapper> FindAllByOrderByAndFilterAndSyncDataSetting(string orderByColumnName, bool isDesc, SPSDataSycnSettingWrapper syncDataSetting, PageQueryParams pageQueryParams)
 {
     return(ConvertToWrapperList(businessProxy.FindAllByOrderByAndFilterAndSyncDataSetting(orderByColumnName, isDesc, syncDataSetting.Entity, pageQueryParams)));
 }