示例#1
0
 private void Update(int id)
 {
     using (DataConnection connection = new DataConnection())
     {
         const string selectQuery = "UPDATE kitobim_asar SET DownloadCount = DownloadCount + 1 WHERE Id = @Id";
         var param = new object[1, 3];
         param[0, 0] = "Id";
         param[0, 1] = id;
         ErrorInfo error = new ErrorInfo();
         connection.ExecuteScalar(selectQuery, param, QueryType.SqlQuery, error);
         CacheHelper.DeleteAll("kitobim_asar.select_by_seo");
     }
 }
示例#2
0
 private string GetFileName(int id)
 {
     using (DataConnection connection = new DataConnection())
     {
         string selectQuery = "SELECT fayl FROM kitobim_asar WHERE Id = @Id";
         var param = new object[1, 3];
         param[0, 0] = "Id";
         param[0, 1] = id;
         ErrorInfo error = new ErrorInfo();
         DataTable dataTable = connection.ExecuteDataTableQuery(selectQuery, param, QueryType.SqlQuery, error);
         if (error.Ok && dataTable != null && dataTable.Rows.Count > 0)
         {
             return dataTable.Rows[0][0].ToString();
         }
         return string.Empty;
     }
 }
 public ImportExportProvider()
 {
     _connection = new DataConnection(connectionString);
 }