コード例 #1
0
        public List <SelectListItem> GetFormsByClient(List <int?> ClientIds)
        {
            IFormsRepository      formsRepo = new FormsRepository();
            List <SelectListItem> fornList  = new List <SelectListItem>();

            fornList = formsRepo.GetAll().Where(x => ClientIds.Contains(x.ClientID) && !string.IsNullOrEmpty(x.FormName)).Select(x => new SelectListItem()
            {
                Text = x.FormName, Value = x.ID.ToString()
            }
                                                                                                                                 ).ToList();
            return(fornList);
        }
コード例 #2
0
        public List <SelectListItem> GetAllForms()
        {
            IFormsRepository      formsRepo = new FormsRepository();
            List <SelectListItem> fornList  = new List <SelectListItem>();

            fornList = formsRepo.GetAll().Where(x => !string.IsNullOrEmpty(x.FormName)).Select(x => new SelectListItem()
            {
                Text = x.FormName, Value = x.ID.ToString()
            }
                                                                                               ).ToList();
            return(fornList);
        }