コード例 #1
0
        public static void TestDelete()
        {
            Test.Business.User UserBusiness = new Business.User();
            int result = UserBusiness.Delete(1);

            Console.WriteLine(result != 0 ? "删除成功" : "删除失败");
        }
コード例 #2
0
 public void Delete(string id)
 {
     Business.User user = Business.User.GetUserById(id);
     if (user != null)
     {
         user.Delete();
         this.Bind(null);
     }
     else
     {
         this.PageEngine.ShowMessageBox(string.Format("没有找到 Id 为 ‘{0}’ 的用户", id));
     }
 }
コード例 #3
0
ファイル: UnitTest1.cs プロジェクト: batera74/mordomo
        public void DeleteEntity()
        {
            var factory = new Data.RepositoryFactory();
            Business.User userBiz = new Business.User(factory);

            var userFound = userBiz.Get(1);

            if (userFound == null)
                userFound = userBiz.Save(FakeEntities.Generator.CreateUser());

            int id = userFound.Id;

            userBiz.Delete(userFound);

            var userDeleted = userBiz.Get(id);

            Assert.IsNull(userDeleted);
        }
コード例 #4
0
 private void RemoveBtn_OnClick(object sender, MouseButtonEventArgs e)
 {
     removeBtn.Background = Brushes.Red;
     if (dataGrid.SelectedItem != null)
     {
         var result = MessageBox.Show("Deseja remover o dado selecionado?", "Remoção", MessageBoxButton.YesNo);
         if (result == MessageBoxResult.Yes)
         {
             var selectedType = dataGrid.SelectedItem.GetType().Name;
             if (selectedType == bUser.GetType().Name)
             {
                 bUser.Delete(dataGrid.SelectedItem as Model.User);
                 UsersBtn_OnClick(sender, e);
             }
             else if (selectedType == bAccs.GetType().Name)
             {
                 bAccs.Delete(dataGrid.SelectedItem as Model.AccessLog);
                 AccsLogBtn_OnClick(sender, e);
             }
         }
     }
     RemoveBtn_NonClick(sender, e);
 }
コード例 #5
0
ファイル: User.cs プロジェクト: LavoTP/Arad.SMS.Gateway
 public static bool DeleteUser(Guid userGuid)
 {
     Business.User userController = new Business.User();
     return(userController.Delete(userGuid));
 }
コード例 #6
0
ファイル: Program.cs プロジェクト: webxiaohua/SmartCodeGen
 public static void TestDelete()
 {
     Test.Business.User UserBusiness = new Business.User();
     int result = UserBusiness.Delete(1);
     Console.WriteLine(result != 0 ? "删除成功" : "删除失败");
 }
コード例 #7
0
 public IActionResult Delete(int id)
 {
     userBLL.Delete(id);
     return(Redirect("/user/list"));
 }