public ActionResult DeleteUser() { var id = Session["ID"]; client.RemoveUser(Convert.ToInt32(id)); return(RedirectToAction("Index", "Home")); }
private void btnDelete_Click(object sender, RoutedEventArgs e) { if (chkDelete.IsChecked.Value == true) { BikeService.Open(); BikeService.RemoveUser(Convert.ToInt16(BikenBike.CurrentUser.Id)); BikeService.Close(); BikenBike bnb = new BikenBike(); bnb.Show(); window.Close(); } else { MessageBox.Show("Check the checkbox before delete", "Bikenbike"); } }
public void TestDeleteUser() { User u1 = new User { Address = "test", Age = "1", Salt = crypto.GenerateSaltString(), Email = "test", Name = "test", PWord = "1", Phone = "1234", Zipcode = "9200" }; userDB.AddUser(u1); User actual = userDB.GetAllUser().Last(); client.RemoveUser(actual.Id); User expected = userDB.GetAllUser().Last(); Assert.AreNotEqual(actual.Id, expected.Id); }