public DatabaseGateway(string dbType)
 {
     try
     {
         //get the database handler based on the type of database
         _iDBhelper = DBHelperFactory.GetDBHelper(dbType);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public static IDBhelper GetDBHelper(string type)
        {
            try
            {
                var Instance = Activator.CreateInstance(Type.GetType(type));
                _iDBhelper = Instance as IDBhelper;
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("{0:1}", "Could not create instance of type", type), ex);
            }


            return(_iDBhelper);
        }
Exemple #3
0
 public EventRepository(IDBhelper _db)
 {
     db = _db;
 }
Exemple #4
0
 public ProductRepository(IDBhelper dBhelper)
 {
     _db = dBhelper;
 }
Exemple #5
0
 public PromotionRepository(IDBhelper dBhelper)
 {
     _db = dBhelper;
 }
Exemple #6
0
 public ShopRepository(IDBhelper _db)
 {
     db = _db;
 }
Exemple #7
0
 public BrandRepository(IDBhelper dBhelper)
 {
     _db = dBhelper;
 }