Exemplo n.º 1
0
        public JsonResult GetSubEvents(string name)
        {
            List <SelectListItem> licities   = new List <SelectListItem>();
            EventsServices        serviceObj = new EventsServices();
            int id = (int)Enum.Parse(typeof(TypeofEvent), name, true);

            try
            {
                var result = serviceObj.Geteventsubtype(SessionToken).Entity.Where(x => x.EventReferenceId == id).Select(x => x).ToList();
                licities.Add(new SelectListItem {
                    Text = "-Select-", Value = "0"
                });
                if (result != null)
                {
                    foreach (var x in result)
                    {
                        licities.Add(new SelectListItem {
                            Text = x.EventSubType, Value = x.Id.ToString()
                        });
                    }
                }
                return(Json(licities, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                throw;
            }

            // return Json(new SelectList(licities, "Value", "Text", JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetEvents()
        {
            GetEventsResponse responseData = null;

            try
            {
                //Authenticate API key
                long?hostId = HostServices.GetCallerHostId();
                if (!hostId.HasValue)
                {
                    Log.Warn(ResponseMessages.InvalidAPIKey);
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidAPIKey, ResponseMessages.InvalidAPIKey)));
                }

                //Perform transaction
                EventsServices eventsService = new EventsServices();
                var            events        = eventsService.GetEvents(hostId.Value);

                responseData        = new GetEventsResponse();
                responseData.Events = events;

                //Send response
                return(Request.CreateResponse(new GenericResponse(responseData, ResponseCodes.Success, ResponseMessages.Success)));
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
                return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.Error, ResponseMessages.Error)));
            }
        }
Exemplo n.º 3
0
        public async Task <ActionResult> EventDetailsToParticipants(Guid?id, Guid?Userid)
        {
            if (Userid != null)
            {
                ViewBag.UserId = Userid;
            }
            else
            {
                Userid = Guid.Parse(User.Identity.GetUserId());
            }
            EventRegistrationfromOrganizerModel obj = new EventRegistrationfromOrganizerModel();

            obj.Imagevideo = new EventsImageandVideo();
            OrganiserBasicDetailsServices service = new OrganiserBasicDetailsServices();


            var ImageorVideo1 = await service.GetEventRegistrationImageVideo(SessionToken);

            var data = ImageorVideo1.Where(x => x.Imagevideo.EventIdImageorVideo == id).Select(x => x).FirstOrDefault();

            try
            {
                if (data.Imagevideo.EventImage != null)
                {
                    obj.Imagevideo.Image = Imageget(data.Imagevideo.EventImage);
                }
                if (data.Imagevideo.EventVideo != null)
                {
                    obj.Imagevideo.EventVideo          = data.Imagevideo.EventVideo;
                    obj.Imagevideo.EventIdImageorVideo = id;
                }
                ViewBag.Organizerid = data.Imagevideo.OrganizerId;


                obj.aboutEvent        = new AboutEvent();
                obj.aboutParticipants = new AboutParticipants();
                obj.importantDates    = new ImportantDates();
                obj.awardReward       = new AwardsAndRewards();

                EventsServices serviceObj = new EventsServices();
                var            Aboutevent = serviceObj.GetRegistrationAboutEvent(SessionToken, Userid).Entity.Where(x => x.EventId == id).Select(x => x).FirstOrDefault();
                var            result     = serviceObj.Geteventsubtype(SessionToken).Entity.Where(x => x.Id == Aboutevent.SubTypeOfEvent).Select(x => x) == null ? null : serviceObj.Geteventsubtype(SessionToken).Entity.FirstOrDefault(x => x.Id == Aboutevent.SubTypeOfEvent).EventSubType;
                Aboutevent.SubTypeOfEventstring = result;
                var Aboutparticipant = serviceObj.GetORegistrtionAboutParticipant(SessionToken, Userid).Entity.Where(x => x.EventId == id).Select(x => x).FirstOrDefault();
                var AwardReward      = serviceObj.GetAwardAndReward(SessionToken, Userid).Entity.Where(x => x.EventId == id).Select(x => x).FirstOrDefault();
                var impdates         = serviceObj.GetImportantDateAndTime(SessionToken, Userid).Entity.Where(x => x.EventId == id).Select(x => x).FirstOrDefault();
                obj.aboutEvent        = Aboutevent;
                obj.aboutParticipants = Aboutparticipant;
                obj.importantDates    = impdates;
                obj.awardReward       = AwardReward;


                return(View(obj));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
Exemplo n.º 4
0
        public HttpResponseMessage CancelEvent(CancelEventRequest request)
        {
            try
            {
                //Authenticate API key
                long?hostId = HostServices.GetCallerHostId();
                if (!hostId.HasValue)
                {
                    Log.Warn(ResponseMessages.InvalidAPIKey);
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidAPIKey, ResponseMessages.InvalidAPIKey)));
                }

                //Validate input
                if (request == null ||
                    string.IsNullOrEmpty(request.ReferenceId))
                {
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidParam, ResponseMessages.InvalidParam)));
                }

                //Perform transaction
                EventsServices eventsService = new EventsServices();
                string         status        = eventsService.CancelEvent(hostId.Value, request);

                if (status == CancelEventStatuses.EventNotFound)
                {
                    return(Request.CreateResponse(new GenericResponse(null, CancelEventStatuses.EventNotFound, "Event Not Found")));
                }
                else if (status == CancelEventStatuses.EventNotActive)
                {
                    return(Request.CreateResponse(new GenericResponse(null, CancelEventStatuses.EventNotActive, "Event is already cancelled or closed.")));
                }
                else if (status == CancelEventStatuses.EventHasAlreadyStarted)
                {
                    return(Request.CreateResponse(new GenericResponse(null, CancelEventStatuses.EventHasAlreadyStarted, "Event Has Already Started")));
                }
                else if (status == CancelEventStatuses.Success)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.Success, ResponseMessages.Success)));
                }
                else
                {
                    Log.Error("Unrecognized status: " + status);
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.Error, ResponseMessages.Error)));
                }
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
                return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.Error, ResponseMessages.Error)));
            }
        }
