private static Users CreatingUsersObjectFromEntryForm(EntryFormUser entryForm)
        {
            Users newUser = new Users();

            newUser.ActivationDate = DateTime.Parse(entryForm.textBoxActivationDate.Text);
            newUser.Email = entryForm.textBoxEmail.Text;
            newUser.LastLogin = DateTime.Parse(entryForm.textBoxLastLogin.Text);
            newUser.Login = entryForm.textBoxLogin.Text;
            newUser.Password = entryForm.textBoxPassword.Text;
            return newUser;
        }
        /// <summary>
        /// Obsługa przycisku "Add"
        /// </summary>
        private void buttonAdd_Click(object sender, RoutedEventArgs e)
        {
            if (selectedTable == "TypesOfEmployees")
            {
                EntryFormTypeOfEmployee entryForm = new EntryFormTypeOfEmployee();
                bool? result = entryForm.ShowDialog();
                if ((bool)result)
                {
                    TypesOfEmployees toe = CreatingTypesOfEmployeesObjectFromEntryForm(entryForm);
                    Thread newThread = new Thread(AddRecordToTypesOfEmployees);
                    newThread.Start(toe);
                }
            }

            else if (selectedTable == "TypesOfOffices")
            {
                EntryFormTypeOfOffice entryForm = new EntryFormTypeOfOffice();
                bool? result = entryForm.ShowDialog();
                if ((bool)result)
                {
                    TypesOfOffices too = CreatingTypesOfOfficesObjectFromEntryForm(entryForm);
                    Thread newThread = new Thread(AddRecordToTypesOfOffices);
                    newThread.Start(too);
                }
            }

            else if (selectedTable == "Users")
            {
                EntryFormUser entryForm = new EntryFormUser();
                bool? result = entryForm.ShowDialog();
                if ((bool)result)
                {
                    Users newUser = CreatingUsersObjectFromEntryForm(entryForm);

                    Thread newThread = new Thread(AddRecordToUsers);
                    newThread.Start(newUser);
                }
            }
            else if (selectedTable == "Description")
            {
                EntryFormDescription entryForm = new EntryFormDescription();
                bool? result = entryForm.ShowDialog();
                if ((bool)result)
                {
                    Descriptions newDescription = CreatingDescriptionObjectFromEntryForm(entryForm);
                    Thread newThread = new Thread(AddRecordToDescriptions);
                    newThread.Start(newDescription);
                }
            }

            else if (selectedTable == "Projects")
            {
                EntryFormProject entryForm = new EntryFormProject();
                bool? result = entryForm.ShowDialog();
                if ((bool)result)
                {
                    Projects newProject = CreatingProjectsObjectFromEntryForm(entryForm);

                    Thread newThread = new Thread(AddRecordToProjects);
                    newThread.Start(newProject);
                }
            }

            else if (selectedTable == "Employees")
            {
                EntryFormEmpolyee entryForm = new EntryFormEmpolyee();
                bool? result = entryForm.ShowDialog();
                if ((bool)result)
                {
                    Empolyees newEmployee = CreatingEmployeeObjectFromEntryForm(entryForm);

                    Thread newThread = new Thread(AddRecordToEmployees);
                    newThread.Start(newEmployee);
                }
            }

            else if (selectedTable == "Companies")
            {
                EntryFormCompany entryForm = new EntryFormCompany();
                bool? result = entryForm.ShowDialog();
                if ((bool)result)
                {
                    Companies newCompany = CreatingCompaniesObjectFromEntryForm(entryForm);

                    Thread newThread = new Thread(AddRecordToCompanies);
                    newThread.Start(newCompany);

                }
            }
        }
        /// <summary>
        /// Modyfikowanie zaznaczonego rekordu w tabeli "Users"
        /// </summary>
        private void ModifyRecordFromUsers()
        {
            EntryFormUser entryForm = new EntryFormUser(selectedUser);

            bool? result = entryForm.ShowDialog();
            if ((bool)result)
            {
                Thread newThread = new Thread(ModyfingUsersInNewThread);
                newThread.Start();
            }
        }