Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
     }
 }