// GET: Offers
        public IActionResult Index(int GameId)
        {
            var offer = _offerService.Get(x => x.GameId == GameId);

            return(View(offer == null ? new Offer {
                GameId = GameId
            } : offer));
        }
示例#2
0
        public async Task <IActionResult> GetOffer([FromRoute] long id)
        {
            var result = _service.Get(id);

            result = MessageHelper <OfferDto> .GetResponse(result);

            return(Ok(result));
        }
示例#3
0
        public async Task <IActionResult> Details(int?Id)
        {
            if (Id == null)
            {
                return(NotFound());
            }
            var controller = nameof(OffersController).Split("Controller")[0];
            var html       = "detail";

            var model = await _offerService.Get(Id);

            if (User.IsInRole(Roles.Owner) || User.Identity.IsAuthenticated)
            {
                html = "managedetail";
            }

            return(View($"~/Views/{controller}/{html}.cshtml", model));
        }
        public async Task <IActionResult> Get()
        {
            var offers = await _offerService.Get();

            var result = new JsonResult(offers);

            await _offerService.SetAsRead(offers.Select(x => x.OfferId).ToArray());

            return(result);
        }
        public IActionResult SlotGameWin()
        {
            int.TryParse(Request.Form["SlotMachineOptions"], out int slotCode);
            int.TryParse(Request.Form["GameId"], out int gameId);

            if (gameId > 0 && slotCode > 0)
            {
                // Add/Update Game User
                AddUpdateGameUser(gameId);

                Offer offer = _offerService.Get(x => x.GameId == gameId && x.SlotCode == slotCode);
                if (offer != null)
                {
                    OfferViewModel model = new OfferViewModel
                    {
                        OfferId     = offer.Id,
                        GameId      = offer.GameId,
                        VideoName   = offer.VideoName,
                        VideoURL    = offer.VideoURL,
                        Description = offer.Description,
                        Photo1      = offer.Photo1,
                        Photo2      = offer.Photo2,
                        Photo3      = offer.Photo3,
                        Photo4      = offer.Photo4,
                        Photo5      = offer.Photo5,
                        SlotCode    = offer.SlotCode
                    };

                    return(View(model));
                }
                else
                {
                    return(RedirectToAction("SlotGameLost"));
                }
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
示例#6
0
 public List <Model.Offer> Get()
 {
     return(_offer.Get());
 }
示例#7
0
        public async Task <IActionResult> AddStatus(Guid id)
        {
            var model = await _offerService.Get(id);

            return(View(model));
        }
 public IActionResult Get(Guid id)
 {
     return(Ok(offerService.Get(id)));
 }
示例#9
0
 public Task <PaginationResult <OfferDto> > Get([FromQuery] PaginationParameter paginationParameter, [FromQuery] OffersFilter filter)
 {
     return(_offerService.Get(filter, paginationParameter));
 }
 public List <Data.ViewModel.OffersVM> Get([FromQuery] OfferSearchRequest req)
 {
     return(_service.Get(req));
 }
        public async Task <ContentResult> GetOfferPhoneNumber(Guid id)
        {
            var offer = await _offerService.Get(id);

            return(Content(offer.PhoneNumber));
        }