예제 #1
0
        // GET: Bands/Albums
        public async Task <ActionResult> Index(int userId, int Id)
        {
            //System.Diagnostics.Debug.WriteLine("check band from " + userId + " with album " + Id);
            string response = await clsBandRequests.getBandAlbums(userId);

            //System.Diagnostics.Debug.WriteLine("Soy yo 1: " + response);

            string response2 = await clsAlbumRequests.GetAlbumInfo(userId, Id);

            //System.Diagnostics.Debug.WriteLine("Soy yo: " + response2);

            //Hubo error
            if (!ErrorParser.parse(response).Equals(""))
            {
                ViewBag.Message = "F**k my life...";
            }

            BandProfileViewModel profile = new BandProfileViewModel();

            profile.Id       = Int32.Parse(Session["Id"].ToString());
            profile.Username = Session["Username"].ToString();
            profile.Name     = Session["Name"].ToString();
            profile.Albums   = DataParser.parseAlbums(response);
            profile.Disk     = DataParser.parseDisk(response2);

            return(View(profile));
        }
예제 #2
0
        public async Task <ActionResult> Edit(int userId)
        {
            string response = await clsBandRequests.GetBandInfo(userId);

            //Hubo error
            if (!ErrorParser.parse(response).Equals(""))
            {
                ViewBag.Message = "F**k my life...";
            }
            System.Diagnostics.Debug.WriteLine(response);
            string response2 = await clsRegisterRequests.GetRegisterBandForm();

            string ParsedMessage = ErrorParser.parse(response2);

            string response3 = await clsBandRequests.getBandAlbums(userId);

            BandProfileViewModel profile = new BandProfileViewModel();

            profile.Id       = Int32.Parse(Session["Id"].ToString());
            profile.Username = Session["Username"].ToString();
            profile.Name     = Session["Name"].ToString();
            profile.Info     = DataParser.parseBandInfo(response);
            profile.EditForm = DataParser.parseBandForm(response2);

            profile.Albums = DataParser.parseAlbums(response3);
            return(View(profile));
        }
예제 #3
0
        // GET: Bands/News
        public async Task <ActionResult> Index(int userId, int id)
        {
            System.Diagnostics.Debug.WriteLine("check band from " + userId + " with new " + id);

            string response = await clsBandRequests.getBandAlbums(userId);

            string response2 = await clsNewRequests.GetNew(userId, id);

            System.Diagnostics.Debug.WriteLine("antes de parsear " + response2);
            if (!ErrorParser.parse(response2).Equals(""))
            {
                ViewBag.Message = "Couldn´t get the news correctly";
            }

            BandProfileViewModel profile = new BandProfileViewModel();

            profile.Id       = Int32.Parse(Session["Id"].ToString());
            profile.Username = Session["Username"].ToString();
            profile.Name     = Session["Name"].ToString();

            profile.Albums = DataParser.parseAlbums(response);
            profile.New    = DataParser.parseNew(response2);

            return(View(profile));
        }
예제 #4
0
        public static BandProfileViewModel parseBandProfile(List <string> json)
        {
            BandProfileViewModel profile = new BandProfileViewModel();

            profile.Albums = parseAlbums(json[0]);
            profile.Posts  = parsePosts(json[1]);

            return(profile);
        }
예제 #5
0
        // GET: Fans/Albums
        public async System.Threading.Tasks.Task <ActionResult> Index(int userId, int bandId, int id)
        {
            System.Diagnostics.Debug.WriteLine("check band from " + userId + " of band " + bandId + " with album " + id);


            // try { } catch ()
            if (Sessions.isAuthenticated(Request, Session))
            {
                int sessionRol = Int32.Parse(Session["rol"].ToString());
                if (!Sessions.isFan(sessionRol))
                {
                    return(View("~/Views/Login/Index.cshtml"));
                }
            }
            //[Bandas,Posts]
            // string response = await Fans.Requests.clsBandRequests.GetBandInfo(bandId);
            string response2 = await Bands.Requests.clsBandRequests.getBandAlbums(bandId);

            string response3 = await Bands.Requests.clsAlbumRequests.GetAlbumInfo(bandId, id);

            string response4 = await Bands.Requests.clsBandRequests.GetBandInfo(bandId);

            System.Diagnostics.Debug.WriteLine(response4);
            //Hubo error

            /* if (!ErrorParser.parse(response).Equals(""))
             * {
             *   ViewBag.Message = "F**k my life...";
             * }*/

            //clsInfoBand infoBand = DataParser.parseBandInfo(response);

            FanProfileViewModel  profile     = new FanProfileViewModel();
            BandProfileViewModel BandProfile = new BandProfileViewModel();

            BandProfile.Id      = bandId;
            profile.BandProfile = BandProfile;


            profile.Id       = Int32.Parse(Session["Id"].ToString());
            profile.Username = Session["Username"].ToString();
            profile.Name     = Session["Name"].ToString();
            // profile.BandInfo = infoBand;
            profile.BandProfile.Albums = DataParser.parseAlbums(response2);



            profile.BandProfile.Disk = DataParser.parseDisk(response3);
            profile.BandProfile.Info = DataParser.parseBandInfo(response4);
            return(View(profile));
        }
