コード例 #1
0
ファイル: FormatsController.cs プロジェクト: kilof17/WordApp
        // 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));
        }
コード例 #2
0
ファイル: AppController.cs プロジェクト: kilof17/WordApp
        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());
        }