Exemple #1
0
        public string SingerTypes()
        {
            // get all singarea
            StateOfRequest  mState    = new StateOfRequest("AreaNo");
            List <Singarea> singareas = _singareasManager.GetAllSingareas(mState);
            // Convert List<Singarea> 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 singarea in singareas)
            {
                jObject = JsonUtil.ConvertSingerTypeToJsongObject(singarea, "0");
                jArray.Add(jObject);
                jObject = JsonUtil.ConvertSingerTypeToJsongObject(singarea, "1");
                jArray.Add(jObject);
                jObject = JsonUtil.ConvertSingerTypeToJsongObject(singarea, "2");
                jArray.Add(jObject);
            }
            jObjectForAll.Add("singerTypes", jArray);

            return(jObjectForAll.ToString());
        }