示例#1
0
        private void Sel(HttpContext context)
        {
            AlbumsBO albumsBO = new AlbumsBO();
            String jSonString = "";

            bool disable = !String.IsNullOrEmpty(context.Request.QueryString["Disable"])
                ? Convert.ToBoolean(context.Request.QueryString["Disable"])
                : false;

            List<Albums> listAlbums =
                String.IsNullOrEmpty(Convert.ToString(context.Request.QueryString["Disable"]))
                    ? albumsBO.Sel()
                    : albumsBO.Sel(disable);

            if (listAlbums.Any()) {
                _converter.DateTimeFormat = "dd/MM/yyyy";

                jSonString = JsonConvert.SerializeObject(listAlbums, _converter);
            }

            jSonString = "{\"data\":" + jSonString + "}";
            context.Response.Write(jSonString);
        }