Exemplo n.º 5
0
        public ActionResult EventDetails()
        {
            EventsServices        serviceObj = new EventsServices();
            EventDetailsViewModel obj        = new EventDetailsViewModel();

            obj.EventSubType = new List <string>();
            obj.eventDetails = new List <AboutEvent>();
            var Aboutevent1 = serviceObj.GetAllEvents(SessionToken).Entity.Where(x => x.EventStatus == 1).Select(x => x).ToList();

            foreach (var item in Aboutevent1)
            {
                obj.EventSubType.Add(serviceObj.Geteventsubtype(SessionToken).Entity.Where(x => x.Id == item.SubTypeOfEvent).Select(x => x) == null ? null : serviceObj.Geteventsubtype(SessionToken).Entity.FirstOrDefault(x => x.Id == item.SubTypeOfEvent).EventSubType);
            }


            obj.eventDetails.AddRange(Aboutevent1);

            return(View(obj));
        }
        public ActionResult ParticipantRegistration(Guid?EventId, Guid?Userid)
        {
            if (Userid != null)
            {
                ViewBag.UserId = Userid;
            }
            EventsServices serviceObj = new EventsServices();

            ViewBag.OnlineorOffline = serviceObj.GetRegistrationAboutEvent(SessionToken, Userid).Entity.Where(x => x.EventId == EventId).Select(x => x.modeofevent).FirstOrDefault();
            ParticipationRegistrationModel obj = new ParticipationRegistrationModel();

            obj.EventId       = EventId;
            obj.OrganizerId   = Userid.ToString();
            obj.ParticipantId = User.Identity.GetUserId();

            var returneduserid = TempData["ReturnedValue"];
            var userid         = User.Identity.GetUserId();

            try
            {
                if (returneduserid != null)
                {
                    if (returneduserid.ToString() != userid)
                    {
                        EventsController controllerobj = new EventsController();
                        var result = controllerobj.Otpcheck(EventId, 0);
                        ViewBag.Success = "You have successfully registered.Otp is sent to your email.Please use that otp to upload your performance";
                    }
                    if (returneduserid.ToString() == userid)
                    {
                        TempData["Caution"] = "User already registered";
                        ViewBag.Success     = null;
                    }
                }


                return(View(obj));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
Exemplo n.º 7
0
        // GET: Events
        public ActionResult OrganizeEvent(Guid?EventId, Guid?Userid)
        {
            try
            {
                if (Userid != null)
                {
                    ViewBag.UserId = Userid;
                }
                tabopen tabOpen = (tabopen)TempData["opentab"];
                if (tabOpen != null)
                {
                    ViewBag.AboutParticipantopen = tabOpen.AboutEvent;
                    ViewBag.ImportantDateandtime = tabOpen.AboutParticipant;
                    ViewBag.AwardReward          = tabOpen.Imortantdates;
                    ViewBag.Default         = tabOpen.Default;
                    ViewBag.EventImageVideo = tabOpen.Awarcreward;
                    ViewBag.PaymentGateway  = tabOpen.EventVideoImage;
                }
                EventRegistrationfromOrganizerModel obj = new EventRegistrationfromOrganizerModel();
                obj.aboutEvent        = new AboutEvent();
                obj.aboutParticipants = new AboutParticipants();
                obj.awardReward       = new AwardsAndRewards();
                obj.importantDates    = new ImportantDates();
                EventsServices serviceObj = new EventsServices();
                obj.aboutEvent = serviceObj.GetRegistrationAboutEvent(SessionToken, Userid).Entity.Where(x => x.EventId == EventId).Select(x => x).FirstOrDefault();
                if (EventId != null)
                {
                    obj.aboutParticipants.EventId = (Guid)EventId;

                    obj.awardReward.EventId = (Guid)EventId;

                    obj.importantDates.EventId = (Guid)EventId;;
                }



                return(View(obj));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
Exemplo n.º 8
0
        public ActionResult Uploadvideo(Guid?Eventid, Guid?OrganizerId)
        {
            if (OrganizerId != null)
            {
                ViewBag.UserId = OrganizerId;
            }

            try
            {
                EventsServices serviceObj = new EventsServices();
                var            Aboutevent = serviceObj.GetRegistrationAboutEvent(SessionToken, OrganizerId).Entity.Where(x => x.EventId == Eventid).Select(x => x.ImageorVideo).FirstOrDefault();
                ViewBag.ImageorVideo = Aboutevent;
                ParticipationRegistrationModel obj = new ParticipationRegistrationModel();
                obj.EventId     = Eventid;
                obj.OrganizerId = OrganizerId.ToString();
                return(View(obj));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
Exemplo n.º 9
0
        public HttpResponseMessage GetEventDetailsByRef(string refId)
        {
            GetEventDetailsByRefResponse responseData = null;

            try
            {
                //Authenticate API key
                long?hostId = HostServices.GetCallerHostId();
                if (!hostId.HasValue)
                {
                    Log.Warn(ResponseMessages.InvalidAPIKey);
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidAPIKey, ResponseMessages.InvalidAPIKey)));
                }

                //Get event
                EventsServices eventsService = new EventsServices();
                var            eventInfo     = eventsService.GetEventByRef(hostId.Value, refId);
                if (eventInfo != null)
                {
                    //Get tiers
                    var tiers = eventsService.GetEventTiersByEventId(eventInfo.EventId.Value);

                    responseData       = new GetEventDetailsByRefResponse();
                    responseData.Event = eventInfo;
                    responseData.Tiers = tiers;
                }

                //Send response
                return(Request.CreateResponse(new GenericResponse(responseData, ResponseCodes.Success, ResponseMessages.Success)));
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
                return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.Error, ResponseMessages.Error)));
            }
        }
