public string Get()
        {
            // get all singarea
            StateOfRequest  mState    = new StateOfRequest("LangNo");
            List <Language> languages = _languagesManager.GetAllLanguages(mState);

            // Convert List<Language> to JSON array
            JObject jObjectForAll = new JObject();

            jObjectForAll.Add("pageNo", mState.CurrentPageNo);
            jObjectForAll.Add("pageSize", mState.PageSize);
            jObjectForAll.Add("totalRecords", mState.TotalRecords);
            jObjectForAll.Add("totalPages", mState.TotalPages);
            JObject jObject;
            JArray  jArray = new JArray();

            foreach (var language in languages)
            {
                jObject = JsonUtil.ConvertlanguageToJsongObject(language);
                jArray.Add(jObject);
            }
            jObjectForAll.Add("languages", jArray);

            return(jObjectForAll.ToString());
        }
Esempio n. 2
0
        public ActionResult GetAll(bool IsNativeName)
        {
            ActionResult result = new ActionResult
            {
                Data      = LanguagesManager.GetAllLanguages(IsNativeName),
                IsSuccess = true
            };

            return(result);
        }
Esempio n. 3
0
        internal static List <IUIData> GetData(int portalId)
        {
            Dictionary <string, IUIData> Settings = new Dictionary <string, IUIData>();
            string language = string.Empty;
            List <LanguageRequest> Languages = LanguagesManager.GetAllLanguages(false);

            if (Languages.Count > 0)
            {
                language = Languages.FirstOrDefault().Code;
            }

            Settings.Add("Languages", new UIData {
                Name = "Languages", Options = Languages, OptionsValue = "Code", OptionsText = "DisplayName", Value = language
            });
            return(Settings.Values.ToList());
        }