public void TestInitialize()
 {
     _countryDAL  = Substitute.For <ICountryDAL>();
     _countryList = new List <ICountry>()
     {
         new Country(Guid.NewGuid(), "Japan"), new Country(Guid.NewGuid(), "France"), new Country(Guid.NewGuid(), "Spain")
     };
 }
Example #2
0
 public CountryBLL(ICountryDAL countryDal,
                   UserInfo userInfo,
                   ILogger <CountryBLL> logger)
 {
     _countryDal = countryDal;
     _userInfo   = userInfo;
     _logger     = logger;
 }
Example #3
0
 public CountryService(ICountryDAL countryDAL)
 {
     if (countryDAL == null)
     {
         throw new ArgumentNullException("Argument cannot be null", nameof(countryDAL));
     }
     CountryDAL = countryDAL;
 }
Example #4
0
 /// <summary>
 /// Hàm này phải được gọi để khởi tạo các chức năng tác nghiệp
 /// </summary>
 /// <param name="connectionString"></param>
 public static void Initialize(string connectionString)
 {
     SupplierDB = new DataLayers.SqlServer.SupplierDAL(connectionString);
     CustomerDB = new DataLayers.SqlServer.CustomerDAL(connectionString);
     ShipperDB  = new DataLayers.SqlServer.ShipperDAL(connectionString);
     CategoryDB = new DataLayers.SqlServer.CategoryDAL(connectionString);
     ProductDB  = new DataLayers.SqlServer.ProductDAL(connectionString);
     CountryDB  = new DataLayers.SqlServer.CountryDAL(connectionString);
 }
Example #5
0
 public CountryBLL(ICountryDAL countryDal,
                   LogAdapter logger,
                   UserInfo userInfo)
 {
     _countryDal = countryDal;
     _logger     = logger;
     _userInfo   = userInfo;
     _logger.Initial(this.GetType().Name);
 }
Example #6
0
 public CountyBLL(ICountyDAL countyDal,
                  ICountryDAL countryDal,
                  ILogger <CountyBLL> logger,
                  UserInfo userInfo)
 {
     _countyDal  = countyDal;
     _countryDal = countryDal;
     _logger     = logger;
     _userInfo   = userInfo;
 }
Example #7
0
 /// <summary>
 /// Khởi tạo tính năng tác nghiệp (Hàm này phải được gọi nếu muốn sử dụng các tính năng của lớp)
 /// </summary>
 /// <param name="dbType"></param>
 /// <param name="connectionString"></param>
 public static void Init(DatabaseTypes dbType, string connectionString)
 {
     switch (dbType)
     {
         case DatabaseTypes.SQLServer:
             CountryDB = new DataLayers.SQLServer.CountryDAL(connectionString);
             CityDB = new DataLayers.SQLServer.CityDAL(connectionString);
             SupplierDB = new DataLayers.SQLServer.SupplierDAL(connectionString);
             CategoryDB = new DataLayers.SQLServer.CategoryDAL(connectionString);
             CustomerDB = new DataLayers.SQLServer.CustomerDAL(connectionString);
             EmployeeDB = new DataLayers.SQLServer.EmployeeDAL(connectionString);
             ShipperDB = new DataLayers.SQLServer.ShipperDAL(connectionString);
             break;
         default:
             throw new Exception("Database Type is not Supported");
     }
 }
Example #8
0
 public static void Initialize(string connectionString)
 {
     CountryDB = new CountryDAL(connectionString);
 }
 public CountryService(ICountryDAL countryDAL, ICityDAL cityDAL, IDistrictDAL districtDAL)
 {
     _countryDAL  = countryDAL;
     _cityDAL     = cityDAL;
     _districtDAL = districtDAL;
 }
Example #10
0
 public CountryManager(ICountryDAL countryDal)
 {
     _countryDal = countryDal;
 }
Example #11
0
 public CountryService(ICountryDAL countryDAL)
 {
     _countryDAL = countryDAL;
 }
 public CountryManager(ICountryDAL context)
 {
     _context = context;
 }