private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (newSelectedItem > 0)
            {
                if (selectedTable == "Users")
                {
                    selectedUser = ((DataGrid)sender).SelectedItem as Users;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "Description")
                {
                    selectedDesciption = ((DataGrid)sender).SelectedItem as Descriptions;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "TypesOfEmployees")
                {
                    selectedTypesOfEmployee = ((DataGrid)sender).SelectedItem as TypesOfEmployees;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "Projects")
                {
                    selectedProject = ((DataGrid)sender).SelectedItem as Projects;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "TypesOfOffices")
                {
                    selectedTypesOfOffice = ((DataGrid)sender).SelectedItem as TypesOfOffices;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "Employees")
                {
                    selectedEmpolyee = ((DataGrid)sender).SelectedItem as Empolyees;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }

                else if (selectedTable == "Companies")
                {
                    selectedCompany = ((DataGrid)sender).SelectedItem as Companies;
                    buttonModify.IsEnabled = true;
                    buttonDelete.IsEnabled = true;
                }
                if (newSelectedItem == 2)
                {
                    buttonModify.IsEnabled = false;
                    buttonDelete.IsEnabled = false;
                    newSelectedItem = 1;
                }
            }
        }
 public EntryFormUser(Users _user)
 {
     InitializeComponent();
     this.DataContext = _user;
     this.textBoxUserID.Text = _user.UserID.ToString();
 }
        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;
        }