public CurrencyCollection FetchByQuery(Query qry) { CurrencyCollection coll = new CurrencyCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public CurrencyCollection FetchAll() { CurrencyCollection coll = new CurrencyCollection(); Query qry = new Query(Currency.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return(coll); }
public static AVManager.DAL.CurrencyCollection GetCurrencyCollection(string varCountryRegionCode) { SubSonic.QueryCommand cmd = new SubSonic.QueryCommand( "SELECT * FROM Currency INNER JOIN CountryRegionCurrency ON " + "Currency.CurrencyCode=CountryRegionCurrency.CurrencyCode WHERE CountryRegionCurrency.CountryRegionCode=@CountryRegionCode", CountryRegion.Schema.Provider.Name); cmd.AddParameter("@CountryRegionCode", varCountryRegionCode, DbType.String); IDataReader rdr = SubSonic.DataService.GetReader(cmd); CurrencyCollection coll = new CurrencyCollection(); coll.LoadAndCloseReader(rdr); return(coll); }
public static void SaveCurrencyMap(string varCountryRegionCode, CurrencyCollection items) { QueryCommandCollection coll = new SubSonic.QueryCommandCollection(); //delete out the existing QueryCommand cmdDel = new QueryCommand("DELETE FROM CountryRegionCurrency WHERE CountryRegionCode=@CountryRegionCode", CountryRegion.Schema.Provider.Name); cmdDel.AddParameter("@CountryRegionCode", varCountryRegionCode); coll.Add(cmdDel); DataService.ExecuteTransaction(coll); foreach (Currency item in items) { CountryRegionCurrency varCountryRegionCurrency = new CountryRegionCurrency(); varCountryRegionCurrency.SetColumnValue("CountryRegionCode", varCountryRegionCode); varCountryRegionCurrency.SetColumnValue("CurrencyCode", item.GetPrimaryKeyValue()); varCountryRegionCurrency.Save(); } }
public CurrencyCollection FetchByID(object CurrencyCode) { CurrencyCollection coll = new CurrencyCollection().Where("CurrencyCode", CurrencyCode).Load(); return(coll); }