Esempio n. 1
0
        public decimal CaculteActualInterceptRate(SPClientCodeRelationEntity clientCodeRelation, DateTime date)
        {
            string sql = "SELECT  IsIntercept,COUNT(*) as RCount FROM [SPRecord] with(nolock) where CreateDate>@startDate and CreateDate<@endDate and ClientCodeRelationID=@ClientCodeRelationID and IsStatOK=1 group by IsIntercept";

            DbParameters dbParameters = this.CreateNewDbParameters();

            dbParameters.AddWithValue("startDate", date.Date);

            dbParameters.AddWithValue("endDate", date.Date.AddDays(1));

            dbParameters.AddWithValue("ClientCodeRelationID", clientCodeRelation.Id);

            DataTable dt = this.ExecuteDataSet(sql, CommandType.Text, dbParameters).Tables[0];

            object result = dt.Compute("Sum(RCount)", "");

            int totalCount = 0;

            if (result != System.DBNull.Value)
            {
                totalCount = Convert.ToInt32(result);
            }

            int totalInterceptCount = 0;

            object result2 = dt.Compute("Sum(RCount)", " IsIntercept =1 ");

            if (result2 != System.DBNull.Value)
            {
                totalInterceptCount = Convert.ToInt32(result2);
            }

            if (totalCount <= 0)
            {
                return(Decimal.Zero);
            }

            return((decimal)totalInterceptCount / (decimal)totalCount);
        }
 public decimal CaculteActualInterceptRate(SPClientCodeRelationEntity clientCodeRelation, DateTime date)
 {
     return(this.AdoNetDb.CaculteActualInterceptRate(clientCodeRelation, date));
 }
 public List <SPRecordEntity> FindAllByClientCodeRelationID(SPClientCodeRelationEntity _clientCodeRelationID)
 {
     return(this.SelfDataObj.GetList_By_ClientCodeRelationID_SPClientCodeRelationEntity(_clientCodeRelationID));
 }
 public List <SPRecordEntity> FindAllByOrderByAndFilterAndClientCodeRelationID(string orderByColumnName, bool isDesc, SPClientCodeRelationEntity _clientCodeRelationID, PageQueryParams pageQueryParams)
 {
     return(this.SelfDataObj.GetPageList_By_ClientCodeRelationID_SPClientCodeRelationEntity(orderByColumnName, isDesc, _clientCodeRelationID, pageQueryParams));
 }
Esempio n. 5
0
        public List <SPRecordEntity> GetPageList_By_ClientCodeRelationID_SPClientCodeRelationEntity(string orderByColumnName, bool isDesc, SPClientCodeRelationEntity fkentity, PageQueryParams pageQueryParams)
        {
            NHibernateDynamicQueryGenerator <SPRecordEntity> dynamicQueryGenerator = this.GetNewQueryBuilder();

            dynamicQueryGenerator.AddWhereClause(PROPERTY_CLIENTCODERELATIONID.Eq(fkentity));

            AddDefaultOrderByToQueryGenerator(orderByColumnName, isDesc, dynamicQueryGenerator);

            return(FindListByPageByQueryBuilder(dynamicQueryGenerator, pageQueryParams));
        }
Esempio n. 6
0
        public List <SPRecordEntity> GetList_By_ClientCodeRelationID_SPClientCodeRelationEntity(SPClientCodeRelationEntity fkentity)
        {
            NHibernateDynamicQueryGenerator <SPRecordEntity> dynamicQueryGenerator = this.GetNewQueryBuilder();

            dynamicQueryGenerator.AddWhereClause(PROPERTY_CLIENTCODERELATIONID.Eq(fkentity));

            return(this.FindListByQueryBuilder(dynamicQueryGenerator));
        }
