public ActionResult delete(int id) { InstructorBll.DeleteInstructor(id); ViewBag.Istructors = InstructorBll.getAllIstructors(); return(RedirectToAction("index", "Instructor", new { area = "AdminArea" })); }
// GET: AdminArea/Instructor // GET: Employee public ActionResult index() { ViewBag.Istructors = InstructorBll.getAllIstructors(); ViewBag.Qualifications = QualificationBll.getQualifications(); return(View()); }
public ActionResult Edit(instructorVM instructorvm) { InstructorBll.UpdateInstructor(instructorvm); ViewBag.Istructors = InstructorBll.getAllIstructors(); return(RedirectToAction("index", "Instructor", new { area = "AdminArea" })); }
public ActionResult AddInstructor(instructorVM instructorvm) { //if (ModelState.IsValid == true) //{ InstructorBll.AddInstructor(instructorvm); ViewBag.Istructors = InstructorBll.getAllIstructors(); // } return(RedirectToAction("index", "Instructor", new { area = "AdminArea" })); }
public ActionResult AddInstructor(instructorQualificationPhoneViewModel instructorvm) { InstructorBll.AddInstructor(instructorvm); ViewBag.Istructors = InstructorBll.getAllIstructors(); ViewBag.Qualifications = QualificationBll.getQualifications(); return(RedirectToAction("index")); }
public ActionResult delete(int id) { InstructorBll.DeleteInstructor(id); ViewBag.Istructors = InstructorBll.getAllIstructors(); ViewBag.Qualifications = QualificationBll.getQualifications(); return(RedirectToAction("index")); }
public ActionResult LoadData() { try { //Creating instance of DatabaseContext class var draw = Request.Form.GetValues("draw").FirstOrDefault(); var start = Request.Form.GetValues("start").FirstOrDefault(); var length = Request.Form.GetValues("length").FirstOrDefault(); var sortColumn = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][name]").FirstOrDefault(); var sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault(); var searchValue = Request.Form.GetValues("search[value]").FirstOrDefault(); //Paging Size (10,20,50,100) int pageSize = length != null?Convert.ToInt32(length) : 0; int skip = start != null?Convert.ToInt32(start) : 0; int recordsTotal = 0; // Getting all Customer data //var customerData = (from tempcustomer in _context.Customers select tempcustomer); IEnumerable <instructorVM> customerData = InstructorBll.getAllIstructors(); //Sorting if (!(string.IsNullOrEmpty(sortColumn) && string.IsNullOrEmpty(sortColumnDir))) { customerData = customerData.OrderBy(sortColumn + " " + sortColumnDir); } //Search if (!string.IsNullOrEmpty(searchValue)) { customerData = customerData.Where(m => m.instructor_name.Contains(searchValue)); } //total number of rows count recordsTotal = customerData.Count(); //Paging var data = customerData.Skip(skip).Take(pageSize).ToList(); //Returning Json Data return(Json(new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = data })); } catch (Exception) { throw; } }
public ActionResult AddCourse() { List <CategoryVM> categories = courseBll.getAllCategories(); SelectList categsList = new SelectList(categories, "category_id", "category_name"); ViewBag.categsList = categsList; List <servicesVM> services = serviceBll.getAllServices(); SelectList servicesList = new SelectList(services, "service_id", "service_name"); ViewBag.servicesList = servicesList; List <instructorVM> instructors = InstructorBll.getAllIstructors(); SelectList instructorsList = new SelectList(instructors, "instructor_id", "instructor_name"); ViewBag.instructorsList = instructorsList; return(PartialView()); }
public ActionResult EditCourse(int id) { CourseVM course = courseBll.getCourseById(id); List <CategoryVM> categories = courseBll.getAllCategories(); SelectList categsList = new SelectList(categories, "category_id", "category_name", course.category_id); ViewBag.categsList = categsList; List <servicesVM> services = serviceBll.getAllServices(); SelectList servicesList = new SelectList(services, "service_id", "service_name", course.service_id); ViewBag.servicesList = servicesList; List <instructorVM> instructors = InstructorBll.getAllIstructors(); SelectList instructorsList = new SelectList(instructors, "instructor_id", "instructor_name", course.instructor_id); ViewBag.instructorsList = instructorsList; ViewBag.activeState = course.isActive; return(PartialView(course)); }
public ActionResult GetAllInstructors() { ViewBag.Istructors = InstructorBll.getAllIstructors(); return(PartialView("GetAllInstructors")); }