Beispiel #1
0
 public ActionResult CreateEmployee(Employee objEmp)
 {
     try {
         da = new DataAccess();
         da.CreateEmployee(objEmp);
         return Json(new { IsDataInserted = true }, JsonRequestBehavior.AllowGet);
     }
     catch (Exception ex) {
         return Json(new { IsDataInserted = false, Message = ex.Message }, JsonRequestBehavior.AllowGet);
     }
 }
Beispiel #2
0
 public ActionResult FetchDepartments()
 {
     try {
         da = new DataAccess();
         List<Department> lstDept = da.GetDepartments();
         return Json(new { IsDataFetched = true, obj = lstDept }, JsonRequestBehavior.AllowGet);
     }
     catch (Exception ex) {
         return Json(new { IsDataFetched = false, Message = ex.Message }, JsonRequestBehavior.AllowGet);
     }
 }
Beispiel #3
0
 public ActionResult CreateDepartment(Department objDept)
 {
     try {
         da = new DataAccess();
         da.CreateDepartment(objDept);
         return Json(new { IsDataInserted = true }, JsonRequestBehavior.AllowGet);
     }
     catch (Exception ex) {
         return Json(new { IsDataInserted = false, Message = ex.Message }, JsonRequestBehavior.AllowGet);
     }
 }