示例#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);
        }
示例#2
0
        public static void AutoMatch(int channelId, int codeId, int clientId, DateTime startDate, DateTime endDate)
        {
            SPChannelWrapper channel = SPChannelWrapper.FindById(channelId);

            SPCodeWrapper code = SPCodeWrapper.FindById(codeId);

            SPSClientWrapper client = SPSClientWrapper.FindById(clientId);

            List <SPRecordWrapper> records = SPRecordWrapper.QueryRecord(channel, code, client, SPRecordWrapper.DayReportType_AllUp, startDate, endDate, new List <QueryFilter>(), "", false);

            foreach (SPRecordWrapper record in records)
            {
                record.ReAutoMatch();
            }
        }
        public static List <SPCodeWrapper> GetAllCodeByClient(SPSClientWrapper client)
        {
            List <SPClientCodeRelationWrapper> spClientCodeRelations = FindAllByClientID(client);

            List <SPCodeWrapper> spCodes = new List <SPCodeWrapper>();

            foreach (SPClientCodeRelationWrapper spClientCodeRelationWrapper in spClientCodeRelations)
            {
                if (!spCodes.Exists(p => (p.Id == spClientCodeRelationWrapper.ClientID.Id)))
                {
                    spCodes.Add(spClientCodeRelationWrapper.CodeID);
                }
            }

            return(spCodes);
        }
        public static DataSet QueryClientInvoiceReport(DateTime?startDate, DateTime?endDate, int?clientID, int?codeID)
        {
            DataSet ds = businessProxy.QueryClientInvoiceReport(startDate, endDate, clientID, codeID);

            ds.Tables[0].Columns.Add(new DataColumn("ClientName"));
            ds.Tables[0].Columns.Add(new DataColumn("MoName"));
            ds.Tables[0].Columns.Add(new DataColumn("Price", typeof(decimal)));

            ds.AcceptChanges();

            foreach (DataRow dataRow in ds.Tables[0].Rows)
            {
                dataRow["ClientName"] = SPSClientWrapper.FindById((int)dataRow["ClientId"]).Name;
                dataRow["MoName"]     = SPCodeWrapper.FindById((int)dataRow["CodeID"]).MoCode;
                dataRow["Price"]      = SPCodeWrapper.FindById((int)dataRow["CodeID"]).Price;
            }

            ds.AcceptChanges();

            return(ds);
        }
 public static List <SPAdReportWrapper> FindAllBySPClientID(SPSClientWrapper sPClientID)
 {
     return(ConvertToWrapperList(businessProxy.FindAllBySPClientID(sPClientID.Entity)));
 }
 public static List <SPAdReportWrapper> FindAllByOrderByAndFilterAndSPClientID(string orderByColumnName, bool isDesc, SPSClientWrapper sPClientID, PageQueryParams pageQueryParams)
 {
     return(ConvertToWrapperList(businessProxy.FindAllByOrderByAndFilterAndSPClientID(orderByColumnName, isDesc, sPClientID.Entity, pageQueryParams)));
 }
示例#7
0
 public static List <SPRecordWrapper> FindAllSendRecordByClientAndCodeAndDateRange(SPSClientWrapper client, SPCodeWrapper code, DateTime startDate, DateTime endDate)
 {
     return(ConvertToWrapperList(businessProxy.FindAllSendRecordByClientAndCodeAndDateRange(client.Entity, code.Entity, startDate, endDate)));
 }
示例#8
0
        public static List <SPRecordWrapper> QueryRecord(SPChannelWrapper channel, SPCodeWrapper code, SPSClientWrapper client, string dataType, DateTime?startDate, DateTime?endDate, List <QueryFilter> filters, string orderByColumnName, bool isDesc)
        {
            SPChannelEntity channelEntity = null;

            if (channel != null)
            {
                channelEntity = channel.Entity;
            }

            SPCodeEntity codeEntity = null;

            if (code != null)
            {
                codeEntity = code.Entity;
            }

            SPSClientEntity clientEntity = null;

            if (client != null)
            {
                clientEntity = client.Entity;
            }

            return(ConvertToWrapperList(businessProxy.QueryRecord(channelEntity, codeEntity, clientEntity, dataType, startDate, endDate, filters, orderByColumnName, isDesc)));
        }
 public static List <SPAdReportWrapper> QueryReport(DateTime startDate, DateTime endDate, SPSClientWrapper client)
 {
     return(SPAdReportWrapper.ConvertToWrapperList(businessProxy.QueryReport(startDate, endDate, client.Entity)));
 }
示例#10
0
 public static void RemoveAdAssigned(SPAdPackWrapper client, SPSClientWrapper adPack)
 {
     businessProxy.RemoveAdAssigned(client.Entity, adPack.Entity);
 }
示例#11
0
 public static void ClientAssignedAdPack(SPSClientWrapper client, SPAdPackWrapper adPack, decimal clientPrice)
 {
     businessProxy.ClientAssignedAdPack(client.Entity, adPack.Entity, clientPrice);
 }
示例#12
0
 public static SPSClientWrapper GetAdPackAssignedClient(SPAdPackWrapper spAd)
 {
     return(SPSClientWrapper.ConvertEntityToWrapper(businessProxy.GetAdPackAssignedClient(spAd.Entity)));
 }
示例#13
0
 public static List <SPAdPackWrapper> FindAllCLientAssignedAdPack(SPSClientWrapper client)
 {
     return(SPAdPackWrapper.ConvertToWrapperList(businessProxy.FindAllCLientAssignedAdPack(client.Entity)));
 }
 public static List <SPDayReportWrapper> CaculateReport(DateTime reportDate, SPSClientWrapper clientWrapper)
 {
     return(ConvertNoDbDataToWrapperList(businessProxy.CaculateReport(reportDate.Date, clientWrapper.Entity)));
 }
示例#15
0
        public static List <SPCodeWrapper> GetAvaiableCodeForClient(SPChannelWrapper spChannelWrapper, SPSClientWrapper spsClientId)
        {
            List <SPCodeWrapper> spCodes = FindAllByChannelID(spChannelWrapper);

            return
                (spCodes.FindAll(
                     p =>
                     (!p.IsDiable && p.MOType != DictionaryConst.Dictionary_CodeType_CodeDefault_Key && ((p.ClientCodeRelation == null) || (p.ClientCodeRelation != null &&
                                                                                                                                            p.ClientCodeRelation.ClientID.Id != spsClientId.Id)))));
        }