Ejemplo n.º 1
0
        // GET: SalaryHistory

        public ActionResult Index(long?employeeId, long?departmentId, long?WorkTitleDetailId)
        {
            //SalaryHistoryCollectionViewModel model = new SalaryHistoryCollectionViewModel()
            //{
            //    model.Employees = employee.GetAll()
            //    model.SalaryHistorys = service.GetSalaryHistorys()
            //};

            SalaryHistoryCollectionViewModel model = new SalaryHistoryCollectionViewModel {
                Employees      = employee.GetAll(),
                SalaryHistorys = service.GetSalaryHistorys()
            };

            if (employeeId.HasValue)
            {
                model.SalaryHistorys = service.GetSalaryHistoryByEmployee(employeeId.Value);
            }
            if (departmentId.HasValue)
            {
                model.Departments = service.GetSalaryHistoryByDepartment(departmentId.Value);
            }
            if (WorkTitleDetailId.HasValue)
            {
                model.WorkTitleDetails = service.GetSalaryHistoryByWorkTitleDetail(WorkTitleDetailId.Value);
            }


            return(View(model));
        }
        // GET: Timekeeping
        public ActionResult Index()
        {
            var timeAttendanceTypes = timeAttendanceType.GetTimeAttendanceTypes();

            ViewBag.TimeAttendanceTypes = new SelectList(timeAttendanceTypes, "Id", "Code");
            long k = (long)Session["maphongban"];

            SalaryHistoryCollectionViewModel model = new SalaryHistoryCollectionViewModel {
                Employees      = employee.GetAll(),
                SalaryHistorys = _salaryHistoryService.GetSalaryHistorys1().Where(x => x.DepartmentId == k).ToList()
            };

            return(View(model));
        }