public AddPartViewModel LoadData() { AddPartViewModel vm = new AddPartViewModel(); vm.PartCategoryItems = _partService.GetPartsCategory().ToViewModel().Select(c => new SelectListItem { Value = c.CategoryId, Text = c.Description }); vm.PartTypeItems = _partService.GetPartType().ToViewModel().Select(c => new SelectListItem { Value = c.PartType, Text = c.PartTypeDescription }); vm.CurrencyItems = _partService.GetCurrency().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.UnitItems = _partService.GetUnitItems().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.MaterialCategoryItems = _partService.GetMaterialcCategoryItems().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.APItems = _partService.GetAPItemsList().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.ACItems = _partService.GetACItemsList().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.ASCItems = _partService.GetASCItemsList().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.ShelfLifeItems = _partService.GetShelfLifeItems().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.LeadTimeItems = _partService.GetLeadTimeItems().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.OSIItems = _partService.GetOSIItems().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.UnitCubeItems = _partService.GetUnitCubeItems().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); vm.SecurityItems = _partService.GetSecurityItems().ToViewModel().Select(c => new SelectListItem { Value = c.ID, Text = c.Description }); return(vm); }