private void EditUser_Click(object sender, RoutedEventArgs e) { using (var DB = new SkladModel()) { if (CB_Status.SelectedItem.ToString() == "Админ") { MessageBox.Show(DB.EditUser(Convert.ToInt32(DGR_Users.SelectedValue), TB_Login.Text, TB_Password.Text, SkladTable.Status.Admin)); } else if (CB_Status.SelectedItem.ToString() == "Юзер") { MessageBox.Show(DB.EditUser(Convert.ToInt32(DGR_Users.SelectedValue), TB_Login.Text, TB_Password.Text, SkladTable.Status.User)); } } UpdateTable(); UpdateComboBox(); }