Ejemplo n.º 1
0
        // GET: Employee/Create
        public ActionResult Create()
        {
            var model     = new EmployeeViewModel();
            var countries = _countryService.GetCountries();

            ViewBag.Countries = new SelectList(countries, "Id", "Name");

            var ethnicGroups = _ethnicGroupService.GetEthnicGroups();

            ViewBag.EthnicGroups = new SelectList(ethnicGroups, "Id", "Name");

            var religions = _religionService.GetReligions();

            ViewBag.Religions = new SelectList(religions, "Id", "Name");

            var educations = _educationService.GetEducations();

            ViewBag.Educations = new SelectList(educations, "Id", "Title");

            var roles = _roleService.GetRoles();

            ViewBag.Roles = new SelectList(roles, "Id", "Name");

            var genders = new List <KeyValuePair <int, string> > {
                new KeyValuePair <int, string>(0, "Nữ"),
                new KeyValuePair <int, string>(1, "Nam")
            };

            ViewBag.Genders = new SelectList(genders, "Key", "Value");

            var communistYouthUnions = new List <KeyValuePair <int, string> > {
                new KeyValuePair <int, string>(1, "Đoàn viên"),
                new KeyValuePair <int, string>(0, "Đảng viên")
            };

            ViewBag.CommunistYouthUnions = new SelectList(communistYouthUnions, "Key", "Value");

            var skills = _skillService.GetSkills();

            //ViewBag.Skills = new MultiSelectList(skills, "Id", "Title", new long[] {});
            ViewBag.Skills = new SelectList(skills, "Id", "Title");

            model.DateOfBirth              = DateTime.Now.ToLocalTime();
            model.DateIssueIdentity        = DateTime.Now.ToLocalTime();
            model.DateIssueSocialInsurance = DateTime.Now.ToLocalTime();

            return(View(model));
        }
Ejemplo n.º 2
0
        // GET: EthnicGroup
        public ActionResult Index()
        {
            var list = service.GetEthnicGroups();

            return(View(list));
        }