public ActionResult LoadGroup(string lang) { var grouplst = ServiceGroupManager.GetServiceGroupList(lang); JsonResult result = Json(new SelectList(grouplst, "ServiceGroupId", "GroupName")); return(result); }
// // GET: /Admin/ServiceGroup/ public ActionResult Index() { string sellang = FillLanguagesList(); var list = ServiceGroupManager.GetServiceGroupList(sellang); return(View(list)); }
string FillLanguagesList() { string lang = ""; string id = ""; if (RouteData.Values["lang"] == null) { lang = "tr"; } else { lang = RouteData.Values["lang"].ToString(); } var languages = LanguageManager.GetLanguages(); var list = new SelectList(languages, "Culture", "Language", lang); ViewBag.LanguageList = list; var groups = ServiceGroupManager.GetServiceGroupList(lang); if (RouteData.Values["id"] == null) { if (groups != null && groups.Count != 0) { id = groups.First().ServiceGroupId.ToString(); } else { id = "0"; } } else { id = RouteData.Values["id"].ToString(); } var grouplist = new SelectList(groups, "ServiceGroupId", "GroupName", id); ViewBag.GroupList = grouplist; return(id); }