// GET: Formats/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Format format = _formatsRepository.GetFormat(id); if (format == null) { return(HttpNotFound()); } return(View(format)); }
public ActionResult Save(AppNewDocumentViewModel model, string templateName, int selected) { model.AllControls.RemoveAll(r => r.Tag.Contains("//comment")); // delete labels from list Models.Format format = _formatsRepository.GetFormat(selected); Models.File template = _filesReopository.GetFiles(Request.MapPath("~/TemplateFiles/")).Find(x => x.FileName == templateName); _controlsRepository.SaveContols(model.AllControls); Word word = new Word(); string fileInfoHash = word.SaveDocument(model.AllControls, template, format); ViewBag.InfoHash = fileInfoHash; ViewBag.Type = 2; ViewBag.Message = "Zapisano plik "; return(View()); }