예제 #1
0
        // GET: SalaryHistory/Create
        public ActionResult Create()
        {
            var model     = new SalaryHistoryViewModel();
            var employees = employee.GetEmployeeSelectListItems().Select(x => new {
                Id   = x.Id,
                Name = x.LastName + " - " + x.FirstName
            }).ToList();

            ViewBag.Employees = new SelectList(employees, "Id", "Name");

            var contractTypes = this.contractTypeService.GetContractTypes().Select(x => new {
                Id   = x.Id,
                Name = x.Name
            });

            ViewBag.ContractTypes = new SelectList(contractTypes, "Id", "Name");


            var worktitledetails = _worktitledetailService.GetWorkTitleDetails();

            ViewBag.Worktitledetails = new SelectList(worktitledetails, "Id", "Name");

            var worktitledetail   = worktitledetails.FirstOrDefault();
            var worktitledetailId = worktitledetail != null ? worktitledetail.Id : 0;
            var salarylevels      = _salarylevelService.GetSalaryLevelByWorkTitle(worktitledetailId).Select(x => new {
                Id   = x.Id,
                Name = x.WorkTitleId + " - " + x.Code + " - Tiền lương: " + x.MonthlySalary
            }).ToList();

            ViewBag.Salarylevels = new SelectList(salarylevels, "Id", "Name");

            var departments = _departmentService.GetDepartments();

            ViewBag.Departments = new SelectList(departments, "Id", "Name");

            model.From = DateTime.Today.ToLocalTime();
            model.To   = DateTime.Today.ToLocalTime();

            return(View(model));
        }
예제 #2
0
        // GET: WorkTitleDetail
        public ActionResult Index()
        {
            var list = service.GetWorkTitleDetails();

            return(View(list));
        }