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


C# OCL.CanDelete方法代码示例

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


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

示例1: RemoveNote

        internal bool RemoveNote(OCL.User AccessingUser, OCL.Note CurrentNote)
        {
            try
            {

                if(CurrentNote.CanDelete(AccessingUser))
                {
                    //Remove any attached files
                    if(CurrentNote.HasAttachment)
                    {
                        foreach(OCL.Attachment NA in CurrentNote.FileAttachments)
                        {
                            this.RemoveNoteAttachment(CurrentNote.mvarID, NA.ID);
                        }
                    }

                    string sSQL = "DELETE FROM tblNotes WHERE Id = " + CurrentNote.ID;
                    int numrecs = RF.ExecuteCommandNonQuery(sSQL);
                    if(numrecs < 1)
                        throw new Exception("Failed to delete Note " + CurrentNote.ID +
                            " for unknown reason");
                    else
                        return true;
                }
                return false;
            }
            catch(Exception Err)
            {
                throw new ApplicationException(Err.Message);
            }
        }
开发者ID:CarverLab,项目名称:Oyster,代码行数:31,代码来源:Functions.cs

示例2: DeleteRecording

        internal bool DeleteRecording(OCL.User AccessingUser,OCL.Recording R)
        {
            if(!R.CanDelete(AccessingUser))
            {
                return false;
            }
            try
            {
                FTPTransfer FT = new FTPTransfer();
                try
                {
                    FT.ConnectToOysterServer(ServerAddress);
                    //FT.ConnectToOysterServer("ome-prototype");
                }
                catch(Exception Err)
                {
                    throw new Exception(Err.Message);
                }
                FT.RemoveFile(R.Description);

                string sSQL = "DELETE FROM tblRecording WHERE ID = " + R.ID;
                int numrecs = RF.ExecuteCommandNonQuery(sSQL);
                if(numrecs > 0)
                    return true;
                else
                    return false;
            }
            catch(Exception Err)
            {
                throw new Exception(Err.Message);
            }
        }
开发者ID:CarverLab,项目名称:Oyster,代码行数:32,代码来源:Functions.cs

示例3: DeleteGroup

 public bool DeleteGroup(OCL.Group TargetGroup, OCL.User AccessingUser, out string ErrorString)
 {
     ErrorString = "";
     try
     {
         if(TargetGroup.CanDelete(AccessingUser))
         {
             Functions F = new Functions();
             F.DeleteGroup(TargetGroup,AccessingUser);
             return true;
         }
         else
         {
             ErrorString = "User does not have access to delete group.";
             return false;
         }
     }
     catch(Exception Err)
     {
         ErrorString = Err.Message;
         return false;
     }
 }
开发者ID:CarverLab,项目名称:Oyster,代码行数:23,代码来源:Oyster.cs

示例4: DeleteGroup

        internal bool DeleteGroup(OCL.Group TargetGroup,OCL.User AccessingUser)
        {
            try
            {
                if(TargetGroup.CanDelete(AccessingUser))
                {
                    //Delete all references to items in this group
                    string sSQL = "DELETE FROM tblGroupTokens WHERE GroupID = " + TargetGroup.ID;
                    if(this.ExecuteNonQuery(sSQL) == 0)
                        throw new Exception("Unknown error attempting to remove all items from " + TargetGroup.Description);

                    //Just in case nested groups have been implemented. Delete this group from all other group entries.
                    sSQL = "DELETE FROM tblGroupTokens WHERE ObjectID = " + TargetGroup.ID +
                        " AND ObjectTypeId = " + Convert.ToInt32(OysterObjectType.Group).ToString();
                    this.ExecuteNonQuery(sSQL);

                    sSQL = "Delete FROM tblGroup WHERE ID = " + TargetGroup.ID;
                    if(this.ExecuteNonQuery(sSQL) == 0)
                        throw new Exception("Unknown error attempting to remove group " + TargetGroup.Description);
                    return true;
                }
                else
                {
                    throw new Exception("User does not have access to delete group.");
                }
            }
            catch(Exception Err)
            {
                throw new ApplicationException(Err.Message,Err.InnerException);
            }
        }
开发者ID:CarverLab,项目名称:Oyster,代码行数:31,代码来源:Functions.cs

示例5: RemoveNote

 /// <summary>
 /// 
 /// </summary>
 /// <param name="AccessingUser"></param>
 /// <param name="CurrentNote"></param>
 /// <returns></returns>
 public bool RemoveNote(OCL.User AccessingUser, OCL.Note CurrentNote)
 {
     if((AccessingUser.mvarIsSuperUser)||(CurrentNote.CanDelete(AccessingUser)))
     {
         Functions F = new Functions();
         F.RemoveNote(CurrentNote.ID);
         return true;
     }
     else
         return false;
 }
开发者ID:CarverLab,项目名称:Oyster,代码行数:17,代码来源:RecordingSession.cs


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