public ActionResult Create(Models.Symbol symbol, HttpPostedFileBase uploadFile, string[] packages) { ViewBag.Themes = new SelectList(CodeList.Themes(), "Key", "Value", symbol.Theme); ViewBag.SymbolPackages = new SelectList(_symbolService.GetPackagesWithAccessControl(), "SystemId", "Name"); symbol.SymbolPackages = new List <SymbolPackage>(); if (packages != null) { foreach (var package in packages) { symbol.SymbolPackages.Add(_symbolService.GetPackage(Guid.Parse(package))); } } ViewBag.IsAdmin = false; if (Request.IsAuthenticated) { ViewBag.IsAdmin = _authorizationService.IsAdmin(); } if (ModelState.IsValid) { ImageService img = new ImageService(); if (uploadFile != null) { symbol.Thumbnail = img.SaveThumbnail(uploadFile, symbol); } var addedSymbol = _symbolService.AddSymbol(symbol); return(RedirectToAction("Details", "Files", new { systemid = addedSymbol.SystemId })); } return(View(symbol)); }