Esempio n. 1
0
        public ActionResult Create(SymbolFile symbolFile, HttpPostedFileBase[] uploadFiles, bool autogenererFraSvg = false)
        {
            ViewBag.Size           = new SelectList(CodeList.Size, "Key", "Value", symbolFile.Size);
            ViewBag.SymbolGraphics = new SelectList(CodeList.SymbolGraphics, "Key", "Value", symbolFile.Type);
            if (ModelState.IsValid)
            {
                if (autogenererFraSvg)
                {
                    _symbolService.AddSymbolFilesFromSvg(symbolFile, uploadFiles[0]);
                }
                else
                {
                    _symbolService.AddSymbolFiles(symbolFile, uploadFiles);
                }


                return(RedirectToAction("Details", "Files", new { systemid = symbolFile.Symbol.SystemId }));
            }

            return(View(symbolFile));
        }