private void button2_Click(object sender, EventArgs e)
 {
     u.username = textBox1.Text.Trim();
     if (u.username != "")
     {
         bool ok = uf.Delete(u);
         if (ok == true)
         {
             MessageBox.Show("USER DELETED SUCCESSFULLY!");
             DataTable dt = uf.Select();
             userlist.DataSource = dt;
             textBox1.Text       = "";
             textBox6.Text       = "";
             textBox5.Text       = "";
             textBox3.Text       = "";
             textBox4.Text       = "";
             textBox2.Text       = "";
         }
         else
         {
             MessageBox.Show("FAILED TO DELETE!");
         }
     }
 }
예제 #2
0
        public ActionResult DeleteUserProfile(User user)
        {
            UserFunctions.Delete(user);

            return RedirectToAction("Users", "Users");
        }