public List <EducationViewModel> GetEducations() { var educations = _educationService.GetEducations(); var convertedEducations = _mapper.Map <List <EducationViewModel> >(educations); return(convertedEducations); }
// GET: Employee public ActionResult Index(int?department, long?contracttype, int?from, int?to, int?month1, int?nguoithan, int?education, int?phongban, DateTime?fromdate, DateTime?todate, int?gender, int?skill, string sugget = "") { var departments = _departmentService.GetDepartments(); ViewBag.Departments = new SelectList(departments, "Id", "Name"); var skills = _skillService.GetSkills(); ViewBag.Skills = new SelectList(skills, "Id", "Title"); var educations = _educationService.GetEducations(); ViewBag.Educations = new SelectList(educations, "Id", "Title"); int _depart = department.HasValue ? department.Value : -1; int _from = from.HasValue ? from.Value : -1; int _to = to.HasValue ? to.Value : -1; Session["_depart"] = _depart; Session["sugget"] = ""; if (fromdate.HasValue) { var model = _employeeService.SearchByDateOfBirth(_depart, fromdate, todate, sugget); Session["baocao"] = "1"; Session["_depart"] = _depart; Session["fromdate"] = fromdate; Session["todate"] = todate; Session["sugget"] = sugget; return(View(model)); } else if (gender.HasValue) { var model = _employeeService.SearchByGender(_depart, gender, sugget); Session["baocao"] = "2"; Session["_depart"] = _depart; Session["gender"] = gender; Session["sugget"] = sugget; return(View(model)); } else if (education.HasValue) { var model = _employeeService.SearchByEducation(_depart, education, sugget); Session["baocao"] = "3"; Session["_depart"] = _depart; Session["education"] = education; Session["sugget"] = sugget; return(View(model)); } else if (nguoithan.HasValue) { var model = _employeeService.SearchByNguoiThan(nguoithan); Session["baocao"] = "4"; Session["_depart"] = _depart; Session["nguoithan"] = nguoithan; Session["sugget"] = sugget; return(View(model)); } else if (skill.HasValue) { var model = _employeeService.SearchBySkill(_depart, skill, sugget); Session["baocao"] = "5"; Session["_depart"] = _depart; Session["skill"] = skill; Session["sugget"] = sugget; return(View(model)); } else if (_from > 0) { var model = _employeeService.SearchByOld(_depart, _from, _to, sugget); Session["baocao"] = "6"; Session["_depart"] = _depart; Session["_from"] = _from; Session["_to"] = _to; Session["sugget"] = sugget; return(View(model)); } else if (_from > 0) { var model = _employeeService.SearchByOld(_depart, _from, _to, sugget); Session["baocao"] = "6"; Session["_depart"] = _depart; Session["_from"] = _from; Session["_to"] = _to; Session["sugget"] = sugget; return(View(model)); } else if (month1 > 0) { var model = _employeeService.SearchByDayOfBirth(month1); Session["baocao"] = "7"; Session["month1"] = month1; return(View(model)); } //else if (contracttype > 0) //{ // var model = _employeeService.SearchByContractTypes(_depart, contracttype); // Session["baocao"] = "8"; // Session["_depart"] = _depart; // Session["contracttype"] = contracttype; // return View(model); //} else { var model = _employeeService.GetAll(); Session["baocao"] = "9"; return(View(model)); } }
public List <Education> GetEducations(string EducationName) { return(educationServiceobj.GetEducations(EducationName)); }
// GET: Education public ActionResult Index() { var list = service.GetEducations(); return(View(list)); }