public ActionResult Edit(ContactUsMessage msg, string sendEmail) { try { var old = ContactUsMessages.GetByID(msg.ID); if (!String.IsNullOrWhiteSpace(msg.Answer) && sendEmail == "on") { EmailServices.ContactUsMessage(old.Email, old.Subject, old.Message, msg.Answer, UserID); } msg.LastUpdate = DateTime.Now; ViewBag.Success = true; ContactUsMessages.Update(msg); } catch (Exception ex) { SetErrors(ex); } return(RedirectToAction("Index")); }