Ejemplo n.º 1
0
        public string CycleYear(string system_id)
        {
            clsDataHandling objDataClass = new clsDataHandling();
            DataTable       dt           = objDataClass.CycleYear(system_id);
            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]["year"].ToString() + "\" ,");
                str.Append("\"name\":\"" + dt.Rows[i]["year"].ToString() + "\" ");
                str.Append("},");
            }
            str = str.Remove(str.Length - 1, 1);
            str.Append("]");
            return(str.ToString());
        }