예제 #1
0
 public ActionResult DeleteEmpQual(int ID)
 {
     try {
         EmpQualification EmpQualification = db.EmpQualification.Where(a => a.ID == ID).FirstOrDefault();
         db.EmpQualification.Remove(EmpQualification);
         db.SaveChanges();
         var result = new { action = "yes", msg = "Deleted successfully" };
         return(Json(result, JsonRequestBehavior.AllowGet));
     }
     catch
     {
         var result = new { action = "no", msg = "Error occurred" };
         return(Json(result, JsonRequestBehavior.AllowGet));
     }
 }
예제 #2
0
        public ActionResult EditEmpQualEnd(EmpQualification EmpQualification)
        {
            try {
                var ob = db.EmpQualification.Where(a => a.ID == EmpQualification.ID).FirstOrDefault();
                ob.QualID     = EmpQualification.QualID;
                ob.University = EmpQualification.University;
                ob.toDate     = EmpQualification.toDate;
                ob.fromDate   = EmpQualification.fromDate;

                db.SaveChanges();
                var result = new { res = "yes", msg = "Edited" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch
            {
                var result = new { res = "no", msg = "error ocured" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
예제 #3
0
 public ActionResult AddEmpQual(EmpQualification EmpQualification)
 {
     if (ModelState.IsValid)
     {
         try
         {
             db.EmpQualification.Add(EmpQualification);
             db.SaveChanges();
             var result = new { res = "yes", msg = "added" };
             return(Json(result, JsonRequestBehavior.AllowGet));
         }
         catch
         {
             var result = new { res = "no", msg = "error ocured" };
             return(Json(result, JsonRequestBehavior.AllowGet));
         }
     }
     else
     {
         return(View());
     }
 }