示例#1
0
 public BetValidation(IDistributedCache distributedCache)
 {
     betModel           = new BetModel(distributedCache);
     gamblerValidation  = new GamblerValidation(distributedCache);
     rouletteValidation = new RouletteValidation(distributedCache);
     gamblerModel       = new GamblerModel(distributedCache);
     rouletteModel      = new RouletteModel(distributedCache);
 }
示例#2
0
 public CBet(IDistributedCache distributedCache)
 {
     betModel           = new BetModel(distributedCache);
     betResultModel     = new BetResultModel(distributedCache);
     gamblerModel       = new GamblerModel(distributedCache);
     rouletteModel      = new RouletteModel(distributedCache);
     gamblingModel      = new GamblingModel(distributedCache);
     betValidation      = new BetValidation(distributedCache);
     gamblingValidation = new GamblingValidation(distributedCache);
     cGambling          = new CGambling(distributedCache);
 }
示例#3
0
        public GenericAnswer OpenBet(RuletteModel dataRulette, BetModel dataBet, GamblerModel dataGambler)
        {
            GenericAnswer response = new GenericAnswer();
            string        colorBet = string.Empty;

            if (dataBet.cashBet > Convert.ToInt32(Enum.Cash.MaxCash))
            {
                response.error = "Supera el monto máximo de apuesta = " + Enum.Cash.MaxCash;

                return(response);
            }

            SqlParameter[] parameters =
            {
                new SqlParameter {
                    Value = dataRulette.idRulette, ParameterName = RuletteMapping.idRulette
                },
                new SqlParameter {
                    Value = dataGambler.idGambler, ParameterName = GamblerMapping.idGambler
                },
                new SqlParameter {
                    Value = dataBet.cashBet, ParameterName = BetMapping.cashBet
                },
                new SqlParameter {
                    Value = dataBet.numberBet, ParameterName = BetMapping.numberBet
                },
                new SqlParameter {
                    Value = dataBet.colorBet, ParameterName = BetMapping.colorBet
                },
            };
            string messageError = string.Empty;

            connectionManager.AcctionRun(updateRulette, ref messageError, parameters);
            if (!string.IsNullOrEmpty(messageError))
            {
                response.error      = messageError;
                response.successful = false;

                return(response);
            }
            response.error      = "Apertura Exitosa";
            response.entity     = dataRulette;
            response.successful = true;

            return(response);
        }
示例#4
0
 public IActionResult OpenBet([FromBody] RuletteModel entidadRulette, [FromBody] BetModel entidadBet, [FromBody] GamblerModel entidadGambler)
 {
     return(Ok(RuletteRepository.OpenBet(entidadRulette, entidadBet, entidadGambler)));
 }
示例#5
0
 public CGambling(IDistributedCache distributedCache)
 {
     gamblingModel = new GamblingModel(distributedCache);
     gamblerModel  = new GamblerModel(distributedCache);
 }
示例#6
0
 public GamblerService(IDistributedCache distributedCache)
 {
     gamblerModel      = new GamblerModel(distributedCache);
     gamblerValidation = new GamblerValidation(distributedCache);
 }