示例#1
0
 public ShippingService()
 {
     this.shipperRepo  = new ShipperRepository();
     this.shippingRepo = new ShippingInfoRepository();
     this.serviceRepo  = new DeliveryServiceRepository();
     this.cache        = MemoryCache.Default;
 }
示例#2
0
 public UnitOfWork(IShipperRepository shipperRepository,
                   IRegionRepository regionRepository,
                   ITerritoryRepository territoryRepository)
 {
     Shippers    = shipperRepository;
     Regions     = regionRepository;
     Territories = territoryRepository;
 }
示例#3
0
        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;
        }
示例#4
0
        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;
        }
示例#5
0
        public ShippingScreenPresenter(IShippingScreen screen, IShipperRepository repository)
        {
            _screen = screen;
            _screen.AttachShippingScreenPresenter(this);
            _repository = repository;

            screen.States = repository.GetShippableStates();
            ShipperSelected();
        }
        public ShippingScreenPresenter(IShippingScreen screen, IShipperRepository repository)
        {
            _screen = screen;
            _screen.AttachShippingScreenPresenter(this);
            _repository = repository;

            screen.States = repository.GetShippableStates();
            ShipperSelected();
        }
示例#7
0
 public ShippingService(IShipperRepository shipperRepository,
                        IShippingInfoRepository shippingRepository,
                        IDeliveryServiceRepository serviceRepository,
                        ObjectCache cache)
 {
     this.shippingRepo = shippingRepository;
     this.shipperRepo  = shipperRepository;
     this.serviceRepo  = serviceRepository;
     this.cache        = cache;
 }
示例#8
0
 private void ResetRepositories()
 {
     _categoryRepository  = null;
     _customerRepository  = null;
     _employeeRepository  = null;
     _orderRepository     = null;
     _productRepository   = null;
     _regionRepository    = null;
     _shipperRepository   = null;
     _supplierRepository  = null;
     _territoryRepository = null;
 }
示例#9
0
        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
            };
        }
示例#10
0
        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
            };
        }
示例#11
0
 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;
 }
示例#12
0
 public GetAllShippersQueryHandler(IShipperRepository shipperRepository)
 {
     _shipperRepository = shipperRepository;
 }
示例#13
0
 public void Setup()
 {
     dataProvider      = new SqlServerDataProvider(ConnectionString);
     shipperRepository = new ShipperRepository(dataProvider);
     shipperService    = new ShipperService(shipperRepository);
 }
示例#14
0
 public ShipperService(IShipperRepository shipperRepository, IUnitOfWork unitOfWork)
 {
     this._shipperRepository = shipperRepository;
     this._unitOfWork        = unitOfWork;
 }
示例#15
0
 public CreateShipperCommandHandler(IShipperRepository shipperRepository)
 {
     _shipperRepository = shipperRepository;
 }
示例#16
0
        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();
        }
示例#17
0
        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();
        }
示例#18
0
 public ShipperManager(IShipperRepository shipperRepository)
 {
     _shipperRepository = shipperRepository;
 }
 public ShipperOperationsPresenter(IShipperRepository operations, INavigator navigator)
 {
     this.operations = operations;
     this.navigator  = navigator;
 }
示例#20
0
 public ShipperOperations(IShipperRepository shipper)
 {
     shipperRepository = shipper;
 }
示例#21
0
 public UserService(IUserRepository _userRepo, IShipperRepository _shipperRepo)
 {
     this._userRepo    = _userRepo;
     this._shipperRepo = _shipperRepo;
 }
 public ShipperController(IShipperRepository shipperRepository, IMapper mapper)
 {
     _shipperRepository = shipperRepository;
     _mapper            = mapper;
 }
示例#23
0
 public ShipperAction(IShipperRepository repository)
 {
     ShipperRepository = repository;
 }
 public ShippersController(IShipperRepository shipperRepository)
 {
     _shipperRepository = shipperRepository;
 }
 public ShippersService(IShipperRepository shipperRepository)
 {
     _shipperRepository = shipperRepository;
 }
示例#26
0
 public ShipperController(IShipperRepository shipperRepo)
 {
     this.shipperRepo = shipperRepo;
 }
示例#27
0
 public ShipperService(IShipperRepository shipperRepository)
 {
     this.ShipperRepository = shipperRepository;
 }
示例#28
0
 public ShipperService(IUnitOfWork unitofwork, IShipperRepository ShipperRepository, IHttpContextAccessor httpContextAccessor)
     : base(unitofwork, ShipperRepository)
 {
     _ShipperRepository   = ShipperRepository;
     _httpContextAccessor = httpContextAccessor;
 }
示例#29
0
文件: Shipper.cs 项目: binhtv1997/Bus
 public ShipperService(IShipperRepository repository, IUnitOfWork unitOfWork)
 {
     _repository = repository;
     _unitOfWork = unitOfWork;
 }
示例#30
0
 public ShipperService(IShipperRepository shipperRepository,
                       IUnitOfWork uow)
 {
     _shipperRepository = shipperRepository;
     _uow = uow;
 }
示例#31
0
 public ShipperAction(IShipperRepository repository)
 {
     ShipperRepository = repository;
 }
 public ShipperController(IShipperRepository repository, ILogger <ShipperController> logger)
 {
     this._repository = repository;
     this._logger     = logger;
 }
示例#33
0
 public DeleteShipperByIdCommandHandler(IShipperRepository shipperRepository)
 {
     _shipperRepository = shipperRepository;
 }