Exemplo n.º 1
0
        public CountryRegionCollection FetchAll()
        {
            CountryRegionCollection coll = new CountryRegionCollection();
            Query qry = new Query(CountryRegion.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Exemplo n.º 2
0
        public static AVManager.DAL.CountryRegionCollection GetCountryRegionCollection(string varCurrencyCode)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM CountryRegion INNER JOIN CountryRegionCurrency ON " +
                "CountryRegion.CountryRegionCode=CountryRegionCurrency.CountryRegionCode WHERE CountryRegionCurrency.CurrencyCode=@CurrencyCode", Currency.Schema.Provider.Name);

            cmd.AddParameter("@CurrencyCode", varCurrencyCode, DbType.String);
            IDataReader             rdr  = SubSonic.DataService.GetReader(cmd);
            CountryRegionCollection coll = new CountryRegionCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Exemplo n.º 3
0
        public static void SaveCountryRegionMap(string varCurrencyCode, CountryRegionCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM CountryRegionCurrency WHERE CurrencyCode=@CurrencyCode", Currency.Schema.Provider.Name);

            cmdDel.AddParameter("@CurrencyCode", varCurrencyCode);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (CountryRegion item in items)
            {
                CountryRegionCurrency varCountryRegionCurrency = new CountryRegionCurrency();
                varCountryRegionCurrency.SetColumnValue("CurrencyCode", varCurrencyCode);
                varCountryRegionCurrency.SetColumnValue("CountryRegionCode", item.GetPrimaryKeyValue());
                varCountryRegionCurrency.Save();
            }
        }
Exemplo n.º 4
0
        public CountryRegionCollection FetchByID(object CountryRegionCode)
        {
            CountryRegionCollection coll = new CountryRegionCollection().Where("CountryRegionCode", CountryRegionCode).Load();

            return(coll);
        }