예제 #1
0
        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"));
        }
예제 #2
0
        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"));
        }
예제 #3
0
        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());
        }
예제 #4
0
        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));
        }