Exemplo n.º 10
0
        public ActionResult FutureEvents(Guid?Userid)
        {
            if (Userid != null)
            {
                ViewBag.UserId = Userid;
            }

            EventRegistrationfromOrganizerModel obj = new EventRegistrationfromOrganizerModel();

            obj.aboutEventlist        = new List <AboutEvent>();
            obj.aboutParticipantslist = new List <AboutParticipants>();
            obj.importantDateslist    = new List <ImportantDates>();
            obj.awardRewardlist       = new List <AwardsAndRewards>();
            EventsServices serviceObj = new EventsServices();

            try
            {
                var Aboutevent       = serviceObj.GetRegistrationAboutEvent(SessionToken, Userid).Entity.Where(x => x.EventStatus == 1);
                var Aboutparticipant = serviceObj.GetORegistrtionAboutParticipant(SessionToken, Userid).Entity.Where(x => x.EventStatus == 1).ToList();
                var AwardReward      = serviceObj.GetAwardAndReward(SessionToken, Userid).Entity.Where(x => x.EventStatus == 1).ToList();
                var impdates         = serviceObj.GetImportantDateAndTime(SessionToken, Userid).Entity.Where(x => x.EventStatus == 1).ToList();
                obj.aboutEventlist.AddRange(Aboutevent);
                obj.aboutParticipantslist.AddRange(Aboutparticipant);
                obj.importantDateslist.AddRange(impdates);
                obj.awardRewardlist.AddRange(AwardReward);
                if (obj == null)
                {
                    return(View());
                }
                return(View(obj));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
Exemplo n.º 11
0
        public HttpResponseMessage CreateEvent(CreateEventsRequest request)
        {
            try
            {
                //Authenticate API key
                long?hostId = HostServices.GetCallerHostId();
                if (!hostId.HasValue)
                {
                    Log.Warn(ResponseMessages.InvalidAPIKey);
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidAPIKey, ResponseMessages.InvalidAPIKey)));
                }

                //Validate input
                if (request == null ||
                    string.IsNullOrEmpty(request.ReferenceId) ||
                    string.IsNullOrEmpty(request.Title) ||
                    !request.StartDate.HasValue ||
                    request.Tiers == null ||
                    request.Tiers.Count == 0)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidParam, ResponseMessages.InvalidParam)));
                }

                //Validate input length
                if (request.ReferenceId.Length > 30)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidParam, "Reference ID (max 30 length) is too long.")));
                }
                if (request.Title.Length > 200 || request.Description.Length > 500)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidParam, "Title (max 200 length) or Description (max 500 length) is too long.")));
                }
                if (request.Tiers.Count > 10)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidParam, "Only a maximum of 10 tiers allowed.")));
                }

                //Ensure that start date is in future
                if (DateTime.UtcNow.Date > request.StartDate.Value)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidParam, "Event start date must be a future date.")));
                }

                //Validate event reference ID
                IdentityServices identityService = new IdentityServices();
                if (identityService.IsRefIdExists(IdentityServices.RefIdTypes.Event, hostId.Value, request.ReferenceId))
                {
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.DuplicateRefId, ResponseMessages.DuplicateRefId + " (Event " + request.ReferenceId + ")")));
                }
                //Validate event tier reference ID and input length
                foreach (var tier in request.Tiers)
                {
                    if (tier.ReferenceId.Length > 30)
                    {
                        return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidParam, "Reference ID (max 30 length) is too long.")));
                    }
                    if (identityService.IsRefIdExists(IdentityServices.RefIdTypes.EventTier, hostId.Value, tier.ReferenceId))
                    {
                        return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.DuplicateRefId, ResponseMessages.DuplicateRefId + " (Tier " + tier.ReferenceId + ")")));
                    }
                    if (tier.Title.Length > 200)
                    {
                        return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidParam, "Tier Title (max 200 length) is too long.")));
                    }
                }

                //Perform transaction
                EventsServices eventsService = new EventsServices();
                eventsService.CreateEvent(hostId.Value, request);

                //Send response
                return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.Success, ResponseMessages.Success)));
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
                return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.Error, ResponseMessages.Error)));
            }
        }
