Exemplo n.º 1
0
        /// <summary>
        /// Purpose: Grabs state/province information based on ID
        /// Accepts: Int
        /// Returns: Hashtable
        /// </summary>
        public Hashtable GetStateProvinceByID(int id)
        {
            StatesProvince obj = new StatesProvince();
            QuickStart_DBEntities dbContext;
            Hashtable hsh = new Hashtable();
            try
            {
                dbContext = new QuickStart_DBEntities();
                obj = dbContext.StatesProvinces.FirstOrDefault(s => s.StateProvinceID == id);
                if (obj != null)
                {
                    hsh["stateprovinceid"] = obj.StateProvinceID;
                    hsh["name"] = obj.Name;
                    hsh["country"] = obj.Country;
                    hsh["currencycode"] = obj.CurrencyCode;
                    hsh["taxratepercentage"] = obj.TaxRatePercentage;
                    hsh["modified"] = obj.Modified;
                }
            }
            catch (Exception ex)
            {
                ErrorLoggerData.ErrorRoutine(ex, "StateProvinceData", "GetStateProvinceByID");
            }

            return hsh;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the StatesProvinces EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStatesProvinces(StatesProvince statesProvince)
 {
     base.AddObject("StatesProvinces", statesProvince);
 }
 /// <summary>
 /// Create a new StatesProvince object.
 /// </summary>
 /// <param name="stateProvinceID">Initial value of the StateProvinceID property.</param>
 public static StatesProvince CreateStatesProvince(global::System.Int32 stateProvinceID)
 {
     StatesProvince statesProvince = new StatesProvince();
     statesProvince.StateProvinceID = stateProvinceID;
     return statesProvince;
 }