Example #1
0
        public CurrencyCollection FetchByQuery(Query qry)
        {
            CurrencyCollection coll = new CurrencyCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Example #2
0
        public CurrencyCollection FetchAll()
        {
            CurrencyCollection coll = new CurrencyCollection();
            Query qry = new Query(Currency.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Example #3
0
        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);
        }
Example #4
0
        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();
            }
        }
Example #5
0
        public CurrencyCollection FetchByID(object CurrencyCode)
        {
            CurrencyCollection coll = new CurrencyCollection().Where("CurrencyCode", CurrencyCode).Load();

            return(coll);
        }