public HomeController(INorthwindService service, IConfiguration config, ILogger <HomeController> log, UserManager <IdentityUser> userManager)
 {
     this.service  = service;
     configuration = config;
     logger        = log;
     _userManager  = userManager;
 }
Beispiel #2
0
        /// <summary>
        /// CTor
        /// </summary>
        public CustomersByProduct(INorthwindService service)
        {
            InitializeComponent();
            _dalService = service;

            // load products, sort them on ProductName asc.
            IEntityCollection2 products = _dalService.GetProductsSortedBy(ProductFields.ProductName, SortOperator.Ascending);

            // bind it to the combo box
            productSelectComboBox.DataSource    = products;
            productSelectComboBox.DisplayMember = ProductFields.ProductName.Name;
            productSelectComboBox.SelectedIndex = 0;
        }
Beispiel #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Open a channel with the WCF service endpoint, and keep it alive till the end of the program.
            ChannelFactory <INorthwindService> channelFactory = new ChannelFactory <INorthwindService>("WCFServer");
            INorthwindService service = channelFactory.CreateChannel();
            var toRun = new MainForm(service);

            Application.Run(toRun);

            channelFactory.Close();
        }
Beispiel #4
0
        /// <summary>
        /// CTor
        /// </summary>
        public MainForm(INorthwindService service)
        {
            InitializeComponent();

            _dalService = service;

            this.MinimumSize = this.Size;

            _customerIdOfCustomerWithMostOrders = string.Empty;
            _customerIdOfCustomerWithMaxOrder   = string.Empty;

            // calculate statistics for northwind and show these in the form.
            CalculateStatistics();
        }
        /// <summary>
        /// CTor
        /// </summary>
        /// <param name="customer">the customer to manage</param>
        public CustomerManager(INorthwindService service, string customerId)
        {
            InitializeComponent();
            _dalService = service;

            _customerScope = new CustomerWithOrdersDataScope(_dalService);
            _customerScope.ContainedDataChanged += new EventHandler(_customerScope_ScopedDataChanged);
            this.MinimumSize = this.Size;

            if (!string.IsNullOrEmpty(customerId))
            {
                // load customer and set as active.
                SetCustomerAsCurrent(customerId);
            }
        }
        /// <summary>
        /// CTor
        /// </summary>
        public CustomerSelector(INorthwindService service)
        {
            InitializeComponent();

            // get all customers
            _allCustomers = service.GetAllCustomers();
            // bind to grid.
            customersDataGrid.DataSource = _allCustomers;

            if (_allCustomers.Count > 0)
            {
                // there are customers, enable select button
                selectButton.Enabled = true;

                // select first row.
                customersDataGrid.Select(0);
            }
        }
Beispiel #7
0
 public ImagesController(INorthwindService service, IConfiguration config, ILogger <HomeController> log)
 {
     this.service  = service;
     configuration = config;
     logger        = log;
 }
 public ProductsController(INorthwindService service, IConfiguration config, ILogger <ProductsController> log)
 {
     this.service  = service;
     configuration = config;
     logger        = log;
 }
 /// <summary>
 /// CTor
 /// </summary>
 public CustomerManager(INorthwindService service)
     : this(service, string.Empty)
 {
 }
 public CategoriesController(INorthwindService service, IConfiguration config, ILogger <CategoriesController> log)
 {
     this.service  = service;
     configuration = config;
     logger        = log;
 }
 public ValuesController(INorthwindService northwindService)
 {
     nwService = northwindService;
 }
Beispiel #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerWithOrdersDataScope"/> class.
 /// </summary>
 public CustomerWithOrdersDataScope(INorthwindService service)
 {
     _dalService = service;
 }