Esempio n. 7
0
        public void QuickAddSPChannel(SPChannelEntity channelEntity, string pLinkId, string pMo, string pMobile, string pSpCode, string pCreateDate, string pProvince, string pCity, string pExtend1, string pExtend2, string pExtend3, string pExtend4, string pExtend5, string pExtend6, string pExtend7, string pExtend8, string pExtend9, string pExtend10)
        {
            if (string.IsNullOrEmpty(pLinkId))
            {
                throw new ArgumentNullException("pLinkId");
            }
            if (string.IsNullOrEmpty(pMo))
            {
                throw new ArgumentNullException("pMo");
            }
            if (string.IsNullOrEmpty(pLinkId))
            {
                throw new ArgumentNullException("pMobile");
            }
            if (string.IsNullOrEmpty(pMo))
            {
                throw new ArgumentNullException("pSpCode");
            }

            channelEntity.ChannelStatus = DictionaryConst.Dictionary_ChannelStatus_Run_Key;

            this.selfDataObject.Save(channelEntity);

            SPSClientEntity defaultClient = GetDefaultClient();

            SPCodeEntity defaultCode = SPCodeServiceProxy.NewDefaultCode(channelEntity);

            this.DataObjectsContainerIocID.SPCodeDataObjectInstance.Save(defaultCode);

            SPClientCodeRelationEntity spClientCodeRelation =
                SPClientCodeRelationServiceProxy.NewDefaultCode(defaultClient, defaultCode);

            this.DataObjectsContainerIocID.SPClientCodeRelationDataObjectInstance.Save(spClientCodeRelation);



            SPChannelParamsEntity cpLinkId = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pLinkId, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_LinkID_Key), DictionaryConst.Dictionary_SPField_LinkID_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpLinkId);

            SPChannelParamsEntity cpMo = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pMo, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_MO_Key), DictionaryConst.Dictionary_SPField_MO_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpMo);

            SPChannelParamsEntity cpMobile = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pMobile, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_Mobile_Key), DictionaryConst.Dictionary_SPField_Mobile_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpMobile);

            SPChannelParamsEntity cpSpCode = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pSpCode, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_SpNumber_Key), DictionaryConst.Dictionary_SPField_SpNumber_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpSpCode);

            if (!string.IsNullOrEmpty(pCreateDate))
            {
                SPChannelParamsEntity cpCreateDate = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pCreateDate, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_CreateDate_Key), DictionaryConst.Dictionary_SPField_CreateDate_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpCreateDate);
            }

            if (!string.IsNullOrEmpty(pProvince))
            {
                SPChannelParamsEntity cpProvince = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pProvince, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_Province_Key), DictionaryConst.Dictionary_SPField_Province_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpProvince);
            }

            if (!string.IsNullOrEmpty(pCity))
            {
                SPChannelParamsEntity cpCity = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pCity, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_City_Key), DictionaryConst.Dictionary_SPField_City_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpCity);
            }

            if (channelEntity.IsStateReport && !string.IsNullOrEmpty(channelEntity.StateReportParamName))
            {
                SPChannelParamsEntity cpStateReport = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, channelEntity.StateReportParamName, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_State_Key), DictionaryConst.Dictionary_SPField_State_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpStateReport);
            }

            if (!string.IsNullOrEmpty(pExtend1))
            {
                SPChannelParamsEntity cpExtend1 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend1, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField1_Key), DictionaryConst.Dictionary_SPField_ExtendField1_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend1);
            }


            if (!string.IsNullOrEmpty(pExtend2))
            {
                SPChannelParamsEntity cpExtend2 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend2, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField2_Key), DictionaryConst.Dictionary_SPField_ExtendField2_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend2);
            }

            if (!string.IsNullOrEmpty(pExtend3))
            {
                SPChannelParamsEntity cpExtend3 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend3, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField3_Key), DictionaryConst.Dictionary_SPField_ExtendField3_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend3);
            }

            if (!string.IsNullOrEmpty(pExtend4))
            {
                SPChannelParamsEntity cpExtend4 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend4, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField4_Key), DictionaryConst.Dictionary_SPField_ExtendField4_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend4);
            }

            if (!string.IsNullOrEmpty(pExtend5))
            {
                SPChannelParamsEntity cpExtend5 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend5, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField5_Key), DictionaryConst.Dictionary_SPField_ExtendField5_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend5);
            }

            if (!string.IsNullOrEmpty(pExtend6))
            {
                SPChannelParamsEntity cpExtend6 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend6, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField6_Key), DictionaryConst.Dictionary_SPField_ExtendField6_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend6);
            }

            if (!string.IsNullOrEmpty(pExtend7))
            {
                SPChannelParamsEntity cpExtend7 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend7, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField7_Key), DictionaryConst.Dictionary_SPField_ExtendField7_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend7);
            }

            if (!string.IsNullOrEmpty(pExtend8))
            {
                SPChannelParamsEntity cpExtend8 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend8, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField8_Key), DictionaryConst.Dictionary_SPField_ExtendField8_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend8);
            }

            if (!string.IsNullOrEmpty(pExtend9))
            {
                SPChannelParamsEntity cpExtend9 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend1, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField9_Key), DictionaryConst.Dictionary_SPField_ExtendField9_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend9);
            }

            if (!string.IsNullOrEmpty(pExtend10))
            {
                SPChannelParamsEntity cpExtend10 = SPChannelParamsServiceProxy.NewChannelParams(channelEntity, pExtend10, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_ExtendField10_Key), DictionaryConst.Dictionary_SPField_ExtendField10_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(cpExtend10);
            }


            SPChannelSycnParamsEntity linkidSycnParam = SPChannelSycnParamsServiceProxy.NewSPChannelSycnParams(channelEntity, DictionaryConst.Dictionary_SPField_LinkID_Key, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_LinkID_Key), DictionaryConst.Dictionary_SPField_LinkID_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

            this.DataObjectsContainerIocID.SPChannelSycnParamsDataObjectInstance.Save(linkidSycnParam);

            SPChannelSycnParamsEntity moSycnParam = SPChannelSycnParamsServiceProxy.NewSPChannelSycnParams(channelEntity, DictionaryConst.Dictionary_SPField_MO_Key, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_MO_Key), DictionaryConst.Dictionary_SPField_MO_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

            this.DataObjectsContainerIocID.SPChannelSycnParamsDataObjectInstance.Save(moSycnParam);

            SPChannelSycnParamsEntity mobileSycnParam = SPChannelSycnParamsServiceProxy.NewSPChannelSycnParams(channelEntity, DictionaryConst.Dictionary_SPField_Mobile_Key, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_Mobile_Key), DictionaryConst.Dictionary_SPField_Mobile_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

            this.DataObjectsContainerIocID.SPChannelSycnParamsDataObjectInstance.Save(mobileSycnParam);

            SPChannelSycnParamsEntity spCodeSycnParam = SPChannelSycnParamsServiceProxy.NewSPChannelSycnParams(channelEntity, DictionaryConst.Dictionary_SPField_SpNumber_Key, DictionaryConst.ParseSPFieldDictionaryKey(DictionaryConst.Dictionary_SPField_SpNumber_Key), DictionaryConst.Dictionary_SPField_SpNumber_Key, DictionaryConst.Dictionary_ChannelParamsType_Normal_Key);

            this.DataObjectsContainerIocID.SPChannelSycnParamsDataObjectInstance.Save(spCodeSycnParam);
        }