public ActionResult ParticipantRegister(kartoteka2 kartotekaModel)
 {
     if (kartotekaModel != null)
     {
         var result = ikartoteka2.getInformationAboutOneParticipantFromKartoteka2(
             ikartoteka2,
             kartotekaModel.kart_imie,
             kartotekaModel.kart_nazwisko,
             kartotekaModel.kart_email);
         if (result.kart_wpis_oplata == false || result.kart_wpis_oplata == null)
         {
             istoredP.pStartinPayment(kartotekaModel.kart_imie, kartotekaModel.kart_nazwisko, kartotekaModel.kart_email);
             istoredP.pInitializationAllParticipnat();
             return(RedirectToAction("ListOfRegistering", "RegistrationParticipant", new { surname = kartotekaModel.kart_nazwisko }));
         }
         else
         {
             return(RedirectToAction("ListOfRegistering", "RegistrationParticipant", new { surname = "" }));
         }
     }
     else
     {
         return(RedirectToAction("ListOfRegistering", "RegistrationParticipant", new { surname = "" }));
     }
 }
Пример #2
0
 public bool pKartotekaZawodnikaDodaj(kartoteka2 _kart)
 {
     if (_icheck.getTimeAndVerification(_kart.kart_imie, _kart.kart_nazwisko, _kart.kart_email))
     {
         return(addParticipantWithoutTimeRegistrationVerification(_kart));
     }
     else
     {
         return(false);
     }
 }
Пример #3
0
        public kartoteka2 getEmptyResult()
        {
            kartoteka2 result = new kartoteka2()
            {
                kart_imie     = "brak danych",
                kart_nazwisko = "brak danych",
                kart_email    = "brak danych"
            };

            return(result);
        }
Пример #4
0
        public bool addParticipantWithoutTimeRegistrationVerification(kartoteka2 kart)
        {
            using (var db = new EntitiesRegistrationParticipant())
            {
                db.pKartotekaZawodnikaDodaj(kart.kart_imie, kart.kart_nazwisko, kart.kart_email,
                                            kart.kart_dataUr, kart.plec_id, kart.kart_telefon, kart.kart_uwagi,
                                            kart.dys_id, kart.grup_id, true, true);
                db.SaveChanges();

                return(true);
            }
        }
 public ActionResult AddPArticipant(kartoteka2 kartotekaModel, int dys_id)
 {
     if (isimpleAdd.AddNewParticipant(kartotekaModel.kart_imie, kartotekaModel.kart_nazwisko, kartotekaModel.kart_email, dys_id))
     {
         istoredP.pStartinPayment(kartotekaModel.kart_imie, kartotekaModel.kart_nazwisko, kartotekaModel.kart_email);
         istoredP.pInitializationAllParticipnat();
         return(RedirectToAction("ListOfRegistering", "RegistrationParticipant", new { surname = kartotekaModel.kart_nazwisko }));
     }
     else
     {
         return(RedirectToAction("ListOfRegistering", "RegistrationParticipant", new { surname = "błąd dodawania" }));
     }
 }
        public kartoteka2 createNewRecord(string imie, string nazwisko, string email, string dataUr, int?plec, string telefon, string uwagi, int?dys, int?group)
        {
            kartoteka2 result = new kartoteka2
            {
                kart_id       = 1003,
                kart_imie     = imie,
                kart_nazwisko = nazwisko,
                kart_email    = email,
                dys_id        = 1
            };

            return(result);
        }
