Пример #1
0
        public async Task <IActionResult> RejectLot(LotModerationModel model)
        {
            if (ModelState.IsValid)
            {
                await crudLotLogic.Update(new AuctionLot
                {
                    Id     = model.AuctionLot.Id,
                    Status = LotStatusProvider.GetRejectedStatus()
                });

                await crudNoteLogic.Delete(new Note
                {
                    AuctionLotId = model.AuctionLot.Id
                });

                await crudNoteLogic.Create(new Note
                {
                    AuctionLotId = model.AuctionLot.Id,
                    Text         = model.RejectNote
                });
                await SendRejectMessage(model.AuctionLot.Id, model.RejectNote);

                return(View("Redirect", new RedirectModel
                {
                    InfoMessages = RedirectionMessageProvider.LotRejectedMessages(),
                    SecondsToRedirect = ApplicationConstantsProvider.GetLongRedirectionTime(),
                    RedirectUrl = "/Moderator/Lots"
                }));
            }
            model.Expanded = true;
            return(View("CheckLot", model));
        }
Пример #2
0
        public async Task <IActionResult> AcceptLot(string id)
        {
            if (!string.IsNullOrWhiteSpace(id))
            {
                await crudLotLogic.Update(new AuctionLot
                {
                    Id     = id,
                    Status = LotStatusProvider.GetAcceptedStatus()
                });
                await SendAcceptMessage(id);

                return(View("Redirect", new RedirectModel
                {
                    InfoMessages = RedirectionMessageProvider.LotAcceptedMessages(),
                    SecondsToRedirect = ApplicationConstantsProvider.GetLongRedirectionTime(),
                    RedirectUrl = "/Moderator/Lots"
                }));
            }
            return(NotFound());
        }