コード例 #1
0
        public ActionResult DeleteUser()
        {
            var id = Session["ID"];

            client.RemoveUser(Convert.ToInt32(id));
            return(RedirectToAction("Index", "Home"));
        }
コード例 #2
0
 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");
     }
 }
コード例 #3
0
        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);
        }