示例#1
0
        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));
        }
示例#3
0
        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);
        }