当前位置: 首页>>代码示例>>C#>>正文


C# User.Delete方法代码示例

本文整理汇总了C#中User.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# User.Delete方法的具体用法?C# User.Delete怎么用?C# User.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在User的用法示例。


在下文中一共展示了User.Delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteUser

 public int DeleteUser(int userid)
 {
     User a = new User();
       int i=  a.Delete(userid);
       if (i == 1)
       return 1;
       else
       return 0;
 }
开发者ID:njain006,项目名称:CodeSense,代码行数:9,代码来源:UserBLL.cs

示例2: Given_user_trying_to_delete_themselves_When_Delete_Then_should_throw_correct_exception

        public void Given_user_trying_to_delete_themselves_When_Delete_Then_should_throw_correct_exception()
        {
            // Given
            var user = new User {Id = Guid.NewGuid()};

            // When
            // Then
            Assert.Throws<UserAttemptingToDeleteSelfException>(() => user.Delete(new UserForAuditing()
                                                                                     {
                                                                                         Id = user.Id
                                                                                     }));
        }
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:12,代码来源:DeleteUserTests.cs

示例3: When_Delete_Then_should_set_correct_properties

        public void When_Delete_Then_should_set_correct_properties()
        {
            // Given
            var user = new User { Id = Guid.NewGuid() };
            var userDeleting = new UserForAuditing();

            // When
            user.Delete(userDeleting);

            // Then
            Assert.That(user.Deleted, Is.True);
            Assert.That(user.LastModifiedBy, Is.EqualTo(userDeleting));
            Assert.That(user.LastModifiedOn.Value.ToShortDateString(), Is.EqualTo(DateTime.Now.ToShortDateString()));
            Assert.That(user.DateDeleted.Value.ToShortDateString(), Is.EqualTo(DateTime.Now.ToShortDateString()));
        }
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:15,代码来源:DeleteUserTests.cs

示例4: DataGrid1_ItemCommand

 protected void DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
 {
     string btn=e.CommandName;
     switch(btn)
     {
         case "BtnEdit":
             int userID1=int.Parse(e.Item.Cells[9].Text.Trim());
             Response.Redirect("../userupdate.aspx?userid="+userID1);
             break;
         case "BtnDel":
             int userID2=int.Parse(e.Item.Cells[9].Text.Trim());
             User currentUser2 = new User(userID2);
             currentUser2.Delete();
             break;
     }
     dataBind();
 }
开发者ID:suizhikuo,项目名称:SourceCollection,代码行数:17,代码来源:UserAdmin.aspx.cs

示例5: ExecuteActionOnUserNotPresentInImport

 protected virtual bool ExecuteActionOnUserNotPresentInImport(User user, ref string errorMessage)
 {
     if (user != null)
     {
         user.Delete();
         return true;
     }
     errorMessage += "The user was null in the ExecuteActionOnUserNotPresentInImport method. The user was not processed. ";
     return false;
 }
开发者ID:NetlabSharedSource,项目名称:SitecoreUserSync,代码行数:10,代码来源:BaseDataMap.cs


注:本文中的User.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。