예제 #1
0
        /// <summary>
        /// Purpose: Grabs state/province information based on ID
        /// Accepts: Int
        /// Returns: Nothing
        /// </summary>
        public void GetStateProvinceByID(int id)
        {
            try
            {
                StateProvinceData data = new StateProvinceData();
                Hashtable hsh = new Hashtable();

                hsh = data.GetStateProvinceByID(id);

                StateProvinceID = id;
                Name = hsh["name"];
                Country = hsh["country"];
                CurrencyCode = hsh["currencyCode"];
                TaxRatePercentage = Convert.ToDouble(hsh["taxratepercentage"]);
                Modified = hsh["modified"];
            }
            catch (Exception ex)
            {
                ErrorRoutine(ex, "StateProvince", "GetStateProvinceByID");
            }
        }
예제 #2
0
        /// <summary>
        /// Purpose: Grabs all states/provinces
        /// Accepts: Nothing
        /// Returns: List<StateProvince>
        /// </summary>
        public List<StateProvince> GetAllStatesProvinces()
        {
            List<StateProvince> statesProvinces = new List<StateProvince>();
            try
            {
                StateProvinceData data = new StateProvinceData();
                List<QSRDataObjects.StatesProvince> dataStatesProvinces = data.GetAllStatesProvinces();

                foreach (QSRDataObjects.StatesProvince sp in dataStatesProvinces)
                {
                    StateProvince stateProvince = new StateProvince();
                    stateProvince.StateProvinceID = sp.StateProvinceID;
                    stateProvince.Name = sp.Name;
                    stateProvince.Country = sp.Country;
                    stateProvince.CurrencyCode = sp.CurrencyCode;
                    stateProvince.TaxRatePercentage = Convert.ToDouble(sp.TaxRatePercentage);
                    stateProvince.Modified = sp.Modified;
                    statesProvinces.Add(stateProvince);
                }
            }
            catch (Exception ex)
            {
                ErrorRoutine(ex, "StateProvince", "GetAllStateProvinces");
            }
            return statesProvinces;
        }