public ActionResult ProcessingRequest(ProcesRequest post) { using (_cont = new ApplicationDbContext()) { Request forupp = _cont.Requests.Find(post.RequestID); forupp.FireStationId = Convert.ToInt32(post.FireStationID); forupp.Status = "Обработанный"; forupp.DateFinished = DateTime.Now; if (TryUpdateModel(forupp)) { _cont.SaveChanges(); } using (DocX document = DocX.Load(Server.MapPath("~/Files/report.docx"))) { Request temp = (from t in _cont.Requests.Include("User").Include("Location").Include("FireStation") where t.ID == forupp.ID select t).ToArray()[0]; FileCreator.CreateReport(temp, document); } } return(View("Index")); }