Exemplo n.º 12
0
        public ActionResult HallofFame(Guid?Userid)
        {
            if (Userid != null)
            {
                ViewBag.UserId = Userid;
            }
            try
            {
                ParticipantsDetailModel model = new ParticipantsDetailModel();
                model.Participantregistration = new List <ParticipationRegistrationModel>();
                var data1  = new BasicFunctionalityofentireappService();
                var result = data1.GetTotalVoteperPost(SessionToken).Entity;
                model.voterslist = new List <VotesModel>();
                model.voterslist = result;

                using (var db = new ConquerorHubEntities())

                {
                    Dictionary <int, Guid?> dict = new Dictionary <int, Guid?>();
                    var data4 = db.CH_ParticipantRegistration.Where(f => f.ParticipantId == Userid.ToString()).Select(f => f).ToList();
                    foreach (var item in data4)
                    {
                        var count = db.CH_VoteTable.GroupBy(a => a.EventId == item.EventId && a.PostId == item.ParticipantsPostId && a.VoteStatus == true).Select(a => a).Count();
                        if (count != 0)
                        {
                            dict.Add(count, item.ParticipantsPostId);
                            dict.OrderByDescending(x => x.Key);
                        }
                    }

                    if (dict.Count != 0)
                    {
                        var values = dict.Take(3).ToDictionary(x => x.Value).Values;

                        var data01 = new List <ParticipationRegistrationModel>();

                        var data0 = new List <CH_ParticipantRegistration>();
                        foreach (var item in values)
                        {
                            data0 = db.CH_ParticipantRegistration.Where(d => d.ParticipantsPostId == item.Value.Value).Select(d => d).ToList();
                        }

                        foreach (var item in data0)
                        {
                            model.Participantregistration = new List <ParticipationRegistrationModel>();
                            model.Participantregistration.Add(new ParticipationRegistrationModel()
                            {
                                Data            = item.Data,
                                OrganizerId     = item.OrganizerId,
                                ParticipantId   = item.ParticipantId,
                                EventId         = item.EventId,
                                VideoId         = item.ParticipantsPostId,
                                Name            = item.Name,
                                Qualification   = item.Qualification,
                                CollegeorSchool = item.CollegeorSchool,
                            });
                        }
                    }
                    model.aboutEventlist        = new List <AboutEvent>();
                    model.aboutParticipantslist = new List <AboutParticipants>();
                    model.importantDateslist    = new List <ImportantDates>();
                    model.awardRewardlist       = new List <AwardsAndRewards>();
                    EventsServices serviceObj = new EventsServices();

                    var Aboutevent       = serviceObj.GetRegistrationAboutEvent(SessionToken, Userid).Entity.ToList();
                    var Aboutparticipant = serviceObj.GetORegistrtionAboutParticipant(SessionToken, Userid).Entity.ToList();
                    var AwardReward      = serviceObj.GetAwardAndReward(SessionToken, Userid).Entity.ToList();
                    var impdates         = serviceObj.GetImportantDateAndTime(SessionToken, Userid).Entity.ToList();
                    model.aboutEventlist.AddRange(Aboutevent);
                    model.aboutParticipantslist.AddRange(Aboutparticipant);
                    model.importantDateslist.AddRange(impdates);
                    model.awardRewardlist.AddRange(AwardReward);
                    return(View(model));
                }
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
Exemplo n.º 13
0
        public async Task <ActionResult> OrganizeEvent(EventRegistrationfromOrganizerModel model, string status)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }
            try
            {
                OrganiserBasicDetailsServices services = new OrganiserBasicDetailsServices();
                var            eventid = Guid.Empty;
                EventsServices obj     = new EventsServices();
                tabopen        openTab = new tabopen();
                if (model.aboutEvent != null)
                {
                    if (model.aboutEvent.NameofOrganizer != null)
                    {
                        model.aboutEvent.EventId = Guid.NewGuid();

                        model.aboutEvent.OrganizerId = User.Identity.GetUserId();
                        Session["Eventid"]           = model.aboutEvent.EventId;

                        var AboutEventTab = obj.SaveRegistrationAboutEvent(SessionToken, model).Entity;
                        openTab.Default       = false;
                        openTab.AboutEvent    = true;
                        ViewBag.AboutEventTab = AboutEventTab.Result;
                        eventid = AboutEventTab.Result;
                    }
                }
                if (model.aboutParticipants != null)
                {
                    model.aboutParticipants.OrganizerId = User.Identity.GetUserId();
                    model.aboutParticipants.EventId     = (Guid)Session["Eventid"];

                    var eventParticipant = obj.SaveORegistrtionAboutParticipant(SessionToken, model).Entity;
                    openTab.AboutParticipant    = true;
                    openTab.Default             = false;
                    ViewBag.EvantParticipanttab = eventParticipant.Result;
                    eventid = eventParticipant.Result;
                }
                if (model.importantDates != null)
                {
                    model.importantDates.OrganizerId = User.Identity.GetUserId();;
                    model.importantDates.EventId     = (Guid)Session["Eventid"];
                    var importantDates = obj.SaveImportantDateAndTime(SessionToken, model);
                    ViewBag.ImportantDates = importantDates.Entity.Result;
                    openTab.Default        = false;
                    openTab.Imortantdates  = true;
                    eventid = importantDates.Entity.Result;
                }
                if (model.awardReward != null)
                {
                    model.awardReward.OrganizerId = User.Identity.GetUserId();;


                    model.awardReward.EventId = (Guid)Session["Eventid"];
                    var AwardReward = obj.SaveAwardAndReward(SessionToken, model).Entity;
                    ViewBag.AwardandReward = AwardReward.Result;
                    openTab.Default        = false;
                    openTab.Awarcreward    = true;
                    eventid = AwardReward.Result;
                }
                if (status != null)
                {
                    using (var db = new ConquerorHubEntities())
                    {
                        CH_EventRegistrationFromOrganizer data = db.CH_EventRegistrationFromOrganizer.Where(x => x.OrganizerId == model.Imagevideo.OrganizerId && x.EventId == model.Imagevideo.EventIdImageorVideo).Select(x => x).FirstOrDefault();
                        if (status == "yes")
                        {
                            data.Eventdisplayonhomepage = true;
                        }
                        else
                        {
                            data.Eventdisplayonhomepage = false;
                        }
                    }
                }
                if (model.Imagevideo != null)
                {
                    model.Imagevideo.OrganizerId         = User.Identity.GetUserId();
                    model.Imagevideo.EventIdImageorVideo = (Guid)Session["Eventid"];
                    openTab.EventVideoImage = true;
                    //openTab.AvoidDefault = true;
                    var user1 = await services.GetEventRegistrationImageVideo(SessionToken);

                    var user = user1.Where(x => x.Imagevideo.OrganizerId == model.Imagevideo.OrganizerId && x.Imagevideo.EventIdImageorVideo == model.Imagevideo.EventIdImageorVideo).Count();

                    if (model.Imagevideo.PostedImage != null)
                    {
                        MemoryStream target1 = new MemoryStream();
                        model.Imagevideo.PostedImage.InputStream.CopyTo(target1);
                        byte[] Photo = target1.ToArray();
                        model.Imagevideo.EventImage = Photo;
                        target1.Close();
                    }
                    if (user == 1)
                    {
                        byte[] bytes1;
                        using (BinaryReader br = new BinaryReader(model.Imagevideo.PostedVideo.InputStream))
                        {
                            bytes1 = br.ReadBytes(model.Imagevideo.PostedVideo.ContentLength);
                        }
                        var data = user1.Where(x => x.Imagevideo.OrganizerId == model.Imagevideo.OrganizerId && x.Imagevideo.EventIdImageorVideo == model.Imagevideo.EventIdImageorVideo).Select(x => x).FirstOrDefault();
                        EventRegistrationfromOrganizerModel detail = new EventRegistrationfromOrganizerModel();
                        detail.Imagevideo                     = new EventsImageandVideo();
                        detail.Imagevideo.EventImage          = model.Imagevideo.EventImage;
                        detail.Imagevideo.EventVideo          = bytes1;
                        detail.Imagevideo.EventIdImageorVideo = model.Imagevideo.EventIdImageorVideo;
                        detail.Imagevideo.OrganizerId         = model.Imagevideo.OrganizerId;
                        await services.SaveEventRegistrationImageVideo(SessionToken, detail);
                    }
                }



                TempData["opentab"] = openTab;

                return(RedirectToAction("OrganizeEvent", new { eventid = Session["Eventid"] }));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
Exemplo n.º 14
0
        public async Task <ActionResult> EventsPage(Guid?Userid)
        {
            if (Userid != null)
            {
                ViewBag.UserId = Userid;
            }

            else
            {
                Userid = Guid.Parse(User.Identity.GetUserId());
            }

            EventRegistrationfromOrganizerModel obj = new EventRegistrationfromOrganizerModel();

            obj.aboutEventlist        = new List <AboutEvent>();
            obj.aboutParticipantslist = new List <AboutParticipants>();
            obj.importantDateslist    = new List <ImportantDates>();
            obj.awardRewardlist       = new List <AwardsAndRewards>();
            EventsServices serviceObj = new EventsServices();
            OrganiserBasicDetailsServices services = new OrganiserBasicDetailsServices();
            var eventpost = await services.GetEventRegistrationImageVideo(SessionToken);

            obj.ImagevideoList = new List <EventsImageandVideo>();
            var basicfunctionality = new BasicFunctionalityofentireappService();
            var aspnetUser         = new ApplicationMandatoryService();
            var getSubscribeuser   = new List <EventRegistrationfromOrganizerModel>();

            if (eventpost.Count != 0)
            {
                foreach (var item in eventpost)
                {
                    obj.ImagevideoList.Add(new EventsImageandVideo()
                    {
                        EventIdImageorVideo = item.Imagevideo.EventIdImageorVideo,
                        OrganizerId         = item.Imagevideo.OrganizerId,
                        Image      = item.Imagevideo.EventImage != null ? Imageget(item.Imagevideo.EventImage) : null,
                        UserName   = aspnetUser.Getuserlist(SessionToken).Entity.FirstOrDefault(x => x.Id == item.Imagevideo.OrganizerId).UserName,
                        Profilepic = Imageget(basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == item.Imagevideo.OrganizerId) == null ? null : basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == item.Imagevideo.OrganizerId).ProfilePicData)
                    });
                }
            }
            try
            {
                var Aboutevent       = serviceObj.GetRegistrationAboutEvent(SessionToken, Userid).Entity.ToList();
                var Aboutparticipant = serviceObj.GetORegistrtionAboutParticipant(SessionToken, Userid).Entity.ToList();
                var AwardReward      = serviceObj.GetAwardAndReward(SessionToken, Userid).Entity.ToList();
                var impdates         = serviceObj.GetImportantDateAndTime(SessionToken, Userid).Entity.ToList();


                obj.aboutEventlist.AddRange(Aboutevent);
                obj.aboutParticipantslist.AddRange(Aboutparticipant);
                obj.importantDateslist.AddRange(impdates);
                obj.awardRewardlist.AddRange(AwardReward);
                if (obj == null)
                {
                    return(View());
                }
                return(View(obj));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
Exemplo n.º 15
0
        public async Task <ActionResult> PastEventsPerformance(Guid?Userid, Guid?EventId)
        {
            if (Userid != null)
            {
                ViewBag.UserId = Userid;
            }
            else
            {
                Userid = Guid.Parse(User.Identity.GetUserId());
            }

            ParticipantsDetailModel model = new ParticipantsDetailModel();

            model.Participantregistration = new List <ParticipationRegistrationModel>();
            var data1  = new BasicFunctionalityofentireappService();
            var result = data1.GetTotalVoteperPost(SessionToken).Entity;

            model.voterslist = new List <VotesModel>();


            model.aboutEventlist        = new List <AboutEvent>();
            model.aboutParticipantslist = new List <AboutParticipants>();
            model.importantDateslist    = new List <ImportantDates>();
            model.awardRewardlist       = new List <AwardsAndRewards>();
            EventsServices serviceObj = new EventsServices();

            try
            {
                var Aboutevent       = serviceObj.GetRegistrationAboutEvent(SessionToken, Userid).Entity.Where(x => x.EventStatus == 5).ToList();
                var Aboutparticipant = serviceObj.GetORegistrtionAboutParticipant(SessionToken, Userid).Entity.Where(x => x.EventStatus == 5).ToList();
                var AwardReward      = serviceObj.GetAwardAndReward(SessionToken, Userid).Entity.Where(x => x.EventStatus == 5).ToList();
                var impdates         = serviceObj.GetImportantDateAndTime(SessionToken, Userid).Entity.Where(x => x.EventStatus == 5).ToList();
                model.aboutEventlist.AddRange(Aboutevent);
                model.aboutParticipantslist.AddRange(Aboutparticipant);
                model.importantDateslist.AddRange(impdates);
                model.awardRewardlist.AddRange(AwardReward);
                var eventid = Aboutevent.Select(x => x.EventId);
                OrganiserBasicDetailsServices obj1 = new OrganiserBasicDetailsServices();
                var data  = new List <ParticipationRegistrationModel>();
                var data2 = await obj1.GetParticipantRegistration(SessionToken);

                data.AddRange(data2.Where(x => x.OrganizerId == Userid.ToString() && x.EventId == EventId).Select(x => x).ToList());
                var ImageorVideo1 = await obj1.GetEventRegistrationImageVideo(SessionToken);

                var ImageorVideo = ImageorVideo1.Where(x => x.Imagevideo.EventIdImageorVideo == EventId).Select(x => x.Imagevideo.imageorvideo).FirstOrDefault();

                model.Participantregistration = new List <ParticipationRegistrationModel>();
                if (data.Count() != 0)
                {
                    foreach (var item in data)
                    {
                        model.Participantregistration.Add(new ParticipationRegistrationModel()
                        {
                            Data            = ImageorVideo == 2 ? item.Data : null,
                            Images          = ImageorVideo == 1 ? Imageget(item.Data) : null,
                            OrganizerId     = item.OrganizerId,
                            ParticipantId   = item.ParticipantId,
                            EventId         = item.EventId,
                            VideoId         = item.VideoId,
                            Name            = item.Name,
                            Qualification   = item.Qualification,
                            CollegeorSchool = item.CollegeorSchool,
                            ContentType     = item.ContentType,
                        });
                    }
                }



                return(View(model));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
Exemplo n.º 16
0
        public HttpResponseMessage ClaimEarnings(ClaimEarningsRequest request)
        {
            ClaimEarningsResponse responseData = null;

            try
            {
                //Authenticate API key
                long?hostId = HostServices.GetCallerHostId();
                if (!hostId.HasValue)
                {
                    Log.Warn(ResponseMessages.InvalidAPIKey);
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidAPIKey, ResponseMessages.InvalidAPIKey)));
                }

                //Validate input
                if (request == null ||
                    string.IsNullOrEmpty(request.ReferenceId))
                {
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.InvalidParam, ResponseMessages.InvalidParam)));
                }

                //Perform transaction
                EventsServices eventsService = new EventsServices();
                string         status        = null;
                responseData = eventsService.ClaimEarnings(hostId.Value, request, out status);

                if (status == ClaimEarningsStatuses.EventNotFound)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ClaimEarningsStatuses.EventNotFound, "EventNotFound")));
                }
                else if (status == ClaimEarningsStatuses.EventNotStarted)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ClaimEarningsStatuses.EventNotStarted, "Event has not started. Event start date must be over before earnings for the event can be claimed.")));
                }
                else if (status == ClaimEarningsStatuses.EventAlreadyClaimed)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ClaimEarningsStatuses.EventAlreadyClaimed, "EventAlreadyClaimed")));
                }
                else if (status == ClaimEarningsStatuses.EventAlreadyCancelled)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ClaimEarningsStatuses.EventAlreadyCancelled, "EventAlreadyCancelled")));
                }
                else if (status == ClaimEarningsStatuses.HostNotFound)
                {
                    return(Request.CreateResponse(new GenericResponse(null, ClaimEarningsStatuses.HostNotFound, "HostNotFound")));
                }
                else if (status == ClaimEarningsStatuses.Success)
                {
                    return(Request.CreateResponse(new GenericResponse(responseData, ResponseCodes.Success, ResponseMessages.Success)));
                }
                else
                {
                    Log.Error("Unrecognized status: " + status);
                    return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.Error, ResponseMessages.Error)));
                }
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
                return(Request.CreateResponse(new GenericResponse(null, ResponseCodes.Error, ResponseMessages.Error)));
            }
        }
        public async Task <ActionResult> ParticipantProfile(Guid?userid)
        {
            if (userid != null)
            {
                ViewBag.UserId = userid;
                var usertype = UserManager.FindById(userid.ToString()).Usertype;
                if (usertype == 1)
                {
                    return(RedirectToAction("Home", "OrganizerBasicDetails", new { UserId = userid }));
                }
            }
            else if (userid == null)
            {
                userid = new Guid(User.Identity.GetUserId());
                var usertype = UserManager.FindById(User.Identity.GetUserId()).Usertype;
                if (usertype == 1)
                {
                    return(RedirectToAction("Home", "OrganizerBasicDetails"));
                }
            }

            var basicfunctionality = new BasicFunctionalityofentireappService();
            var aspnetUser         = new ApplicationMandatoryService();
            HomePageViewModel obj  = new HomePageViewModel();

            obj.aboutEventlist         = new List <AboutEvent>();
            obj.aboutParticipantslist1 = new List <AboutParticipants>();
            obj.importantDateslist1    = new List <ImportantDates>();
            obj.awardRewardlist1       = new List <AwardsAndRewards>();
            EventsServices serviceObj  = new EventsServices();
            var            commentlist = basicfunctionality.GetcommentCount(SessionToken).Entity.Where(y => y.DestinationUserId == UserId.ToString()).Select(x => x).ToList();
            var            rsult       = basicfunctionality.GetTotalLikesOfPost(SessionToken).Entity.Where(y => y.DestinationUserId == UserId.ToString()).Select(x => x).ToList();
            Sponsor1       sp          = new Sponsor1();

            obj.sponsorSingleData             = new Sponsor1();
            obj.sponsorSingleData.LikeList    = new List <LikesModel>();
            obj.sponsorSingleData.commentList = new List <CommentModel>();
            obj.sponsorSingleData.commentList.AddRange(commentlist);
            obj.sponsorSingleData.LikeList.AddRange(rsult);
            var services = new OrganiserBasicDetailsServices();
            var status1  = await services.GetEventRegistrationImageVideo(SessionToken);

            var status = status1.Where(x => x.Imagevideo.OrganizerId == UserId.ToString() && x.Imagevideo.EventStatus == 1).Select(x => x).ToList();

            obj.EventRegistration = new List <EventRegistrationfromOrganizerModel>();


            foreach (var item in status)
            {
                try
                {
                    // obj.aboutEventlist.Add(serviceObj.GetRegistrationAboutEvent(SessionToken, UserId).Entity.Where(x => x.EventId == item.Imagevideo.EventId && x.EventStatus==1).FirstOrDefault());
                    //obj.aboutParticipantslist1.Add(serviceObj.GetORegistrtionAboutParticipant(SessionToken, UserId).Entity.Where(x => x.EventId == item.Imagevideo.EventId && x.EventStatus == 1).FirstOrDefault());
                    // obj.awardRewardlist1.Add(serviceObj.GetAwardAndReward(SessionToken, UserId).Entity.Where(x => x.EventId == item.Imagevideo.EventId && x.EventStatus == 1).FirstOrDefault());
                    //obj.importantDateslist1.Add(serviceObj.GetImportantDateAndTime(SessionToken, UserId).Entity.Where(x => x.EventId == item.Imagevideo.EventId && x.EventStatus == 1).FirstOrDefault());

                    obj.EventRegistration.Add(new EventRegistrationfromOrganizerModel()
                    {
                        Imagevideo = new EventsImageandVideo()
                        {
                            EventIdImageorVideo = item.Imagevideo.EventIdImageorVideo,
                            OrganizerId         = item.Imagevideo.OrganizerId,
                            Image            = item.Imagevideo.EventImage != null ? Imageget(item.Imagevideo.EventImage) : null,
                            EventVideo       = item.Imagevideo.EventVideo,
                            imageorvideo     = item.Imagevideo.imageorvideo,
                            Homedisplayevent = item.Imagevideo.Homedisplayevent,
                            EventStatus      = item.Imagevideo.EventStatus,
                            Profilepic       = Imageget(basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()) == null ? null : basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()).ProfilePicData)
                        }
                    });
                }
                catch (Exception ex)
                {
                    return(View("~/Views/Errorpage/Errorpage.cshtml"));
                }
            }



            obj.Sharedata = new List <ShareModel>();

            var PostId = new List <Guid?>();
            var data   = new BasicFunctionalityofentireappService();

            var result = data.GetTotalShare(SessionToken).Entity;

            if (result != null)
            {
                obj.Sharedata = result.Where(x => x.DestinationPage == UserId.ToString()).Select(x => x).ToList() == null ? null : result.Where(x => x.DestinationPage == UserId.ToString()).Select(x => x).ToList();
                if (obj.Sharedata.Count() != 0)
                {
                    var xyz = obj.Sharedata.Select(x => x.PostId).ToList();
                    PostId         = xyz;
                    ViewBag.Postid = PostId;
                }
                else
                {
                    ViewBag.Postid = null;
                }
            }


            //Get sponsored shred data
            var sponsorlist = services.GetSponsorList(SessionToken, UserId);

            obj.sponsorMultipleData         = new List <Sponsor1>();
            obj.sponsorSingleData.sharelist = new List <ShareModel>();
            if (result != null)
            {
                obj.sponsorSingleData.sharelist.AddRange(result);
            }
            var sponsortemp = new List <Sponsor1>();

            if (ViewBag.Postid != null)
            {
                if (sponsorlist.Entity.Count != 0)
                {
                    foreach (var item in ViewBag.Postid)
                    {
                        sponsortemp.AddRange(sponsorlist.Entity.Where(a => a.ImageId == item).Select(a => a).ToList());
                    }
                    foreach (var item in sponsortemp)
                    {
                        obj.sponsorMultipleData.Add(new Sponsor1()
                        {
                            Id          = item.Id,
                            Image       = item.Image,
                            Image1      = Imageget(item.Image),
                            ImageId     = item.ImageId,
                            UserName    = aspnetUser.Getuserlist(SessionToken).Entity.FirstOrDefault(x => x.Id == (UserId.ToString() == null ? User.Identity.GetUserId() : UserId.ToString())).UserName,
                            Caption     = item.Caption,
                            DateandTime = item.DateandTime,
                            UserId      = User.Identity.GetUserId(),
                            profilepic  = Imageget(basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()) == null ? null : basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()).ProfilePicData)
                        });
                    }
                }
            }
            //get participant gallery post shared
            obj.GalleryList = new List <GalleryModel>();
            var participantGalleryList = await services.GetParticipantGallerydata(SessionToken);

            var listtemp = new List <GalleryModel>();

            if (ViewBag.Postid != null)
            {
                if (participantGalleryList.Count != 0)
                {
                    foreach (var item in ViewBag.Postid)
                    {
                        listtemp.AddRange(participantGalleryList.Where(a => a.PostId == item && a.UserId == UserId.ToString()).Select(a => a).ToList());
                    }
                    foreach (var item in listtemp)
                    {
                        obj.GalleryList.Add(new GalleryModel()
                        {
                            Id          = item.Id,
                            Image       = item.ImageData == null ? null : Imageget(item.ImageData),
                            Caption     = item.Caption,
                            UserId      = item.UserId,
                            PostId      = item.PostId,
                            VideoData   = item.VideoData,
                            ContentType = item.ContentType,
                            UserName    = aspnetUser.Getuserlist(SessionToken).Entity.FirstOrDefault(x => x.Id == (ViewBag.UserId as string == null ? User.Identity.GetUserId() : ViewBag.UserId as string)).UserName,
                            Profilepic  = Imageget(basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()) == null ? null : basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == item.UserId).ProfilePicData)
                        });
                    }
                }
            }

            var participantRegistration = await services.GetParticipantRegistration(SessionToken);

            var participantregdata = new List <ParticipationRegistrationModel>();

            obj.Participantregistration = new List <ParticipationRegistrationModel>();
            string extension = "";

            if (ViewBag.Postid != null)
            {
                if (participantRegistration.Count != 0)
                {
                    foreach (var item in ViewBag.Postid)
                    {
                        participantregdata.AddRange(participantRegistration.Where(x => x.VideoId == item).Select(x => x).ToList());
                    }

                    foreach (var item in participantregdata)
                    {
                        extension = item.ContentType.Split('.').Last();
                        obj.Participantregistration.Add(new ParticipationRegistrationModel()
                        {
                            Data            = extension == "mp4" ? item.Data : null,
                            Images          = extension != "mp4" ? Imageget(item.Data) : null,
                            OrganizerId     = item.OrganizerId,
                            ParticipantId   = item.ParticipantId,
                            EventId         = item.EventId,
                            VideoId         = item.VideoId,
                            Name            = item.Name,
                            Qualification   = item.Qualification,
                            CollegeorSchool = item.CollegeorSchool,
                            UserName        = aspnetUser.Getuserlist(SessionToken).Entity.FirstOrDefault(x => x.Id == (UserId.ToString() == null ? User.Identity.GetUserId() : UserId.ToString())).UserName,
                            Profilepic      = Imageget(basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()) == null ? null : basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()).ProfilePicData)
                        });
                    }
                }
            }
            obj.homeList = new List <Home>();
            var data4 = await services.GetHomePage(SessionToken);

            var homeData = new List <Home>();

            if (ViewBag.Postid != null)
            {
                if (data4.Count != 0)
                {
                    foreach (var item in ViewBag.Postid)
                    {
                        homeData.AddRange(data4.Where(x => x.Postid == item).Select(x => x).ToList());
                    }
                    foreach (var item in homeData)
                    {
                        obj.homeList.Add(new Home()
                        {
                            Id         = item.Id,
                            UserId     = item.UserId,
                            PostText   = item.PostText,
                            Image2     = item.Image == null ? null : Imageget(item.Image),
                            Video      = item.Video,
                            DateTime   = item.DateTime,
                            UserName   = aspnetUser.Getuserlist(SessionToken).Entity.FirstOrDefault(x => x.Id == (UserId.ToString() == null ? User.Identity.GetUserId() : UserId.ToString())).UserName,
                            Profilepic = Imageget(basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()) == null ? null : basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()).ProfilePicData),
                            Postid     = item.Postid
                        });
                    }
                }
            }

            obj.Imagevideolist = new List <EventsImageandVideo>();
            var data5 = await services.GetEventRegistrationImageVideo(SessionToken);

            var eventData = new List <EventRegistrationfromOrganizerModel>();

            if (ViewBag.Postid != null)
            {
                if (data5.Count != 0)
                {
                    foreach (var item in ViewBag.Postid)
                    {
                        eventData.AddRange(data5.Where(x => x.Imagevideo.EventIdImageorVideo == item).Select(x => x).ToList());
                    }
                    foreach (var item in eventData)
                    {
                        obj.Imagevideolist.Add(new EventsImageandVideo()
                        {
                            EventIdImageorVideo = item.Imagevideo.EventIdImageorVideo,
                            OrganizerId         = item.Imagevideo.OrganizerId,
                            Image      = item.Imagevideo.EventImage == null ? null : Imageget(item.Imagevideo.EventImage),
                            EventVideo = item.Imagevideo.EventVideo,



                            UserName   = aspnetUser.Getuserlist(SessionToken).Entity.FirstOrDefault(x => x.Id == (UserId.ToString() == null ? User.Identity.GetUserId() : UserId.ToString())).UserName,
                            Profilepic = Imageget(basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()) == null ? null : basicfunctionality.GetMainPhotos(SessionToken).Entity.FirstOrDefault(x => x.UserId == User.Identity.GetUserId()).ProfilePicData),
                        });
                    }
                }
            }


            return(View(obj));
        }