Ejemplo n.º 1
0
 public AuctionsRepository(BiddingContext context, IConfiguration configuration)
 {
     _configuration    = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _connectionString = _configuration["AzureStorage:ConnectionString"];
     _containerDomain  = _configuration["AzureStorage:ContainerDomain"];
     m_context         = context ?? throw new ArgumentNullException(nameof(context));
 }
Ejemplo n.º 2
0
        public BiddingPriceManager(SubmitStrategyManager strategyManager, BiddingContext biddingContext, Func <BiddingPriceRequest, bool> cancelStrategyFunc)
        {
            this.strategyManager = strategyManager;
            this.biddingContext  = biddingContext;

            this.strategies = strategyManager.LoadStrategies();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 尝试提前输入答案
        /// </summary>
        /// <param name="imageUuid"></param>
        /// <param name="answer"></param>
        private void TryInputAnswerAhead(string imageUuid, string answer)
        {
            var oper = BiddingContext.GetSubmitOperateByUuid(imageUuid);

            if (oper != null && oper.status != 99)
            {
                phase2ActManager.InputCaptchForSubmit(answer);
                oper.status = 21;
            }
        }
Ejemplo n.º 4
0
        public void ResetContext()
        {
            biddingContext = new BiddingContext();
            logger.InfoFormat("ResetContext last-sec is {0}", biddingContext.GetLastCalcedSec());

            ResetStrategyByReload();

            lastActions = new List <string>();
            SetLastAcionText();

            RefreshBiddingPage();

            IsPreviewDone     = false;
            IsOneRoundStarted = false;

            logger.InfoFormat("ResetContext done");
        }
Ejemplo n.º 5
0
        private async Task <ClaimsIdentity> SetupUserClaimsAsync(IServiceCollection services, ApplicationUser userDetails)
        {
            BiddingContext dbContext  = services.BuildServiceProvider().GetService <BiddingContext>();
            var            rtoPCalcer = new CalcAllowedPermissions(dbContext);

            List <Claim> claims = new List <Claim>
            {
                new Claim(
                    type: PermissionConstants.UserIdClaimType,
                    value: userDetails.Id.ToString(),
                    valueType: ClaimValueTypes.Integer,
                    issuer: "Bidding"
                    ),
                new Claim(
                    type: PermissionConstants.PackedPermissionClaimType,
                    value: await rtoPCalcer.CalcPermissionsForUserAsync(userDetails.Id).ConfigureAwait(true)
                    )
            };

            return(new ClaimsIdentity(claims));
        }
Ejemplo n.º 6
0
 public BiddingService(BiddingContext context)
 {
     _context = context;
 }
Ejemplo n.º 7
0
 public SubscribeRepository(BiddingContext context)
 {
     m_context = context;
 }
 public BiddingController(BiddingContext context)
 {
     _context = context;
 }
 public CalcAllowedPermissions(BiddingContext context)
 {
     _context = context;
 }
Ejemplo n.º 10
0
 public void Reset()
 {
     biddingContext = new BiddingContext();
 }
Ejemplo n.º 11
0
 public UsersRepository(IServiceProvider services)
 {
     m_userManager = services.GetRequiredService <UserManager <ApplicationUser> >();
     m_roleManager = services.GetRequiredService <RoleManager <ApplicationRole> >();
     m_context     = services.GetRequiredService <BiddingContext>();
 }
Ejemplo n.º 12
0
 public PermissionRepository(BiddingContext context)
 {
     m_context = context ?? throw new ArgumentNullException(nameof(context));
 }
 public FileUploaderRepository(BiddingContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }