Example #1
0
        public string CycleCountry(string system_id, string selected_year)
        {
            clsDataHandling objDataClass = new clsDataHandling();
            DataTable       dt           = objDataClass.CycleCountry(system_id, selected_year);
            StringBuilder   str          = new StringBuilder();

            str.Append("[");
            str.Append("{");
            str.Append("\"code\":\"0\" ,");
            str.Append("\"name\":\"--Select--\"");
            str.Append("},");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                str.Append("{");
                str.Append("\"code\":\"" + dt.Rows[i]["ISO"].ToString() + "\" ,");
                str.Append("\"name\":\"" + dt.Rows[i]["COUNTRY"].ToString() + "\" ");
                str.Append("},");
            }
            str = str.Remove(str.Length - 1, 1);
            str.Append("]");
            return(str.ToString());
        }