Пример #1
0
        public static IEnumerable <SelectListItem> FillddlMaritalStatus()
        {
            var service       = new MaritalStatusService();
            var maritalStatus = service.GetAll();
            var listitems     = maritalStatus.Select(x =>

                                                     new SelectListItem
            {
                Text  = x.Name,
                Value = x.Id.ToString()
            });

            return(listitems);
        }
        public JsonResult Init()
        {
            tblEmployee _empObj = new tblEmployee();

            _empObj.CRUD = "I";

            var CountryList       = _countryService.GetAll().Select(s => new { s.CountryId, s.CountryName }).ToList();
            var StateList         = _stateService.GetAll().Select(s => new { s.StateId, s.StateName, s.CountryId }).ToList();
            var GenderList        = _genderService.GetAll().Select(s => new { s.Id, s.Description }).ToList();
            var MaritalStatusList = _MaritalStatusService.GetAll().Select(s => new { s.Id, s.Description }).ToList();
            var DepartmentList    = _DepartmentService.GetAll().Select(s => new { s.DeptId, s.DeptName }).ToList();

            var EmployeeList = _empService.GetAll().Select(s => new
            {
                s.Id,
                FullName = s.FirstName + " " + s.LastName,
                s.Email,
                s.EmpCode,
                s.MobileNo,
                CRUD = "U",
                s.CreatedDate,
                s.ModifiedDate
            }).OrderByDescending(s => s.CreatedDate).Take(10).ToList();

            string[] detailArr = new string[1];
            var      detail    = (from d in detailArr
                                  select new
            {
                _empObj = _empObj,
                EmployeeList = EmployeeList,
                CountryList = CountryList,
                StateList = StateList,
                GenderList = GenderList,
                MaritalStatusList = MaritalStatusList,
                DepartmentList = DepartmentList
            }).FirstOrDefault();

            return(Json(detail, JsonRequestBehavior.AllowGet));
        }
        // GET: MaritalStatus
        public ActionResult Index()
        {
            var maritalstatus = Service.GetAll();

            return(View(maritalstatus));
        }
Пример #4
0
        public static IEnumerable<SelectListItem> FillddlMaritalStatus()
        {
            var service = new MaritalStatusService();
            var maritalStatus = service.GetAll();
            var listitems = maritalStatus.Select(x =>

                new SelectListItem
                {
                    Text = x.Name,
                    Value = x.Id.ToString()
                });
            return listitems;
        }