Ejemplo n.º 1
0
        public JsonResult Images(string name)
        {
            DownLoadMethod dmArtistPictures = new DownLoadMethod();
            XDocument      xdoc2            = dmArtistPictures.GetData(MethodArtist.GetImages(name, Constants.ArtistImages, Constants.ArtistImagesOrder));

            XmlProcessing.Process("GetImages", xdoc2, ca);

            return(Json(ca));
        }
Ejemplo n.º 2
0
        public JsonResult Albums(string name)
        {
            DownLoadMethod dmArtisittopAlbums = new DownLoadMethod();
            XDocument      xdoc3 = dmArtisittopAlbums.GetData(MethodArtist.GetTopAlbums(name));

            XmlProcessing.Process("GetTopAlbums", xdoc3, ca);

            return(Json(ca));
        }
Ejemplo n.º 3
0
        public JsonResult Info(string name)
        {
            XDocument xdoc = new XDocument();

            DownLoadMethod dmArtisitInfo = new DownLoadMethod();

            try
            {
                xdoc = dmArtisitInfo.GetData(MethodArtist.GetInfo(name));
                XmlProcessing.Process("GetInfo", xdoc, ca);
            }
            catch (Exception)
            {
                ca = new ClassArtist();
            }

            return(Json(ca));
        }
Ejemplo n.º 4
0
        public JsonResult Events(int?page, string sort, string sortdir, string name)
        {
            XDocument xdoc4 = new XDocument();

            DownLoadMethod dmArtisitEvents = new DownLoadMethod();

            try
            {
                xdoc4 = dmArtisitEvents.GetData(MethodArtist.GetEvents(name));
                XmlProcessing.Process("GetEvents", xdoc4, ca);
            }
            catch (Exception)
            {
                ca = new ClassArtist();
            }

            var         grid = new WebGrid(ca.Events, rowsPerPage: 5, selectionFieldName: "selectedRow");
            IHtmlString html = grid.GetHtml(tableStyle: "webGrid",
                                            headerStyle: "header",
                                            alternatingRowStyle: "alt",
                                            selectedRowStyle: "webgrid-selected-row",
                                            columns: grid.Columns(
                                                grid.Column("StartDate", "Date"),
                                                grid.Column("Title", header: null, format: (item) => item.GetSelectLink(item.Title)),
                                                grid.Column("Venue", "Venue", format: (item) => item.Venue.Name),
                                                grid.Column("Address", "Address", format: (item) => item.Venue.Location.Country + ", " + item.Venue.Location.City + ", " + item.Venue.Location.Street)
                                                ), htmlAttributes: new { id = "EventsTable" });

            //get selected row value
            ClassGeoPoint point = null;

            if (grid.SelectedRow != null)
            {
                point = Methods.GetGeopointFromEvent(ca.Events, grid.SelectedRow.Value.Id);
            }

            return(Json(new
            {
                Data = html.ToHtmlString(),
                GeoPoint = point
            }, JsonRequestBehavior.AllowGet));
        }