public static List<SelectListItem> FillClassCombo() { SelectListItem s = new SelectListItem(); List<SelectListItem> litem = new List<SelectListItem>(); s.Text = "-----Select Class Name-----"; s.Value = "0"; s.Selected = true; litem.Add(s); var classitem = new CollegeDBEntities().Classes.Select(x => new { x.ClassId, x.ClassName }); foreach (var t in classitem) { s = new SelectListItem(); s.Text = t.ClassName.ToString(); s.Value = t.ClassId.ToString(); litem.Add(s); } return litem; }
public static List<SelectListItem> FillFeeHeadCombo() { SelectListItem s = new SelectListItem(); List<SelectListItem> litem = new List<SelectListItem>(); s.Text = "-----Select Fee Head-----"; s.Value = "0"; s.Selected = true; litem.Add(s); var item = new CollegeDBEntities().FeeHeads.Select(x => new { x.FeeId, x.FeeeName }); foreach (var i in item) { s = new SelectListItem(); s.Text = i.FeeeName.ToString(); s.Value = i.FeeId.ToString(); litem.Add(s); } return litem; }
public static List<SelectListItem> Fillcombo() { List<SelectListItem> Litem = new List<SelectListItem>(); SelectListItem s = new SelectListItem(); s.Text = "-----Select Fee Group-----"; s.Value = "0"; s.Selected = true; Litem.Add(s); var item = new CollegeDBEntities().FeeGroups.Select(x => new { x.FGroupId, x.GroupName }); foreach (var G in item) { s = new SelectListItem(); s.Text = G.GroupName.ToString(); s.Value = G.FGroupId.ToString(); Litem.Add(s); } return Litem; }
public static List<SelectListItem> FillCombo() { SelectListItem s ; List<SelectListItem> items = new List<SelectListItem>(); s = new SelectListItem(); s.Text = "------Select Courses Type--------"; s.Value = "0"; s.Selected = true; items.Add(s); var clientIDs = new CollegeDBEntities().CoursesTypes.Select(x => new { x.CoursesName, x.ID }); foreach (var t in clientIDs) { s = new SelectListItem(); s.Text = t.CoursesName.ToString(); s.Value = t.ID.ToString(); items.Add(s); } return items; }