Esempio n. 1
0
 void initLazyLoaders(bool newOrder)
 {
     _OemInfoLoader = new LazyLoader <OEMInfo>(() => OEMService.QueryOEMById(OEMID.Value));
     if (newOrder)
     {
         _applyformLoader    = new EnumerableLazyLoader <BaseApplyform>();
         _operationLoader    = new EnumerableLazyLoader <Log.Domain.OrderLog>();
         _coordinationLoader = new EnumerableLazyLoader <Coordination>();
     }
     else
     {
         _applyformLoader = new EnumerableLazyLoader <BaseApplyform>(() => {
             return(ApplyformQueryService.QueryApplyforms(this.Id));
         });
         _operationLoader = new EnumerableLazyLoader <Log.Domain.OrderLog>(() => {
             return(LogService.QueryOrderLog(this.Id));
         });
         _coordinationLoader = new EnumerableLazyLoader <Coordination>(() => {
             return(CoordinationService.QueryOrderCoordinations(this.Id));
         });
     }
     _associateOrderLoader   = new LazyLoader <Order>();
     _distributionBillLoader = new LazyLoader <Service.Distribution.Domain.OrderBill>(() => {
         return(DistributionQueryService.QueryOrderBill(this.Id));
     });
 }
Esempio n. 2
0
        public static bool HasUsePlatformConfig(Guid oemId, ConfigUseType type)
        {
            if (oemId == Guid.Empty)
            {
                return(true);
            }

            var config = OEMAirlineConfigService.QueryConfig(oemId);

            if (config.Config.ContainsKey(type))
            {
                return(false);
            }
            else
            {
                if (OEMService.QueryOEMById(oemId).UseB3BConfig)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Esempio n. 3
0
 void initLazyLoaders()
 {
     _operationLoader    = new EnumerableLazyLoader <Log.Domain.OrderLog>(() => LogService.QueryApplyformLog(this.Id));
     _coordinationLoader = new EnumerableLazyLoader <Coordination>(() => CoordinationService.QueryApplyformCoordinations(this.Id));
     _orderLoader        = new LazyLoader <Order>(() => OrderQueryService.QueryOrder(this.OrderId));
     _purchaserLoader    = new LazyLoader <DataTransferObject.Organization.CompanyInfo>(() => Organization.CompanyService.GetCompanyDetail(this.PurchaserId));
     _providerLoader     = new LazyLoader <DataTransferObject.Organization.CompanyInfo>(() => Organization.CompanyService.GetCompanyDetail(this.ProviderId));
     _OemInfoLoader      = new LazyLoader <OEMInfo>(() => OEMService.QueryOEMById(OEMID.Value));
 }
Esempio n. 4
0
        /// <summary>
        /// 根据给出的OEM编号和类型,得到其Office号;
        /// </summary>
        /// <param name="oemId"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private static string GetOfficeNumber(Guid oemId, ConfigUseType type)
        {
            var config       = OEMAirlineConfigService.QueryConfig(oemId);
            var officeNumber = config.Config.ContainsKey(type) ? config.Config[type].Item2 : null;

            if (string.IsNullOrEmpty(officeNumber) && OEMService.QueryOEMById(oemId).UseB3BConfig)
            {
                config       = OEMAirlineConfigService.QueryConfig(Guid.Empty);
                officeNumber = config.Config.ContainsKey(type) ? config.Config[type].Item2 : null;
            }

            return(officeNumber);
        }
Esempio n. 5
0
        // 注意,这里的流量统计不是很准确,是否要在那边记录一个值,看指令是否执行;
        // 还有,清Q时结束的话,如果没有获取到,不会并发问题吧?

        /// <summary>
        /// 根据给出的OEM编号和类型,得到PID用户名;
        /// </summary>
        /// <param name="oemId"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private static string GetUserName(Guid oemId, ConfigUseType type)
        {
            // 取得配置信息;
            var config = OEMAirlineConfigService.QueryConfig(oemId);
            // 在配置信息中查找指定类型的配置,若存在,赋值,否则为空;
            var userName = config.Config.ContainsKey(type) ? config.Config[type].Item1 : null;

            if (userName == string.Empty)
            {
                return(null);
            }

            // 若用户名为空,但要求使用平台配置,则此时取得平台配置;
            if (userName == null && OEMService.QueryOEMById(oemId).UseB3BConfig)
            {
                config   = OEMAirlineConfigService.QueryConfig(Guid.Empty);
                userName = config.Config.ContainsKey(type) ? config.Config[type].Item1 : null;
            }

            return(userName);
        }
        private void initData()
        {
            string companyId = Request.QueryString["OemId"];

            if (!string.IsNullOrWhiteSpace(companyId))
            {
                var userNo            = Request.QueryString["UserNo"];
                var companyDetailInfo = OEMService.QueryOEMById(Guid.Parse(companyId));
                this.lblAuthorizationTime.Text     = companyDetailInfo.RegisterTime.ToString();
                this.lblUserNo.Text                = string.IsNullOrWhiteSpace(userNo) ? string.Empty : userNo;
                this.lblCompanyShortName.Text      = companyDetailInfo.Company.AbbreviateName;
                this.lblOemName.Text               = companyDetailInfo.SiteName;
                this.lblAuthorizationDomain.Text   = companyDetailInfo.DomainName;
                this.lblAuthorizationStatus.Text   = companyDetailInfo.EffectTime >= DateTime.Now ? "正常" : "失效";
                this.lblAuthorizationOperator.Text = companyDetailInfo.OperatorAccount;
                this.lblAuthorizationDeadline.Text = companyDetailInfo.EffectTime.Value.ToString("yyyy-MM-dd");
                this.lblAuthorizationDeposit.Text  = companyDetailInfo.AuthCashDeposit.TrimInvaidZero();
                var companyInfo = CompanyService.GetCompanyDetail(companyDetailInfo.OperatorAccount);
                hfdOperatorId.Value = companyInfo.CompanyId.ToString();
                hfdCompayId.Value   = companyDetailInfo.CompanyId.ToString();
            }
        }
        private void initData(string oemId)
        {
            lblOperator.Text = "修改";
            insert.Visible   = false;
            update.Visible   = true;
            OEMInfo distributionOEM = OEMService.QueryOEMById(Guid.Parse(oemId));

            if (distributionOEM != null)
            {
                txtOemName.Text               = distributionOEM.SiteName;
                txtAuthorizationDomain.Text   = distributionOEM.DomainName;
                txtAuthorizationDeadline.Text = distributionOEM.EffectTime.HasValue ? distributionOEM.EffectTime.Value.ToString("yyyy-MM-dd") : string.Empty;
                txtAuthorizationDeposit.Text  = distributionOEM.AuthCashDeposit.TrimInvaidZero();
                rdnPlatform.Checked           = distributionOEM.UseB3BConfig;
                rdnOwner.Checked              = !distributionOEM.UseB3BConfig;
                txtLoginUrl.Text              = distributionOEM.LoginUrl;
                CompanyDetailInfo companyDetailInfo = CompanyService.GetCompanyDetail(distributionOEM.CompanyId);
                if (companyDetailInfo != null)
                {
                    lblB3bAccountNo.Text = companyDetailInfo.UserName;
                }
            }
        }