Exemplo n.º 1
0
        public void ReportLoss(GameLossModel model)
        {
            IList <GameDto> gameDtos = _gameDao.Get(model.Type, model.Kind, model.SubKind);

            GameDto gameDto = gameDtos.FirstOrDefault();

            if (gameDto == null)
            {
                throw new Exception("Could not find specified game!");
            }

            int regionId = _regionDao.GetRegionId(model.City, model.Circuit, model.District);

            var gameLoss = new LossGameDto
            {
                GameId = gameDto.Id,
                Class  = model.Class
            };

            var loss = new LossDto
            {
                RegionId     = regionId,
                Description  = model.Description,
                Date         = model.Date,
                SanitaryLoss = model.SanitaryLoss
            };

            _lossDao.Insert(gameLoss, loss);
        }
Exemplo n.º 2
0
        public ActionResult ReportLoss(GameLossModel model)
        {
            _gameLossService.ReportLoss(model);

            return(Json(new { data = true }, JsonRequestBehavior.AllowGet));
        }