public ActionResult Details(string id) { var intId = int.Parse(id); var messageDb = this.messageService.GetAll().FirstOrDefault(x => x.Id == intId); if (messageDb != null) { if (messageDb.ToId != this.UserProfile.Id) { return(this.HttpNotFound()); } messageDb.IsRead = true; this.messageService.Update(messageDb); } var message = this.messageService.GetAll().Where(x => x.Id == intId).To <MessageViewModel>().FirstOrDefault(); var sanitizer = HtmlSanitizer.SimpleHtml5DocumentSanitizer(); if (message != null) { message.Text = sanitizer.Sanitize(message.Text); } return(this.View(message)); }
public ActionResult Edit(string id) { this.Session["ProjectId"] = id; var intId = int.Parse(id); var requestedEstimationTask = this.projectService.GetAll().Where(x => x.Id == intId).To <EstimationEditViewModel>().FirstOrDefault(); if (requestedEstimationTask != null) { if (requestedEstimationTask.LeadId != this.UserProfile.Id) { return(this.HttpNotFound()); } var sanitizer = HtmlSanitizer.SimpleHtml5DocumentSanitizer(); requestedEstimationTask.Description = sanitizer.Sanitize(requestedEstimationTask.Description); } return(this.View(requestedEstimationTask)); }