コード例 #1
0
 public Employee SaveEmployee(Employee e)
 {
     SalesERPDAL salesDal = new SalesERPDAL();
     salesDal.Employees.Add(e);
     salesDal.SaveChanges();
     return e;
 }
コード例 #2
0
 public ActionResult SaveEmployee(Employee e, string BtnSubmit)
 {
     switch (BtnSubmit)
     {
         case "Save Employee":
             if (ModelState.IsValid)
             {
                 EmployeeBusinessLayer empBal = new EmployeeBusinessLayer();
                 empBal.SaveEmployee(e);
                 return RedirectToAction("Index");
             }
             else
             {
                 return View("AddEmployee");
             }
         case "Cancel":
             return RedirectToAction("Index");
     }
     return new EmptyResult();
 }