public ActionResult Create(FormCollection collection) { try { Emp model = new Emp(); model.payed_at = Convert.ToDateTime(collection.Get("payed_at")); model.probeg = Convert.ToInt32(collection.Get("probeg")); model.litrs = Convert.ToInt32(collection.Get("litrs")); model.summa = Convert.ToDecimal(collection.Get("summa")); model.Save(); return(RedirectToAction("Index")); } catch (Exception ex) { return(this.Create()); } }
static void Main(string[] args) { Person p = new Emp(); p.Save(); }