Ejemplo n.º 1
0
        public TransactionDTO <List <ListRouletteDTO> > GetRouletteConfiguration()
        {
            TransactionDTO <List <ListRouletteDTO> > getRouletteConfiguration = new TransactionDTO <List <ListRouletteDTO> >();

            try
            {
                var getAllRoulette = _rouletteServices.GetAllRoulette();
                if (getAllRoulette.Data.Count == 0)
                {
                    getRouletteConfiguration.Message = getAllRoulette.Message;
                    getRouletteConfiguration.Status  = getAllRoulette.Status;

                    return(getRouletteConfiguration);
                }
                var getAllRouletteConfigurationByRoullete = _rouletteConfigurationServices.GetAllRouletteConfiguration();
                if (getAllRouletteConfigurationByRoullete.Data.Count == 0)
                {
                    getRouletteConfiguration.Message = getAllRouletteConfigurationByRoullete.Message;
                    getRouletteConfiguration.Status  = getAllRouletteConfigurationByRoullete.Status;

                    return(getRouletteConfiguration);
                }
                getRouletteConfiguration.Data = CombineRouletteAndConfiguration(getAllRoulette.Data, getAllRouletteConfigurationByRoullete.Data);
            }
            catch (Exception ex)
            {
                getRouletteConfiguration.Status  = Common.Status.Failure;
                getRouletteConfiguration.Message = ex.Message;
            }

            return(getRouletteConfiguration);
        }
Ejemplo n.º 2
0
 public ActionResult GetAllRoulette()
 {
     try
     {
         return(Ok(_routelleServices.GetAllRoulette()));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status400BadRequest, new ErrorAnswerDTO()
         {
             State = StatusCodes.Status400BadRequest,
             Mistakes = new List <ErrorDTO>(new[]
             {
                 new ErrorDTO()
                 {
                     Code = "",
                     Description = ex.Message
                 }
             })
         }));
     }
 }