private void btninsert_Click(object sender, RoutedEventArgs e) { UserVM UserVMd = new UserVM(); User user = new User { Name = tb_name.Text, Email = tb_email.Text, Phone = tb_phone.Text, Password = UserVM.GetMD5Hash(tb_password.Password), Admin = tb_admin.Text }; if (UserVMd.InsertUser(user)) { MessageBox.Show("Insert Success"); loaddatagrid(); } else { MessageBox.Show("Insert failed"); } }