public static AssetInformation getAsset(String assetId)
 {
     String idColumn = ColumnData.GetName(Net7.Table_assets._base_id);
     String query = "SELECT  "
                  + ColumnData.GetName(Net7.Table_assets._base_id) + ", "
                  + ColumnData.GetName(Net7.Table_assets._descr) + ", "
                  + ColumnData.GetName(Net7.Table_assets._filename)
                  + " FROM "
                  + Net7.Tables.assets.ToString()
                  + " WHERE "
                  + idColumn
                  + " = "
                  + DB.QueryParameterCharacter + idColumn;
     DataTable dataTable = DB.Instance.executeQuery(query, new String[] { idColumn }, new String[] { assetId });
     AssetInformation assetInformation = null;
     if (dataTable.Rows.Count == 1)
     {
         DataRow dataRow = dataTable.Rows[0];
         assetInformation = new AssetInformation();
         assetInformation.base_id = ColumnData.GetInt32(dataRow, Net7.Table_assets._base_id);
         assetInformation.descr = ColumnData.GetString(dataRow, Net7.Table_assets._descr);
         assetInformation.filename = ColumnData.GetString(dataRow, Net7.Table_assets._filename);
     }
     return assetInformation;
 }
Example #2
0
        public static AssetInformation getAsset(String assetId)
        {
            String idColumn = ColumnData.GetName(Net7.Table_assets._base_id);
            String query    = "SELECT  "
                              + ColumnData.GetName(Net7.Table_assets._base_id) + ", "
                              + ColumnData.GetName(Net7.Table_assets._descr) + ", "
                              + ColumnData.GetName(Net7.Table_assets._filename)
                              + " FROM "
                              + Net7.Tables.assets.ToString()
                              + " WHERE "
                              + idColumn
                              + " = "
                              + DB.QueryParameterCharacter + idColumn;
            DataTable        dataTable        = DB.Instance.executeQuery(query, new String[] { idColumn }, new String[] { assetId });
            AssetInformation assetInformation = null;

            if (dataTable.Rows.Count == 1)
            {
                DataRow dataRow = dataTable.Rows[0];
                assetInformation          = new AssetInformation();
                assetInformation.base_id  = ColumnData.GetInt32(dataRow, Net7.Table_assets._base_id);
                assetInformation.descr    = ColumnData.GetString(dataRow, Net7.Table_assets._descr);
                assetInformation.filename = ColumnData.GetString(dataRow, Net7.Table_assets._filename);
            }
            return(assetInformation);
        }
Example #3
0
        public static AssetInformation[] getAssetItems(String categoryValue, String subCategoryValue)
        {
            String categoryColumn    = ColumnData.GetName(Net7.Table_assets._main_cat);
            String subCategoryColumn = ColumnData.GetName(Net7.Table_assets._sub_cat);

            String[] parameters;
            String[] values;
            List <AssetInformation> valueList = new List <AssetInformation>();
            String query = "SELECT  "
                           + ColumnData.GetName(Net7.Table_assets._base_id) + ", "
                           + ColumnData.GetName(Net7.Table_assets._descr) + ", "
                           + ColumnData.GetName(Net7.Table_assets._filename)
                           + " FROM "
                           + Net7.Tables.assets.ToString()
                           + " WHERE "
                           + categoryColumn
                           + " = "
                           + DB.QueryParameterCharacter + categoryColumn;

            if (subCategoryValue == null)
            {
                parameters = new String[] { categoryColumn };
                values     = new String[] { categoryValue };
            }
            else
            {
                query += " AND "
                         + subCategoryColumn
                         + " = "
                         + DB.QueryParameterCharacter + subCategoryColumn;
                parameters = new String[] { categoryColumn, subCategoryColumn };
                values     = new String[] { categoryValue, subCategoryValue };
            }
            query += " ORDER BY "
                     + ColumnData.GetName(Net7.Table_assets._filename);
            DataTable        dataTable = DB.Instance.executeQuery(query, parameters, values);
            AssetInformation assetInformation;

            foreach (DataRow dataRow in dataTable.Rows)
            {
                assetInformation          = new AssetInformation();
                assetInformation.base_id  = ColumnData.GetInt32(dataRow, Net7.Table_assets._base_id);
                assetInformation.descr    = ColumnData.GetString(dataRow, Net7.Table_assets._descr);
                assetInformation.filename = ColumnData.GetString(dataRow, Net7.Table_assets._filename);
                valueList.Add(assetInformation);
            }
            return(valueList.ToArray());
        }
 public static AssetInformation[] getAssetItems(String categoryValue, String subCategoryValue)
 {
     String categoryColumn = ColumnData.GetName(Net7.Table_assets._main_cat);
     String subCategoryColumn = ColumnData.GetName(Net7.Table_assets._sub_cat);
     String[] parameters;
     String[] values;
     List<AssetInformation> valueList = new List<AssetInformation>();
     String query = "SELECT  "
                  + ColumnData.GetName(Net7.Table_assets._base_id) + ", "
                  + ColumnData.GetName(Net7.Table_assets._descr) + ", "
                  + ColumnData.GetName(Net7.Table_assets._filename)
                  + " FROM "
                  + Net7.Tables.assets.ToString()
                  + " WHERE "
                  + categoryColumn
                  + " = "
                  + DB.QueryParameterCharacter + categoryColumn;
     if (subCategoryValue == null)
     {
         parameters = new String[] { categoryColumn };
         values = new String[] { categoryValue };
     }
     else
     {
         query += " AND "
               + subCategoryColumn
               + " = "
               + DB.QueryParameterCharacter + subCategoryColumn;
         parameters = new String[] { categoryColumn, subCategoryColumn };
         values = new String[] { categoryValue, subCategoryValue };
     }
     query += " ORDER BY "
           +  ColumnData.GetName(Net7.Table_assets._filename);
     DataTable dataTable = DB.Instance.executeQuery(query, parameters, values);
     AssetInformation assetInformation;
     foreach (DataRow dataRow in dataTable.Rows)
     {
         assetInformation = new AssetInformation();
         assetInformation.base_id = ColumnData.GetInt32(dataRow, Net7.Table_assets._base_id);
         assetInformation.descr = ColumnData.GetString(dataRow, Net7.Table_assets._descr);
         assetInformation.filename = ColumnData.GetString(dataRow, Net7.Table_assets._filename);
         valueList.Add(assetInformation);
     }
     return valueList.ToArray();
 }