Пример #1
0
 public static void SharingFile_Delete(String[] copyRefs)
 {
     lock ( conn )
     {
         foreach (String copyRef in copyRefs)
         {
             if (PreKeyring.GetRowsCountOfCopyRef(copyRef) == 0)
             {
                 continue;
             }
             else
             {
                 String sql = string.Format(SQLStatement.SharingFile_Delete, copyRef);
                 if (conn.State == ConnectionState.Closed)
                 {
                     conn.Open();
                 }
                 using (SqliteCommand cmd = new SqliteCommand())
                 {
                     cmd.Connection  = PreKeyring.conn;
                     cmd.CommandText = sql;
                     cmd.ExecuteNonQuery();
                 }
             }
         }
     }
 }
Пример #2
0
 public static void SharingFile_Delete(String copyRef)
 {
     lock ( conn )
     {
         if (PreKeyring.GetRowsCountOfCopyRef(copyRef) == 0)
         {
             return;
         }
         else
         {
             String sql = string.Format(SQLStatement.SharingFile_Delete, copyRef);
             if (conn.State == ConnectionState.Closed)
             {
                 conn.Open();
             }
             using (SqliteCommand cmd = new SqliteCommand())
             {
                 cmd.Connection  = PreKeyring.conn;
                 cmd.CommandText = sql;
                 if (cmd.ExecuteNonQuery() != 1)
                 {
                     throw new SecuruStikException("Unexpected SQL database outcome");
                 }
             }
         }
     }
 }