Exemplo n.º 1
0
        public async Task <ActionResult> SaveOngoingEventParticipant(ParticipationRegistrationModel model)
        {
            model.ParticipantId = User.Identity.GetUserId();

            OrganiserBasicDetailsServices obj = new OrganiserBasicDetailsServices();
            string data = await obj.SavePerformanceFromparticipants(SessionToken, model);

            TempData["msg"] = data;

            return(RedirectToAction("Uploadvideo", new { Eventid = model.EventId, OrganizerId = model.OrganizerId }));
        }
Exemplo n.º 2
0
        public ActionResult UpdateParticipantStatus(String Status, Guid?Eventid, string UserId)
        {
            var obj   = new ParticipantServices();
            var email = UserManager.FindById(UserId).Email;
            ParticipationRegistrationModel data = new ParticipationRegistrationModel();

            if (Status == "Accept")
            {
                data.ParticipantStatus = 3;
                data.EventId           = Eventid;
                data.OrganizerId       = User.Identity.GetUserId();
                MailMessage mail = new MailMessage();
                mail.To.Add(email);
                mail.From       = new MailAddress("*****@*****.**");
                mail.Subject    = "Regarding Performance Status";;
                mail.Body       = "Your performance is selected to next level of competition";
                mail.IsBodyHtml = true;
                SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
                smtp.EnableSsl             = true;
                smtp.UseDefaultCredentials = false;
                smtp.Credentials           = new System.Net.NetworkCredential("*****@*****.**", "PREMA44LATHA");
                smtp.Send(mail);
            }
            else if (Status == "Reject")
            {
                data.ParticipantStatus = 4;
                data.EventId           = Eventid;
                data.OrganizerId       = User.Identity.GetUserId();
                MailMessage mail = new MailMessage();
                mail.To.Add(email);
                mail.From       = new MailAddress("*****@*****.**");
                mail.Subject    = "Regarding Performance Status";;
                mail.Body       = "Your performance is rejected,Don't be disheartened.BETTER LUCK NEXT TIME";
                mail.IsBodyHtml = true;
                SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
                smtp.EnableSsl             = true;
                smtp.UseDefaultCredentials = false;
                smtp.Credentials           = new System.Net.NetworkCredential("*****@*****.**", "PREMA44LATHA");
                smtp.Send(mail);
            }
            try
            {
                var result = obj.UpdatePArticipantStatus(SessionToken, data);

                return(RedirectToAction("RegisteredParticipantsfortheevent", new { EventId = Eventid }));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
        public async Task <FileResult> DownloadFile(Guid?VideoID)
        {
            var result = new ParticipationRegistrationModel();

            try
            {
                OrganiserBasicDetailsServices obj1 = new OrganiserBasicDetailsServices();
                var result1 = await obj1.GetParticipantRegistration(SessionToken);

                result = result1.ToList().Find(x => x.VideoId == VideoID);

                return(File(result.Data, result.ContentType, result.FileName));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        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.º 5
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"));
            }
        }
        public ActionResult ParticipantRegistration(ParticipationRegistrationModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }
            model.ParticipantId = User.Identity.GetUserId();


            ParticipantServices obj = new ParticipantServices();

            try
            {
                var result = obj.SaveParticipantsregistration(SessionToken, model).Entity.Result;
                TempData["ReturnedValue"] = result;
                return(RedirectToAction("ParticipantRegistration", new { EventId = model.EventId, Userid = model.OrganizerId }));
            }
            catch (Exception ex)
            {
                return(View("~/Views/Errorpage/Errorpage.cshtml"));
            }
        }
        public async Task <string> SavePerformanceFromparticipants(string sessionToken, ParticipationRegistrationModel model)
        {
            using (var db = new ConquerorHubEntities())
            {
                try
                {
                    var data1        = 0;
                    var ImageorVideo = db.CH_EventRegistrationFromOrganizer.Where(x => x.EventId == model.EventId).Select(x => x.ImageorVideoforEvent).FirstOrDefault();
                    var data         = db.CH_ParticipantRegistration.Where(x => x.OrganizerId == model.OrganizerId && x.EventId == model.EventId).Count();
                    var model2       = db.CH_ParticipantRegistration.Where(x => x.OrganizerId == model.OrganizerId && x.EventId == model.EventId).FirstOrDefault();
                    if (ImageorVideo == 2)
                    {
                        byte[] bytes1;
                        using (BinaryReader br = new BinaryReader(model.PostedFile.InputStream))
                        {
                            bytes1 = br.ReadBytes(model.PostedFile.ContentLength);
                        }
                        if (data > 0)
                        {
                            model2.ContentType        = Path.GetFileName(model.PostedFile.FileName);
                            model2.FileName           = Path.GetFileName(model.PostedFile.FileName);
                            model2.Data               = bytes1;
                            model2.ParticipantsPostId = Guid.NewGuid();
                            model2.ParticipantStatus  = 2;
                        }
                        try
                        {
                            db.Entry(model2).State = EntityState.Modified;

                            data1 = db.SaveChanges();
                        }
                        catch (Exception ex)
                        {
                            throw ex;
                        }


                        if (data1 == 1)
                        {
                            return(await Task.FromResult("Your Video is uploaded you'll get email if you are shortlisted"));
                        }
                    }
                    else if (ImageorVideo == 1)
                    {
                        if (model.PostedFile != null)
                        {
                            MemoryStream target1 = new MemoryStream();
                            model.PostedFile.InputStream.CopyTo(target1);
                            byte[] Photo = target1.ToArray();
                            model.Data = Photo;
                            target1.Close();
                        }
                        if (data > 0)
                        {
                            model2.ContentType        = Path.GetFileName(model.PostedFile.FileName);
                            model2.FileName           = Path.GetFileName(model.PostedFile.FileName);
                            model2.Data               = model.Data;
                            model2.ParticipantsPostId = Guid.NewGuid();
                            model2.ParticipantStatus  = 2;
                        }
                        try
                        {
                            db.Entry(model2).State = EntityState.Modified;

                            data1 = db.SaveChanges();
                        }
                        catch (Exception ex)
                        {
                            throw ex;
                        }


                        if (data1 == 1)
                        {
                            return(await Task.FromResult("Your Image is uploaded you'll get email if you are shortlisted"));
                        }
                    }
                    try
                    {
                        db.Entry(model2).State = EntityState.Modified;

                        db.SaveChanges();
                    }
                    catch (Exception ex)
                    {
                        throw;
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                return(await Task.FromResult(""));
            }
        }
Exemplo n.º 8
0
 public RequestResult <ParticipationRegistrationModel> SaveParticipantsregistration(string sessionToken, ParticipationRegistrationModel model)
 {
     try
     {
         string parameters    = $"/participants/saveparticipantsregistration?sessionToken={sessionToken}";
         var    serilizedData = JsonConvert.SerializeObject(model);
         return(PostAndGetData <RequestResult <ParticipationRegistrationModel> >(sessionToken, parameters, serilizedData));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public RequestResult <ParticipationRegistrationModel> UpdatePArticipantStatus(string sessionToken, ParticipationRegistrationModel model)
 {
     try
     {
         var result = _repository.UpdatePArticipantStatus(sessionToken, model);
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 10
0
 public RequestResult <ParticipationRegistrationModel> SaveParticipantsregistration(string sessionToken, ParticipationRegistrationModel model)
 {
     model.Id = Guid.NewGuid();
     try
     {
         var result = _repository.SaveParticipantsregistration(sessionToken, model);
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }