public string GetUploadTypeSelectedText(int UploadTypeId) { UploadsDAL uploads = new UploadsDAL(); var uploadTypes = uploads.GetHRUploadTypes(); return(uploadTypes.Where(u => u.UploadTypeId == UploadTypeId).FirstOrDefault().UploadType); }
public List <SelectListItem> GetUploadTypes() { UploadsDAL uploads = new UploadsDAL(); var uploadTypes = uploads.GetHRUploadTypes(); List <SelectListItem> list = new List <SelectListItem>(); foreach (var uploadType in uploadTypes) { list.Add(new SelectListItem { Selected = true, Text = uploadType.UploadType, Value = uploadType.UploadTypeId.ToString() }); } return(list); }