예제 #6
0
        public async Task <ActionResult> NewEvent(int userId, string EventTitle, string EventDate, string EventTime, bool EventType,
                                                  string EventState, string EventLocation, string EventContent)
        {
            System.Diagnostics.Debug.WriteLine(userId);
            System.Diagnostics.Debug.WriteLine(EventTitle);
            System.Diagnostics.Debug.WriteLine(EventDate);
            System.Diagnostics.Debug.WriteLine(EventTime);
            System.Diagnostics.Debug.WriteLine(EventType);
            System.Diagnostics.Debug.WriteLine(EventState);
            System.Diagnostics.Debug.WriteLine(EventLocation);
            System.Diagnostics.Debug.WriteLine(EventContent);

            clsEvent form = new clsEvent();

            form.Date        = EventDate;
            form.Description = EventContent;
            form.IsConcert   = EventType;
            form.State       = EventState;
            form.Location    = EventLocation;
            form.Time        = EventTime;
            form.Date        = EventDate;
            form.Title       = EventTitle;

            string response = await clsBandRequests.getBandAlbums(userId);

            string response2 = await clsEventRequests.createEvent(userId, form);

            //Hubo error
            if (!ErrorParser.parse(response).Equals(""))
            {
                ViewBag.Message = "Something wrong with, create event";
            }

            BandProfileViewModel profile = new BandProfileViewModel();

            profile.Id       = Int32.Parse(Session["Id"].ToString());
            profile.Username = Session["Username"].ToString();
            profile.Name     = Session["Name"].ToString();
            profile.Albums   = DataParser.parseAlbums(response);


            int Id = DataParser.parseEventForm(response2);

            System.Diagnostics.Debug.WriteLine("Got id: " + Id);

            return(Json(new
            {
                redirectUrl = Url.Action("Index", "Events", new { userId = Int32.Parse(Session["Id"].ToString()), id = Id }),
                isRedirect = true
            }));
        }
예제 #7
0
        public static BandProfileViewModel CreateBandProfileView(Band band)
        {
            var bandView = new BandProfileViewModel
            {
                InstrumentInfoList = SetMusician_Instrument(band.Users.ToList()),
                Name        = band.Name,
                Description = band.Description,
                Location    = band.Location,
                Photo       = "/Photos/_StockPhotos/_stock_band.jpg",
                id          = band.Band_ID,
                Sc_Name     = band.SC_Name,
                Genres      = band.Genres,
                Events      = band.Events
            };

            return(bandView);
        }
예제 #8
0
        public async Task <ActionResult> Create(int userId)
        {
            string response = await clsBandRequests.getBandAlbums(userId);

            //Hubo error
            if (!ErrorParser.parse(response).Equals(""))
            {
                ViewBag.Message = "Something wrong with, create event";
            }

            BandProfileViewModel profile = new BandProfileViewModel();

            profile.Id       = Int32.Parse(Session["Id"].ToString());
            profile.Username = Session["Username"].ToString();
            profile.Name     = Session["Name"].ToString();

            profile.Albums = DataParser.parseAlbums(response);

            return(View(profile));
        }
예제 #9
0
        public new async Task <ActionResult> Profile(int userId)
        {
            string response = await clsBandRequests.GetBandInfo(userId);

            string response2 = await clsBandRequests.getBandAlbums(userId);

            //Hubo error
            if (!ErrorParser.parse(response).Equals(""))
            {
                ViewBag.Message = "F**k my life...";
            }

            BandProfileViewModel profile = new BandProfileViewModel();

            profile.Id       = Int32.Parse(Session["Id"].ToString());
            profile.Username = Session["Username"].ToString();
            profile.Name     = Session["Name"].ToString();
            profile.Info     = DataParser.parseBandInfo(response);

            profile.Albums = DataParser.parseAlbums(response2);
            return(View(profile));
        }
예제 #10
0
        // GET: Bands/Bands
        public async Task <ActionResult> Index(int userId)
        {
            if (Sessions.isAuthenticated(Request, Session))
            {
                int sessionRol = Int32.Parse(Session["rol"].ToString());
                if (!Sessions.isBand(sessionRol))
                {
                    return(View("~/Views/Login/Index.cshtml"));
                }
            }
            string response = await clsBandRequests.getBandAlbums(userId);

            string response2 = await clsBandRequests.GetBandPosts(userId);

            BandProfileViewModel profile = new BandProfileViewModel();

            profile.Id       = Int32.Parse(Session["Id"].ToString());
            profile.Username = Session["Username"].ToString();
            profile.Name     = Session["Name"].ToString();
            profile.Albums   = DataParser.parseAlbums(response);
            profile.Posts    = DataParser.parsePosts(response2);
            return(View(profile));
        }
예제 #11
0
        public async Task <ActionResult> ViewBandProfile(int bandId)
        {
            Band band = GetBand(bandId);
            BandProfileViewModel model   = new BandProfileViewModel();
            SocialMediaIds       socials = GetBandSocials(band.socialId);

            model.band             = band;
            model.facebookImageUrl = await FacebookAPI.GetProfilePicture(socials.facebookPageId);

            model.facebookPermalinks = await FacebookAPI.GetPermaUrlFromPost(socials.facebookPageId);

            model.youtubeUrls = await GetYoutubeUrls(band);

            //model.facebookPermalinks = new List<string>(); // place holder for less API calls
            //model.youtubeUrls = new List<string>();

            model.reviews = GetBandReviews(band);
            model.score   = AverageReviews(model.reviews);
            model.gigs    = GetGigViewModel(GetGigs(band));



            return(View(model));
        }