public IActionResult CompleteWebsiteRequest(int wrid) { EditWebsiteRequestModel outputModel = new EditWebsiteRequestModel(); ObjectResult output = StatusCode(500, error.CompleteWebsiteRequest); if (authProvider.IsAdmin()) { WebsiteRequest wr = websiteRequestDAL.Get(wrid); if (wr == null) { output = StatusCode(404, error.NotFound); } else { outputModel.SuccessfullyDeleted = websiteRequestDAL.Delete(wr.Id); if (outputModel.SuccessfullyDeleted) { outputModel.EmailSent = emailProvider.WebsiteRequestComplete(wr); output = StatusCode(200, outputModel); } else { output = StatusCode(500, outputModel); } } } else { output = StatusCode(401, error.NotAdmin); } return(output); }
public IActionResult CompleteWebsiteRequest(int wrid) { WebsiteRequest wr = websiteRequestDAL.Get(wrid); websiteRequestDAL.Delete(wr.Id); emailProvider.WebsiteRequestComplete(wr); return(View(wr)); }