public static int DeleteSqlAttachment(Attachment attachment)
 {
     try
     {
         //Delete FTP Attachment
         if (FtpFunctions.DeleteFtpAttachment(attachment.FileGuid, attachment.ObjectGuid))
         {
             //delete SQL entry
             var deleteQuery = "DELETE FROM " + attachment.AttachColumns.TableName + " WHERE " + attachment.AttachColumns.FileGuid + "='" + attachment.FileGuid + "'";
             return(DBFactory.GetDatabase().ExecuteNonQuery(deleteQuery));
         }
         return(-1);
     }
     catch (Exception ex)
     {
         ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod());
         return(-1);
     }
 }
 public static bool DeleteSibiRequest(string guid)
 {
     try
     {
         // if has attachments, delete ftp directory, then delete the sql records.
         if (FtpFunctions.HasFtpFolder(guid))
         {
             if (!FtpFunctions.DeleteFtpFolder(guid))
             {
                 return(false);
             }
         }
         //delete sql records
         return(DeleteMasterSqlEntry(guid, EntryType.Sibi));
     }
     catch (Exception ex)
     {
         return(ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod()));
     }
 }