public ActionResult MoveToArchives(int id) { User user = UserService.GetUserByEmail(User.Identity.Name); Auction auction = AuctionService.GetByID(id); if (auction == null || auction.Auto.UserID != user.ID) { return(HttpNotFound()); } try { bool moveManually = true; AuctionService.Finish(auction, moveManually); HangfireService.CancelJob(auction.CompletionJobID); HangfireService.CancelJob(auction.DeletionJobID); } catch { return(HttpNotFound()); } Thread.Sleep(1000); return(RedirectToAction("Index", "MyAuto")); }
public ActionResult FinishManually(int id) { try { Auction auction = AuctionService.GetByID(id); bool finishManually = true; AuctionService.Finish(auction, finishManually); HangfireService.CancelJob(auction.CompletionJobID); return(Json(new { result = "success" })); } catch (Exception ex) { return(Json(new { result = "Error: " + ex.Message })); } }