public ActionResult DeleteSkill(int id = 0) { Job_Skill job = DB.Job_Skill.Find(id); DB.Job_Skill.Remove(job); DB.SaveChanges(); TempData["NewMsg"] = "تمت عملية الحذف"; return(RedirectToAction("Index")); }
public ActionResult EditSkill(FormCollection Specification) { Job_Skill JS = new Job_Skill(); JS.JobSkillID = Convert.ToInt32(Specification["JobSkillID"]); JS.JobID = Convert.ToInt32(Specification["JobID"]); JS.Skill = Specification["Skill"]; DB.Entry(JS).State = EntityState.Modified; DB.SaveChanges(); TempData["NewMsg"] = "تم تعديل المهارات ."; return(RedirectToAction("Index")); }
public ActionResult EditSkill(int id = 0) { //ViewBag.CurrentID = id; Job_Skill job_Skill = DB.Job_Skill.Find(id); if (job_Skill == null) { return(HttpNotFound()); } ViewBag.JobSkillID = job_Skill.JobSkillID; ViewBag.JobID = job_Skill.JobID; ViewBag.Skill = job_Skill.Skill; return(PartialView()); }
public ActionResult CreateSkill(FormCollection skill) { Job_Skill JS = new Job_Skill(); JS.JobID = Convert.ToInt32(skill["JobID"]); JS.Skill = skill["Skill"]; if (ModelState.IsValid) { DB.Job_Skill.Add(JS); DB.SaveChanges(); TempData["NewMsg"] = "تم إضافة مهاره جديد ."; return(RedirectToAction("Index")); } return(PartialView(JS)); }