public JsonResult addExperience(string title, string start_date, string end_date, string institution) { if (!string.IsNullOrEmpty(title) && !string.IsNullOrEmpty(start_date) && !string.IsNullOrEmpty(end_date) && !string.IsNullOrEmpty(institution)) { js_experience jsed = new js_experience(); int sess = Convert.ToInt32(Session["js_id"].ToString()); jsed.title = title; jsed.status = 1; jsed.institution = institution; jsed.start_date = DateTime.Parse(start_date); jsed.end_date = DateTime.Parse(end_date); jsed.js_id = sess; db.js_experience.Add(jsed); if (db.SaveChanges() > 0) { return(Json(true, JsonRequestBehavior.AllowGet)); } else { return(Json(false, JsonRequestBehavior.AllowGet)); } } else { return(Json(false, JsonRequestBehavior.AllowGet)); } }
public JsonResult removeExperience(int jsed_id) { js_experience cv = db.js_experience.Find(jsed_id); if (cv != null) { cv.status = 0; if (db.SaveChanges() > 0) { return(Json(true, JsonRequestBehavior.AllowGet)); } else { return(Json(false, JsonRequestBehavior.AllowGet)); } } else { return(Json(false, JsonRequestBehavior.AllowGet)); } }