Пример #1
0
        public ActionResult Create([Bind(Include = "ID,Name,Designation,Salary")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                db.Employees.Add(employee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(employee));
        }
Пример #2
0
 public ActionResult Signup(User model)
 {
     using (ExportExcelEntities context = new ExportExcelEntities())
     {
         context.Users.Add(model);
         context.SaveChanges();
     }
     return(RedirectToAction("Login"));
 }