Пример #7
0
        public kartoteka2 createNewRecord(string imie, string nazwisko, string email, string dataUr, int?plec, string telefon, string uwagi, int?dys, int?group)
        {
            kartoteka2 _kart = new kartoteka2();

            _kart.kart_imie     = imie;
            _kart.kart_nazwisko = nazwisko;
            _kart.kart_email    = email;
            _kart.kart_dataUr   = DateTime.Parse(dataUr.Length == 0 ? "1940-01-01" : dataUr);
            _kart.kart_telefon  = telefon;
            _kart.kart_uwagi    = uwagi;
            _kart.plec_id       = plec;
            _kart.dys_id        = dys;
            _kart.grup_id       = group;
            return(_kart);
        }
 public bool searchPlayer(kartoteka2 kart)
 {
     using (var db = new EntitiesRegistrationParticipant())
     {
         var result = db.kartoteka2
                      .Where(x => x.kart_imie == kart.kart_imie && x.kart_nazwisko == kart.kart_nazwisko && x.kart_email == kart.kart_email).ToList();
         if (result.Any())
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
        public bool searchPlayer(kartoteka2 kart)
        {
            kartoteka2 result = new kartoteka2
            {
                kart_imie     = "testName",
                kart_nazwisko = "testSname",
                kart_email    = "*****@*****.**",
            };

            if (kart.kart_email == result.kart_email && kart.kart_imie == result.kart_imie && kart.kart_nazwisko == result.kart_nazwisko)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public ActionResult Register(kartoteka2 kartoteka)
 {
     if (!ModelState.IsValid)
     {
         return(Register(kartoteka));
     }
     else
     {
         if (_iplayer.searchPlayer(kartoteka))
         {
             return(RedirectToAction("info1", new { messageWindow = "Taki zawodnik jest już zarejestrowany." }));
         }
         else
         {
             Session["kartoteka"] = kartoteka;
             return(RedirectToAction("VerificationNumber", "VerificationEmail", new { visibleTrue = false }));
         }
     }
 }
Пример #11
0
        public ActionResult VerificationNumber(bool visibleTrue, string errorMessage)
        {
            int        randomNumber = -1;
            kartoteka2 kartoteka    = new kartoteka2();

            if (Session["kartoteka"] != null)
            {
                kartoteka = (kartoteka2)Session["kartoteka"];
            }
            else
            {
                return(RedirectToAction("Register", "Registration"));
            }

            if (visibleTrue == true)
            {
                if (Session["randomValue"] != null)
                {
                    randomNumber = (int)Session["randomValue"];
                }
                ViewBag.visibleTrue  = visibleTrue;
                ViewBag.errorMessage = errorMessage;
            }
            else
            {
                randomNumber = _isendingVer.sendEmailToVerification(kartoteka.kart_email, kartoteka.kart_nazwisko, kartoteka.kart_imie);
            }

            if (randomNumber > 0)
            {
                Session["randomValue"] = randomNumber;
                ViewBag.imie           = kartoteka.kart_imie;
                ViewBag.nazwisko       = kartoteka.kart_nazwisko;
                ViewBag.email          = kartoteka.kart_email;
                return(View(kartoteka));
            }
            else
            {
                return(RedirectToAction("info2", new { messageWindow = "Adres Email nie poprawny" }));
            }
        }
Пример #12
0
 public ActionResult VerificationNumber(int _number, kartoteka2 _kart)
 {
     try
     {
         int _randomNumber = Session["randomValue"] == null ? 0 : int.Parse(Session["randomValue"].ToString());
         if ((_randomNumber > 0) && (_number == _randomNumber))
         {
             if (_iaddZaw.pKartotekaZawodnikaDodaj(_kart))
             {
                 _isendingEnd.sendWelcomeEmail(_kart.kart_imie, _kart.kart_nazwisko, _kart.kart_email);
                 ViewBag.visibleTrue = true;
                 return(RedirectToAction("RegistrationList", "RegistrationListUser"));
             }
             else
             {
                 ViewBag.visibleTrue = true;
                 _ierorBase.addExceptionToBase("przekroczono limit czasu: " + _kart.kart_email + " " + _kart.kart_nazwisko, "weryfikacja numeru");
                 return(RedirectToAction("VerificationNumber", "VerificationEmail", new { visibleTrue = true, errorMessage = getSystemMessage(1) }));
             }
         }
         else
         {
             ViewBag.visibleTrue = true;
             _ierorBase.addExceptionToBase("niezgodność numeru: " + _kart.kart_email + " " + _kart.kart_nazwisko, "weryfikacja numeru");
             return(RedirectToAction("VerificationNumber", "VerificationEmail", new { visibleTrue = true, errorMessage = getSystemMessage(2) }));
         }
     }
     catch (Exception ex)
     {
         if (ex.InnerException != null)
         {
             _iUexecp.setUniqueEcxeption("Rejestracja", ex.InnerException.Message);
         }
         _ierorBase.addExceptionToBase(ex.Message, "weryfikacja numeru");
         _ierorBase.addExceptionToBase("brak unikalności : " + _kart.kart_email + " " + _kart.kart_nazwisko, "weryfikacja numeru");
         return(RedirectToAction("VerificationNumber", "VerificationEmail", new { visibleTrue = true, errorMessage = getSystemMessage(3) }));
     }
 }
Пример #13
0
        public void addTestDataTokartoteka()
        {
            try
            {
                using (var db = new EntitiesRegistrationParticipant())
                {
                    Random _gr = new Random();
                    Random _ds = new Random();


                    kartoteka2 test1 = new kartoteka2();
                    for (int i = 0; i < 30; i++)
                    {
                        test1.grup_id              = _gr.Next(1, 3);
                        test1.kart_imie            = RandomStringNameDictionary();
                        test1.kart_nazwisko        = RandomStringSurnameDictionary(6, "");
                        test1.kart_email           = RandomStringEmailDictionary(6, "");
                        test1.dys_id               = _ds.Next(1, 7);
                        test1.plec_id              = 1;
                        test1.kart_dataUr          = DateTime.Parse("1981-09-01");
                        test1.kart_telefon         = "123456789";
                        test1.kart_uwagi           = "test";
                        test1.kart_dataRej         = DateTime.Now;
                        test1.kart_wpis_rejestacja = true;
                        test1.kart_wpis_oplata     = false;
                        test1.kart_wpis_rezerwowa  = true;
                        db.kartoteka2.Add(test1);
                        db.SaveChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                string er = ex.InnerException.Message;
            }
        }
 public bool pKartotekaZawodnikaDodaj(kartoteka2 kart)
 {
     return(false);
 }
 public bool addParticipantWithoutTimeRegistrationVerification(kartoteka2 kart)
 {
     return(true);
 }