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")); } }
// 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")); } }
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")); } }
public RequestResult <AboutParticipants> SaveRegistrationAboutParticipant(string sessionToken, EventRegistrationfromOrganizerModel userSession) { string parameters = $"/Events/SaveOregisteredAboutparticipant?sessionToken={sessionToken}"; try { var serilizedData = JsonConvert.SerializeObject(userSession.aboutParticipants); //string parameters = $"/usersecurity/saveuserdetails?sessionToken={sessionToken}&Userdetail={serilizedData}"; return(PostAndGetData <RequestResult <AboutParticipants> >(null, parameters, serilizedData)); } catch (Exception ex) { throw ex; } }
public RequestResult <AwardsAndRewards> SaveAwardAndReward(string sessionToken, EventRegistrationfromOrganizerModel userSession) { string parameters = $"/Events/saveOAwardsandRewards?sessionToken={sessionToken}"; try { var serilizedData = JsonConvert.SerializeObject(userSession.awardReward); //string parameters = $"/usersecurity/saveuserdetails?sessionToken={sessionToken}&Userdetail={serilizedData}"; return(PostAndGetData <RequestResult <AwardsAndRewards> >(null, parameters, serilizedData)); } catch (Exception ex) { throw ex; } }
public RequestResult <AboutEvent> SaveRegistrationABoutEvent(string sessionToken, EventRegistrationfromOrganizerModel userSession) { string parameters = $"/Events/saveOregisteredAboutevent?sessionToken={sessionToken}"; try { var serilizedData = JsonConvert.SerializeObject(userSession.aboutEvent); return(PostAndGetData <RequestResult <AboutEvent> >(null, parameters, serilizedData)); } catch (Exception ex) { throw ex; } }
public RequestResult <ImportantDates> SaveImportantDatesofRegistration(string sessionToken, EventRegistrationfromOrganizerModel userSession) { string parameters = $"/Events/saveOimportantdates?sessionToken={sessionToken}"; try { var serilizedData = JsonConvert.SerializeObject(userSession.importantDates); return(PostAndGetData <RequestResult <ImportantDates> >(null, parameters, serilizedData)); } catch (Exception ex) { throw ex; } }
public async Task <Guid> SaveEventRegistrationImageVideo(string sessionToken, EventRegistrationfromOrganizerModel model) { using (var db = new ConquerorHubEntities()) { try { var data = db.CH_EventRegistrationFromOrganizer.Where(x => x.OrganizerId == model.Imagevideo.OrganizerId && x.EventId == model.Imagevideo.EventIdImageorVideo).Select(x => x).FirstOrDefault(); data.EventImage = model.Imagevideo.EventImage; data.EventVideo = model.Imagevideo.EventVideo; try { db.Entry(data).State = EntityState.Modified; db.SaveChanges(); } catch (Exception ex) { throw; } return(await Task.FromResult(Guid.NewGuid())); } catch (Exception ex) { throw ex; } } }
public RequestResult <ImportantDates> SaveImportantDateAndTime(string sessionToken, EventRegistrationfromOrganizerModel model) { try { var result = _repository.SaveImportantDatesofRegistration(sessionToken, model); return(result); } catch (Exception ex) { throw ex; } }
public RequestResult <AboutParticipants> SaveORegistrtionAboutParticipant(string sessionToken, EventRegistrationfromOrganizerModel model) { try { var result = _repository.SaveRegistrationAboutParticipant(sessionToken, model); return(result); } catch (Exception ex) { throw ex; } }
public RequestResult <AwardsAndRewards> SaveAwardAndReward(string sessionToken, EventRegistrationfromOrganizerModel model) { try { var result = _repository.SaveAwardAndReward(sessionToken, model); return(result); } catch (Exception ex) { throw ex; } }
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")); } }
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")); } }