Beispiel #1
0
        private void ChangeGradeStatus()
        {
            string errorMessage          = "";
            GradeDecisionProcedure grade = new GradeDecisionProcedure();

            if (!DataValidation.DataValidation.ValidStudentGradeStatus(tableRowContentList[6].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            grade.currentUser  = signInUser.UserID;
            grade.MembershipID = choosenMembershipID;

            if (tableRowContentList[6].Text == "t")
            {
                DbService.DataBaseTakeGrade(grade);
                AlertWindow alertWindow2 = new AlertWindow("Zatwierdzenie oceny przebiegło pomyślnie.");
                alertWindow2.ShowDialog();
            }
            else
            {
                DbService.DataBaseRejectGrade(grade);
                AlertWindow alertWindow2 = new AlertWindow("Reklamacja oceny przebiegła pomyślnie.");
                alertWindow2.ShowDialog();
            }

            CreateIndeksOceny();
        }
Beispiel #2
0
 private void Szukaj_Click(object sender, RoutedEventArgs e)
 {
     if (comboBoxSearch.Text != "Wszystkie")
     {
         string errorMessage = "";
         if (DataValidation.DataValidation.ValidIndexNumber(textBoxSearch.Text, out errorMessage))
         {
             lecturerStudentsDatas.Clear();
             contentDataGrid.Items.Clear();
             contentDataGrid.Items.Refresh();
             UpdateLecturerStudentsByIndexNumber();
         }
         else
         {
             AlertWindow alertWindow = new AlertWindow(errorMessage);
             alertWindow.ShowDialog();
         }
     }
     else
     {
         lecturerStudentsDatas.Clear();
         contentDataGrid.Items.Clear();
         contentDataGrid.Items.Refresh();
         UpdateLecturerStudents();
     }
 }
Beispiel #3
0
        private void DeleteStudent()
        {
            DeleteUserProcedure user = new DeleteUserProcedure();

            user.UserToDrop  = choosenUserID;
            user.CurrentUser = signInUser.UserID;
            DbService.DataBaseDeleteUser(user);
            AlertWindow alertWindow2 = new AlertWindow("Student został usunięty.");

            alertWindow2.ShowDialog();
        }
Beispiel #4
0
 // Logs the user in
 /// <summary>
 /// Logs the user in
 /// </summary>
 /// <param name="sender"> Contains a reference to the object that triggered the event </param>
 /// <param name="e"> Contains state information and event data associated with a routed event  </param>
 private void LoginButton_Click(object sender, RoutedEventArgs e)
 {
     SignInUser = DbService.DataBaseSignIn(this.LoginTextBox.Text, this.HasloTextBox.Password);
     if (SignInUser.CheckUser())
     {
         if (SignInUser.Role == 'a')
         {
             AlertWindow alertWindow = new AlertWindow("Zalogowałeś się jako administrator.");
             alertWindow.ShowDialog();
             AdministratorWindow Administrator = new AdministratorWindow(this, SignInUser, DbService);
             Administrator.ShowDialog();
         }
         else if (SignInUser.Role == 'd')
         {
             AlertWindow alertWindow = new AlertWindow("Zalogowałeś się jako pracownik dziekanatu.");
             alertWindow.ShowDialog();
             DziekanatWindow PracownikDziekanatu = new DziekanatWindow(this, SignInUser, DbService);
             PracownikDziekanatu.ShowDialog();
         }
         else if (SignInUser.Role == 'p')
         {
             AlertWindow alertWindow = new AlertWindow("Zalogowałeś się jako prowadzacy.");
             alertWindow.ShowDialog();
             ProwadzacyWindow Prowadzacy = new ProwadzacyWindow(this, SignInUser, DbService);
             Prowadzacy.ShowDialog();
         }
         else if (SignInUser.Role == 's')
         {
             AlertWindow alertWindow = new AlertWindow("Zalogowałeś się jako student.");
             alertWindow.ShowDialog();
             StudentWindow Student = new StudentWindow(this, SignInUser, DbService);
             Student.ShowDialog();
         }
         else
         {
             AlertWindow alertWindow = new AlertWindow("Błąd.");
             alertWindow.ShowDialog();
         }
     }
     else
     {
         AlertWindow alertWindow = new AlertWindow("Nie poprawny login lub hasło.");
         alertWindow.ShowDialog();
     }
 }
Beispiel #5
0
        private void ChangeGrade()
        {
            string errorMessage = "";

            if (!DataValidation.DataValidation.ValidLecturerGradeStatus(tableRowContentList[5].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (tableRowContentList[5].Text == "w")
            {
                AlertWindow alertWindow = new AlertWindow("Student ma już wprowadzoną ocenę. Możesz więc ją zmienić tylko używając statusu 'o' lub 'p'.");
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidGrade(tableRowContentList[4].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            ChangeGradeProcedure grade = new ChangeGradeProcedure();

            grade.StudentID   = int.Parse(tableRowContentList[0].Text);
            grade.GroupID     = int.Parse(tableRowContentList[2].Text);
            grade.NewGrade    = tableRowContentList[4].Text;
            grade.GradeStatus = tableRowContentList[5].Text;
            grade.currentUser = signInUser.UserID;

            DbService.DataBaseChangeGrade(grade);
            AlertWindow alertWindow2 = new AlertWindow("Zmiana oceny przebiegła pomyślnie.");

            alertWindow2.ShowDialog();
            CreateOcenianie();
        }
Beispiel #6
0
        private void AddGrade()
        {
            string errorMessage = "";

            if (!DataValidation.DataValidation.ValidLecturerGradeStatus(tableRowContentList[5].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (tableRowContentList[5].Text != "w")
            {
                AlertWindow alertWindow = new AlertWindow("Student nie ma jeszcze oceny. Możesz więc ją wprowadzić tylko używając statusu 'w'.");
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidGrade(tableRowContentList[4].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            AddGradeProcedure grade = new AddGradeProcedure();

            grade.StudentID   = int.Parse(tableRowContentList[0].Text);
            grade.GroupID     = int.Parse(tableRowContentList[2].Text);
            grade.NewGrade    = tableRowContentList[4].Text;
            grade.currentUser = signInUser.UserID;

            DbService.DataBaseAddGrade(grade);
            AlertWindow alertWindow2 = new AlertWindow("Wprowadzenie oceny przebiegło pomyślnie.");

            alertWindow2.ShowDialog();
            CreateOcenianie();
        }
Beispiel #7
0
        private void ChangeUserData()
        {
            ChangeDataProcedure user = new ChangeDataProcedure();
            string errorMessage      = "";

            if (!DataValidation.DataValidation.ValidName(tableRowContentList[1].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidSurname(tableRowContentList[2].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidSex(tableRowContentList[4].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidContactNumber(tableRowContentList[5].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidCountry(tableRowContentList[6].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidCity(tableRowContentList[7].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidStreet(tableRowContentList[8].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidHouseNumber(tableRowContentList[9].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidApartmentNumber(tableRowContentList[10].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidPostalCode(tableRowContentList[11].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            user.Name            = tableRowContentList[1].Text;
            user.Surname         = tableRowContentList[2].Text;
            user.Sex             = tableRowContentList[4].Text;
            user.ContactNumber   = tableRowContentList[5].Text;
            user.Country         = tableRowContentList[6].Text;
            user.City            = tableRowContentList[7].Text;
            user.Street          = tableRowContentList[8].Text;
            user.HouseNumber     = tableRowContentList[9].Text;
            user.ApartmentNumber = tableRowContentList[10].Text;
            user.PostalCode      = tableRowContentList[11].Text;
            user.CurrentUser     = signInUser.UserID;
            DbService.DataBaseChangeUserData(user);
            AlertWindow alertWindow2 = new AlertWindow("Zmiana danych przebiegła pomyślnie.");

            alertWindow2.ShowDialog();
            CreateDaneOsobowe();
        }
Beispiel #8
0
        private void AddNewStudent()
        {
            AddUserProcedure           newUser = new AddUserProcedure();
            FieldOfStudyCheckProcedure field   = new FieldOfStudyCheckProcedure();
            string errorMessage = "";

            if (!DataValidation.DataValidation.ValidPesel(tableRowContentList[0].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidName(tableRowContentList[1].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidSurname(tableRowContentList[2].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidDateOfBirth(tableRowContentList[3].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidSex(tableRowContentList[4].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidContactNumber(tableRowContentList[5].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidCountry(tableRowContentList[6].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidCity(tableRowContentList[7].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidStreet(tableRowContentList[8].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidHouseNumber(tableRowContentList[9].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidApartmentNumber(tableRowContentList[10].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidPostalCode(tableRowContentList[11].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidLogin(tableRowContentList[12].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidPassword(tableRowContentList[13].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidRole(tableRowContentList[14].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (tableRowContentList[14].Text == "s")
            {
                if (!DataValidation.DataValidation.ValidStudyField(tableRowContentList[15].Text, out errorMessage))
                {
                    AlertWindow alertWindow = new AlertWindow(errorMessage);
                    alertWindow.ShowDialog();
                    return;
                }

                if (!DataValidation.DataValidation.ValidSemestr(tableRowContentList[16].Text, out errorMessage))
                {
                    AlertWindow alertWindow = new AlertWindow(errorMessage);
                    alertWindow.ShowDialog();
                    return;
                }

                if (!DataValidation.DataValidation.ValidDegree(tableRowContentList[17].Text, out errorMessage))
                {
                    AlertWindow alertWindow = new AlertWindow(errorMessage);
                    alertWindow.ShowDialog();
                    return;
                }

                field.StudyField = tableRowContentList[15].Text;
                field.Semestr    = int.Parse(tableRowContentList[16].Text);
                field.Degree     = int.Parse(tableRowContentList[17].Text);

                if (!DbService.DataBaseCheckFieldOfStudy(field))
                {
                    errorMessage = "Nie istnieje kierunek lub nie ma takiego semestru na danym stopniu studiów.";
                    AlertWindow alertWindow = new AlertWindow(errorMessage);
                    alertWindow.ShowDialog();
                    return;
                }

                newUser.StudyField = tableRowContentList[15].Text;
                newUser.Semestr    = int.Parse(tableRowContentList[16].Text);
                newUser.Degree     = int.Parse(tableRowContentList[17].Text);
            }
            else
            {
                errorMessage = "Jako pracownik dziekanatu możesz dodać tylko studenta.\n" + "Jako rola użytkownika musisz więc wpisać 's'";
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (DbService.DataBaseCheckPesel(tableRowContentList[0].Text))
            {
                errorMessage = "Taki pesel już istnieje w bazie danych.";
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (DbService.DataBaseCheckLogin(tableRowContentList[12].Text))
            {
                errorMessage = "Taki login już istnieje w bazie danych.";
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            newUser.Pesel           = tableRowContentList[0].Text;
            newUser.Name            = tableRowContentList[1].Text;
            newUser.Surname         = tableRowContentList[2].Text;
            newUser.DateOfBirth     = tableRowContentList[3].Text;
            newUser.Sex             = tableRowContentList[4].Text.ToCharArray()[0];
            newUser.ContactNumber   = tableRowContentList[5].Text;
            newUser.Country         = tableRowContentList[6].Text;
            newUser.City            = tableRowContentList[7].Text;
            newUser.Street          = tableRowContentList[8].Text;
            newUser.HouseNumber     = tableRowContentList[9].Text;
            newUser.ApartmentNumber = tableRowContentList[10].Text;
            newUser.PostalCode      = tableRowContentList[11].Text;
            newUser.Login           = tableRowContentList[12].Text;
            newUser.Password        = tableRowContentList[13].Text;
            newUser.Role            = tableRowContentList[14].Text;
            newUser.CurrentUser     = signInUser.UserID;
            DbService.DataBaseAddUser(newUser);

            errorMessage = "Dodano studenta.";
            AlertWindow alertWindow2 = new AlertWindow(errorMessage);

            alertWindow2.ShowDialog();
        }
Beispiel #9
0
        private void ChangeStudentData()
        {
            ChangeStudentDataProcedure changedFieldOfStudy = new ChangeStudentDataProcedure();
            ChangeDataProcedure        changedStudent      = new ChangeDataProcedure();
            FieldOfStudyCheckProcedure field = new FieldOfStudyCheckProcedure();
            string errorMessage = "";

            if (!DataValidation.DataValidation.ValidName(tableRowContentList[2].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidSurname(tableRowContentList[3].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidSex(tableRowContentList[5].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidContactNumber(tableRowContentList[6].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidCountry(tableRowContentList[7].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidCity(tableRowContentList[8].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidStreet(tableRowContentList[9].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidHouseNumber(tableRowContentList[10].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidApartmentNumber(tableRowContentList[11].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidPostalCode(tableRowContentList[12].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidStudyField(tableRowContentList[13].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidSemestr(tableRowContentList[14].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidDegree(tableRowContentList[15].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            field.StudyField = tableRowContentList[13].Text;
            field.Semestr    = int.Parse(tableRowContentList[14].Text);
            field.Degree     = int.Parse(tableRowContentList[15].Text);

            if (!DbService.DataBaseCheckFieldOfStudy(field))
            {
                errorMessage = "Nie istnieje kierunek lub nie ma takiego semestru na danym stopniu studiów.";
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            changedStudent.Name            = tableRowContentList[2].Text;
            changedStudent.Surname         = tableRowContentList[3].Text;
            changedStudent.Sex             = tableRowContentList[5].Text;
            changedStudent.ContactNumber   = tableRowContentList[6].Text;
            changedStudent.Country         = tableRowContentList[7].Text;
            changedStudent.City            = tableRowContentList[8].Text;
            changedStudent.Street          = tableRowContentList[9].Text;
            changedStudent.HouseNumber     = tableRowContentList[10].Text;
            changedStudent.ApartmentNumber = tableRowContentList[11].Text;
            changedStudent.PostalCode      = tableRowContentList[12].Text;
            changedStudent.CurrentUser     = choosenUserID;

            changedFieldOfStudy.StudentID   = int.Parse(tableRowContentList[0].Text);
            changedFieldOfStudy.StudyField  = tableRowContentList[13].Text;
            changedFieldOfStudy.Semestr     = int.Parse(tableRowContentList[14].Text);
            changedFieldOfStudy.Degree      = int.Parse(tableRowContentList[15].Text);
            changedFieldOfStudy.CurrentUser = signInUser.UserID;

            DbService.DataBaseChangeUserData(changedStudent);
            DbService.DataBaseChangeFieldOfStudyStudent(changedFieldOfStudy);
            AlertWindow alertWindow2 = new AlertWindow("Zmiana danych przebiegła pomyślnie.");

            alertWindow2.ShowDialog();
        }
Beispiel #10
0
        private void ChangeOtherUserData()
        {
            ChangeDataProcedure          user          = new ChangeDataProcedure();
            ChangeLoginPasswordProcedure loginPassword = new ChangeLoginPasswordProcedure();
            string errorMessage = "";

            if (!DataValidation.DataValidation.ValidName(tableRowContentList[1].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidSurname(tableRowContentList[2].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidSex(tableRowContentList[4].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidContactNumber(tableRowContentList[5].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidCountry(tableRowContentList[6].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidCity(tableRowContentList[7].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidStreet(tableRowContentList[8].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidHouseNumber(tableRowContentList[9].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidApartmentNumber(tableRowContentList[10].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidPostalCode(tableRowContentList[11].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidLogin(tableRowContentList[12].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidPassword(tableRowContentList[13].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (!DataValidation.DataValidation.ValidRole(tableRowContentList[14].Text, out errorMessage))
            {
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            if (DbService.DataBaseCheckLogin(tableRowContentList[12].Text))
            {
                errorMessage = "Taki login już istnieje w bazie danych.";
                AlertWindow alertWindow = new AlertWindow(errorMessage);
                alertWindow.ShowDialog();
                return;
            }

            user.Name            = tableRowContentList[1].Text;
            user.Surname         = tableRowContentList[2].Text;
            user.Sex             = tableRowContentList[4].Text;
            user.ContactNumber   = tableRowContentList[5].Text;
            user.Country         = tableRowContentList[6].Text;
            user.City            = tableRowContentList[7].Text;
            user.Street          = tableRowContentList[8].Text;
            user.HouseNumber     = tableRowContentList[9].Text;
            user.ApartmentNumber = tableRowContentList[10].Text;
            user.PostalCode      = tableRowContentList[11].Text;
            user.CurrentUser     = choosenUserID;

            loginPassword.UserToChangeLoginPassword = choosenUserID;
            loginPassword.Login       = tableRowContentList[12].Text;
            loginPassword.Password    = tableRowContentList[13].Text;
            loginPassword.CurrentUser = signInUser.UserID;

            DbService.DataBaseChangeUserData(user);
            DbService.DataBaseChangeLoginPassword(loginPassword);
            AlertWindow alertWindow2 = new AlertWindow("Zmiana danych przebiegła pomyślnie.");

            alertWindow2.ShowDialog();
            CreateUzytkownicyLista();
        }