public ActionResult CreateElement(FormCollection form) { if (form["operation"] == "Add") { Element e = new Element() { name = form["name"], symbol = form["symbol"], atomicNumber = Convert.ToInt32(form["atomicNumber"]), atomicWeight = Convert.ToDouble(form["atomicWeight"]), isRadioactive = bool.Parse(form["isRadioactive"]), family = (AppEnum.Family)Enum.Parse(typeof(AppEnum.Family), form["family"]), period = Convert.ToInt32(form["period"]), atomicRadius = Convert.ToInt32(form["atomicRadius"]) }; try { el.Insert(e); } catch (ArgumentException) { return(Redirect("/Error/KnownError/add")); } catch (Exception) { return(Redirect("/Error/Index/")); } } return(Redirect("/Element/ShowTable")); }