public async Task <ResultGameDTO> OpenStartRouletteAsync(RouletteIdDTO startRoulette)
        {
            ResultGameDTO resultGame    = new ResultGameDTO();
            var           resultRequest = await this.iStartRouletteDAL.OpenStartRouletteAsync(startRoulette);

            if (resultRequest == 0)
            {
                resultGame.IsError = true;
                resultGame.Message = Constant.StatusRouletteError;
                return(resultGame);
            }

            resultGame.ResultObject = Constant.StatusRouletteStart;
            return(resultGame);
        }
Exemple #2
0
        public async Task <int> OpenStartRouletteAsync(RouletteIdDTO startroulette)
        {
            int idRoulette = 0;

            using (SqlConnection connection = new SqlConnection(BaseContext.GetParameterConnection()))
            {
                string sql = string.Format(Querys.QueryOpenRoulette,
                                           DateTime.UtcNow.ToString(Constant.FormatDate),
                                           startroulette.RouletteId);
                using (SqlCommand command = new SqlCommand(sql, connection))
                {
                    command.CommandType = CommandType.Text;

                    await connection.OpenAsync();

                    idRoulette = (Int32)await command.ExecuteScalarAsync();

                    await connection.CloseAsync();
                }
                return(idRoulette);
            }
        }
Exemple #3
0
 public async Task <ResultGameDTO> OpenStartRouletteAsync([FromBody] RouletteIdDTO startRouletteid)
 {
     return(await iStartRouletteBll.OpenStartRouletteAsync(startRouletteid));
 }