public ShippingService() { this.shipperRepo = new ShipperRepository(); this.shippingRepo = new ShippingInfoRepository(); this.serviceRepo = new DeliveryServiceRepository(); this.cache = MemoryCache.Default; }
public UnitOfWork(IShipperRepository shipperRepository, IRegionRepository regionRepository, ITerritoryRepository territoryRepository) { Shippers = shipperRepository; Regions = regionRepository; Territories = territoryRepository; }
public ShipperController(IShipperRepository repository, string catalog, LoginView view) { this._LoginId = view.LoginId.ToLong(); this._UserId = view.UserId.ToInt(); this._OfficeId = view.OfficeId.ToInt(); this._Catalog = catalog; this.ShipperRepository = repository; }
public ShippingScreenPresenter(IShippingScreen screen, IShipperRepository repository) { _screen = screen; _screen.AttachShippingScreenPresenter(this); _repository = repository; screen.States = repository.GetShippableStates(); ShipperSelected(); }
public ShippingService(IShipperRepository shipperRepository, IShippingInfoRepository shippingRepository, IDeliveryServiceRepository serviceRepository, ObjectCache cache) { this.shippingRepo = shippingRepository; this.shipperRepo = shipperRepository; this.serviceRepo = serviceRepository; this.cache = cache; }
private void ResetRepositories() { _categoryRepository = null; _customerRepository = null; _employeeRepository = null; _orderRepository = null; _productRepository = null; _regionRepository = null; _shipperRepository = null; _supplierRepository = null; _territoryRepository = null; }
public ShipperController() { this._LoginId = AppUsers.GetCurrent().View.LoginId.ToLong(); this._UserId = AppUsers.GetCurrent().View.UserId.ToInt(); this._OfficeId = AppUsers.GetCurrent().View.OfficeId.ToInt(); this._Catalog = AppUsers.GetCurrentUserDB(); this.ShipperRepository = new MixERP.Net.Schemas.Core.Data.Shipper { _Catalog = this._Catalog, _LoginId = this._LoginId, _UserId = this._UserId }; }
public OrderPatternService(IOrderPatternRepository orderPatternRepository, IContractTariffPatternRepository contractTariffPatternRepository, ICustomerRepository customerRepository, IShippingCompanyRepository shippingCompanyRepository, IVesselRepository vesselRepository, IShipperRepository shipperRepository, ILocationRepository locationRepository, IContractTariffPatternService contractTariffPatternService, IContainerTypeRepository containerTypeRepository, IUnitOfWork unitOfWork) { this._orderPatternRepository = orderPatternRepository; this._contractTariffPatternRepository = contractTariffPatternRepository; this._shippingCompanyRepository = shippingCompanyRepository; this._vesselRepository = vesselRepository; this._shipperRepository = shipperRepository; this._locationRepository = locationRepository; this._contractTariffPatternService = contractTariffPatternService; this._containerTypeRepository = containerTypeRepository; this._unitOfWork = unitOfWork; this._customerRepository = customerRepository; }
public GetAllShippersQueryHandler(IShipperRepository shipperRepository) { _shipperRepository = shipperRepository; }
public void Setup() { dataProvider = new SqlServerDataProvider(ConnectionString); shipperRepository = new ShipperRepository(dataProvider); shipperService = new ShipperService(shipperRepository); }
public ShipperService(IShipperRepository shipperRepository, IUnitOfWork unitOfWork) { this._shipperRepository = shipperRepository; this._unitOfWork = unitOfWork; }
public CreateShipperCommandHandler(IShipperRepository shipperRepository) { _shipperRepository = shipperRepository; }
static void Main(string[] args) { IKernel kernel = new StandardKernel(); kernel.Bind <IShipperRepository>().To <Data.ShipperRepository>().WithConstructorArgument("connectionString", "DataSource=xxx"); kernel.Bind <ICategoryRepository>().To <Data.CategoryRepository>(); kernel.Bind <IProductRepository>().To <Data.ProductRepository>(); //are these needed??? /* * kernel.Bind<IShipper>().To<Entities.Shipper>(); * kernel.Bind<ICategory>().To<Entities.Category>(); * kernel.Bind<IProduct>().To<Entities.Product>(); */ shipperRepository = kernel.Get <IShipperRepository>(); categoryRepository = kernel.Get <ICategoryRepository>(); productRepository = kernel.Get <IProductRepository>(); System.Console.WriteLine("Connection String: {0}", shipperRepository.ToString()); #region MAPS STUFF /* * // SIMPLE QUERY * foreach(var item in organisationRepository.GetAllOrganisations()) * { * System.Console.WriteLine("OrgId: {0} ¦ OrgName: {1} ¦ Phone: {2}", item.OrganisationId, item.OrganisationName, item.Phone); * } * * // SIMPLE JOIN QUERY WITH PARAMETER * foreach (var item in organisationRepository.GetAllOrganisationsInGroupId(474)) * { * System.Console.WriteLine("OrgId: {0} ¦ OrgName: {1} ¦ Phone: {2}", item.OrganisationId, item.OrganisationName, item.Phone); * } * * // SIMPLE QUERY USING EMBEDDED SQL RESOURCE * foreach (var item in personRepository.GetAllPeople()) * { * System.Console.WriteLine("PersonId: {0} ¦ LastName: {1} ¦ FirstName: {2} ¦ Phone: {3}", item.PersonId, item.LastName, item.FirstName, item.MobilePhone); * } * * // SIMPLE QUERY USING STORED PROC * foreach (var item in titleRepository.GetAllTitles()) * { * System.Console.WriteLine("TitleId: {0} ¦ Desc: {1}", item.TitleID, item.TitleDesc); * } * * // MULTIPLE QUERIES RESULTS * var org = organisationRepository.GetOrganisationWithGroups(448); * if (org != null) * { * System.Console.WriteLine("OrgId: {0} ¦ OrgName: {1} ¦ Phone: {2}", org.OrganisationId, org.OrganisationName, org.Phone); * foreach (var grp in org.Groups) * { * System.Console.WriteLine("GroupId: {0} ¦ Desc: {1}", grp.GroupID, grp.GroupDesc); * } * } * * // MULTI MAPPING QUERY WITH PARAMETER (a single row to multiple objects) * var person = personRepository.GetPersonWithOrganisation(3348); * if (person != null) * { * System.Console.WriteLine("PersonId: {0} ¦ LastName: {1} ¦ FirstName: {2}", person.PersonId, person.LastName, person.FirstName); * } * * // INSERT ITEM QUERY * MyDapperDemo.Entities.MAPS.Organisation newOrg = new Entities.MAPS.Organisation * { * OrganisationName = "Barrys Bits", * Phone = "555 551155" * }; * int rowsAffected = organisationRepository.AddOrganisation2(newOrg); * System.Console.WriteLine("Rows affected: {0}", rowsAffected); * System.Console.WriteLine("NewId: {0}", org.OrganisationId); * * foreach (var item in organisationRepository.GetAllOrganisations()) * { * System.Console.WriteLine("OrgId: {0} ¦ OrgName: {1} ¦ Phone: {2}", item.OrganisationId, item.OrganisationName, item.Phone); * } * * // QUERY WITH DYNAMIC RESULT * dynamic bankaccs = organisationRepository.GetAllBankAccounts(); * foreach (var item in bankaccs) * { * System.Console.WriteLine("AccName: {0}", item.BankAccountName); * } * * */ /* * * MyDapperDemo.Entities.MAPS.Person p = new Entities.MAPS.Person * { * FirstName = "Hoof", * LastName = "Hearted", * MobilePhone = "021 5553332", * DirectEmail = "*****@*****.**" * }; * * int rowsAffected = personRepository.AddPerson(p); * System.Console.WriteLine("Rows affected: {0}", rowsAffected); * System.Console.WriteLine("NewId: {0}", p.PersonId); * * foreach (var item in personRepository.GetAllPeople()) * { * System.Console.WriteLine("PersonId: {0} ¦ LastName: {1} ¦ FirstName: {2}", item.PersonId, item.LastName, item.FirstName); * } * * foreach (var item in groupRepository.GetAllGroups()) * { * System.Console.WriteLine("GroupId: {0} ¦ Desc: {1}", item.GroupID, item.GroupDesc); * } * */ #endregion PrintAllShippers(shipperRepository.GetAll()); AddShipper("Barrys Bits"); //System.Console.ReadLine(); PrintAllShippers(shipperRepository.GetAll()); //EditShipper(4, "Bobs Bits"); EditShipper("Barrys Bits", "Bobs Bits"); //System.Console.ReadLine(); PrintAllShippers(shipperRepository.GetAll()); DeleteShipper(shipperRepository.GetShipperByName("Bobs Bits").ShipperId); //System.Console.ReadLine(); PrintAllShippers(shipperRepository.GetAll()); System.Console.WriteLine("CATEGORIES"); foreach (var item in categoryRepository.GetAll()) { System.Console.WriteLine("CategoryId: {0} ¦ CategoryName: {1} ¦ Desc: {2} ¦ PicSize: {3}", item.CategoryId, item.CategoryName, item.Description, item.Picture.Length); } System.Console.ReadLine(); System.Console.WriteLine("\n\nPRODUCTS"); foreach (var item in productRepository.GetAll()) { System.Console.WriteLine("ProductId: {0} ¦ SupplierId: {1} ¦ ProductName: {2}", item.ProductId, item.SupplierId, item.ProductName); } System.Console.ReadLine(); System.Console.WriteLine("\n\nPRODUCTS WITH CATEGORIES"); foreach (var item in productRepository.GetAllWithCategory()) { System.Console.WriteLine("ProductId: {0} ¦ SupplierId: {1} ¦ ProductName: {2} ¦ CategoryName: {3}", item.ProductId, item.SupplierId, item.ProductName, item.Category.CategoryName); } System.Console.ReadLine(); //System.Console.WriteLine("\n\nDYNAMIC"); //foreach (var undefinedType in dynamicRepository.GetAllCategories()) //{ // System.Console.WriteLine("CategoryId: {0} ¦ CategoryName: {1} ¦ Desc: {2}", undefinedType.CategoryId, undefinedType.CategoryName, undefinedType.Description); //} //System.Console.WriteLine("Number of Products: {0}", basicRepository.GetNumberOfProducts()); //STORED PROC SUPPORT //TRANSACTION SUPPORT //EXTENSION SUPPORT FOR ASYNC METHODS // System.Console.ReadLine(); }
static void Main(string[] args) { IKernel kernel = new StandardKernel(); kernel.Bind<IShipperRepository>().To<Data.ShipperRepository>().WithConstructorArgument("connectionString", "DataSource=xxx"); kernel.Bind<ICategoryRepository>().To<Data.CategoryRepository>(); kernel.Bind<IProductRepository>().To<Data.ProductRepository>(); //are these needed??? /* kernel.Bind<IShipper>().To<Entities.Shipper>(); kernel.Bind<ICategory>().To<Entities.Category>(); kernel.Bind<IProduct>().To<Entities.Product>(); */ shipperRepository = kernel.Get<IShipperRepository>(); categoryRepository = kernel.Get<ICategoryRepository>(); productRepository = kernel.Get<IProductRepository>(); System.Console.WriteLine("Connection String: {0}", shipperRepository.ToString()); #region MAPS STUFF /* // SIMPLE QUERY foreach(var item in organisationRepository.GetAllOrganisations()) { System.Console.WriteLine("OrgId: {0} ¦ OrgName: {1} ¦ Phone: {2}", item.OrganisationId, item.OrganisationName, item.Phone); } // SIMPLE JOIN QUERY WITH PARAMETER foreach (var item in organisationRepository.GetAllOrganisationsInGroupId(474)) { System.Console.WriteLine("OrgId: {0} ¦ OrgName: {1} ¦ Phone: {2}", item.OrganisationId, item.OrganisationName, item.Phone); } // SIMPLE QUERY USING EMBEDDED SQL RESOURCE foreach (var item in personRepository.GetAllPeople()) { System.Console.WriteLine("PersonId: {0} ¦ LastName: {1} ¦ FirstName: {2} ¦ Phone: {3}", item.PersonId, item.LastName, item.FirstName, item.MobilePhone); } // SIMPLE QUERY USING STORED PROC foreach (var item in titleRepository.GetAllTitles()) { System.Console.WriteLine("TitleId: {0} ¦ Desc: {1}", item.TitleID, item.TitleDesc); } // MULTIPLE QUERIES RESULTS var org = organisationRepository.GetOrganisationWithGroups(448); if (org != null) { System.Console.WriteLine("OrgId: {0} ¦ OrgName: {1} ¦ Phone: {2}", org.OrganisationId, org.OrganisationName, org.Phone); foreach (var grp in org.Groups) { System.Console.WriteLine("GroupId: {0} ¦ Desc: {1}", grp.GroupID, grp.GroupDesc); } } // MULTI MAPPING QUERY WITH PARAMETER (a single row to multiple objects) var person = personRepository.GetPersonWithOrganisation(3348); if (person != null) { System.Console.WriteLine("PersonId: {0} ¦ LastName: {1} ¦ FirstName: {2}", person.PersonId, person.LastName, person.FirstName); } // INSERT ITEM QUERY MyDapperDemo.Entities.MAPS.Organisation newOrg = new Entities.MAPS.Organisation { OrganisationName = "Barrys Bits", Phone = "555 551155" }; int rowsAffected = organisationRepository.AddOrganisation2(newOrg); System.Console.WriteLine("Rows affected: {0}", rowsAffected); System.Console.WriteLine("NewId: {0}", org.OrganisationId); foreach (var item in organisationRepository.GetAllOrganisations()) { System.Console.WriteLine("OrgId: {0} ¦ OrgName: {1} ¦ Phone: {2}", item.OrganisationId, item.OrganisationName, item.Phone); } // QUERY WITH DYNAMIC RESULT dynamic bankaccs = organisationRepository.GetAllBankAccounts(); foreach (var item in bankaccs) { System.Console.WriteLine("AccName: {0}", item.BankAccountName); } */ /* MyDapperDemo.Entities.MAPS.Person p = new Entities.MAPS.Person { FirstName = "Hoof", LastName = "Hearted", MobilePhone = "021 5553332", DirectEmail = "*****@*****.**" }; int rowsAffected = personRepository.AddPerson(p); System.Console.WriteLine("Rows affected: {0}", rowsAffected); System.Console.WriteLine("NewId: {0}", p.PersonId); foreach (var item in personRepository.GetAllPeople()) { System.Console.WriteLine("PersonId: {0} ¦ LastName: {1} ¦ FirstName: {2}", item.PersonId, item.LastName, item.FirstName); } foreach (var item in groupRepository.GetAllGroups()) { System.Console.WriteLine("GroupId: {0} ¦ Desc: {1}", item.GroupID, item.GroupDesc); } */ #endregion PrintAllShippers(shipperRepository.GetAll()); AddShipper("Barrys Bits"); //System.Console.ReadLine(); PrintAllShippers(shipperRepository.GetAll()); //EditShipper(4, "Bobs Bits"); EditShipper("Barrys Bits", "Bobs Bits"); //System.Console.ReadLine(); PrintAllShippers(shipperRepository.GetAll()); DeleteShipper(shipperRepository.GetShipperByName("Bobs Bits").ShipperId); //System.Console.ReadLine(); PrintAllShippers(shipperRepository.GetAll()); System.Console.WriteLine("CATEGORIES"); foreach (var item in categoryRepository.GetAll()) { System.Console.WriteLine("CategoryId: {0} ¦ CategoryName: {1} ¦ Desc: {2} ¦ PicSize: {3}", item.CategoryId, item.CategoryName, item.Description, item.Picture.Length); } System.Console.ReadLine(); System.Console.WriteLine("\n\nPRODUCTS"); foreach (var item in productRepository.GetAll()) { System.Console.WriteLine("ProductId: {0} ¦ SupplierId: {1} ¦ ProductName: {2}", item.ProductId, item.SupplierId, item.ProductName); } System.Console.ReadLine(); System.Console.WriteLine("\n\nPRODUCTS WITH CATEGORIES"); foreach (var item in productRepository.GetAllWithCategory()) { System.Console.WriteLine("ProductId: {0} ¦ SupplierId: {1} ¦ ProductName: {2} ¦ CategoryName: {3}", item.ProductId, item.SupplierId, item.ProductName, item.Category.CategoryName); } System.Console.ReadLine(); //System.Console.WriteLine("\n\nDYNAMIC"); //foreach (var undefinedType in dynamicRepository.GetAllCategories()) //{ // System.Console.WriteLine("CategoryId: {0} ¦ CategoryName: {1} ¦ Desc: {2}", undefinedType.CategoryId, undefinedType.CategoryName, undefinedType.Description); //} //System.Console.WriteLine("Number of Products: {0}", basicRepository.GetNumberOfProducts()); //STORED PROC SUPPORT //TRANSACTION SUPPORT //EXTENSION SUPPORT FOR ASYNC METHODS // System.Console.ReadLine(); }
public ShipperManager(IShipperRepository shipperRepository) { _shipperRepository = shipperRepository; }
public ShipperOperationsPresenter(IShipperRepository operations, INavigator navigator) { this.operations = operations; this.navigator = navigator; }
public ShipperOperations(IShipperRepository shipper) { shipperRepository = shipper; }
public UserService(IUserRepository _userRepo, IShipperRepository _shipperRepo) { this._userRepo = _userRepo; this._shipperRepo = _shipperRepo; }
public ShipperController(IShipperRepository shipperRepository, IMapper mapper) { _shipperRepository = shipperRepository; _mapper = mapper; }
public ShipperAction(IShipperRepository repository) { ShipperRepository = repository; }
public ShippersController(IShipperRepository shipperRepository) { _shipperRepository = shipperRepository; }
public ShippersService(IShipperRepository shipperRepository) { _shipperRepository = shipperRepository; }
public ShipperController(IShipperRepository shipperRepo) { this.shipperRepo = shipperRepo; }
public ShipperService(IShipperRepository shipperRepository) { this.ShipperRepository = shipperRepository; }
public ShipperService(IUnitOfWork unitofwork, IShipperRepository ShipperRepository, IHttpContextAccessor httpContextAccessor) : base(unitofwork, ShipperRepository) { _ShipperRepository = ShipperRepository; _httpContextAccessor = httpContextAccessor; }
public ShipperService(IShipperRepository repository, IUnitOfWork unitOfWork) { _repository = repository; _unitOfWork = unitOfWork; }
public ShipperService(IShipperRepository shipperRepository, IUnitOfWork uow) { _shipperRepository = shipperRepository; _uow = uow; }
public ShipperController(IShipperRepository repository, ILogger <ShipperController> logger) { this._repository = repository; this._logger = logger; }
public DeleteShipperByIdCommandHandler(IShipperRepository shipperRepository) { _shipperRepository = shipperRepository; }