public ActionResult AddInstructor(instructorQualificationPhoneViewModel instructorvm) { InstructorBll.AddInstructor(instructorvm); ViewBag.Istructors = InstructorBll.getAllIstructors(); ViewBag.Qualifications = QualificationBll.getQualifications(); return(RedirectToAction("index")); }
public static void UpdateInstructor(instructorQualificationPhoneViewModel instructorvm) { MCenterDBContext db = new MCenterDBContext(); instructor updataedInstructor = getInstructorByID(instructorvm.instructor_id); updataedInstructor.instructor_name = instructorvm.instructor_name; updataedInstructor.NameOf_ItsUnit = instructorvm.NameOf_ItsUnit; updataedInstructor.TrainningTopic = instructorvm.TrainningTopic; db.SaveChanges(); }
public ActionResult Edit(int id) { instructor instructor = InstructorBll.getInstructorByID(id); instructorQualificationPhoneViewModel insvm = new instructorQualificationPhoneViewModel(); insvm.instructor_id = instructor.instructor_id; insvm.instructor_name = instructor.instructor_name; insvm.NameOf_ItsUnit = instructor.NameOf_ItsUnit; insvm.TrainningTopic = instructor.TrainningTopic; return(View(insvm)); }
public static void AddInstructor(instructorQualificationPhoneViewModel instructorvm) { MCenterDBContext db = new MCenterDBContext(); instructor newInstructor = new instructor(); newInstructor.instructor_name = instructorvm.instructor_name; newInstructor.NameOf_ItsUnit = instructorvm.NameOf_ItsUnit; newInstructor.TrainningTopic = instructorvm.TrainningTopic; newInstructor.Current_JobTitle = instructorvm.Current_JobTitle; db.instructors.Add(newInstructor); db.SaveChanges(); instructor_phone newPhone = new instructor_phone(); newPhone.phone = instructorvm.phone; newPhone.instructor_id = newInstructor.instructor_id; db.instructor_phone.Add(newPhone); db.SaveChanges(); }
public ActionResult Edit(instructorQualificationPhoneViewModel instructorvm) { InstructorBll.UpdateInstructor(instructorvm); return(RedirectToAction("index")); }