Beispiel #1
0
 //Select Organization By DropDOwn
 private List <SelectListItem> GetOrganizationList()
 {
     return(_batchManager.GetAllOrganization()
            .Select(c => new SelectListItem()
     {
         Value = c.Id.ToString(), Text = c.Name
     }).ToList());
 }
        public List <SelectListItem> GetAllOrganizationSlItems()
        {
            var organizations = _batchManager.GetAllOrganization();
            var slItems       = new List <SelectListItem>();

            foreach (var organization in organizations)
            {
                var sli = new SelectListItem();
                sli.Text  = organization.Name + " - " + organization.Code;
                sli.Value = organization.Id.ToString();
                slItems.Add(sli);
            }

            return(slItems);
        }