Exemplo n.º 1
0
        private List <SelectListItem> GetDesignationDropDownList()
        {
            var designations            = anDepartmentManager.GetAllDesignation();
            List <SelectListItem> items = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Value = "", Text = "---Select---"
                }
            };

            foreach (Teacher teacher in designations)
            {
                SelectListItem item = new SelectListItem()
                {
                    Value = teacher.DesignationId.ToString(), Text = teacher.DesignationName
                };
                items.Add(item);
            }
            return(items);
        }