Example #1
0
        public OrdersOperations(IOrderView view, DataAccessOrder orderData)
        {
            this.view      = view;
            this.orderData = orderData;

            var orders = orderData.RetrieveOrder();

            this.view.LoadOrder(orders);


            view.Add += () =>
            {
                var order = view.AddOrder();
                orderData.AddOrder(order);

                DataAccessActivity activity = new DataAccessActivity();
                var a = view.AddOrderActivity();
                activity.AddActivity(a);

                view.TotalOrder();
            };

            view.Updatee += () =>
            {
                var order = view.UpdateOrder();
                orderData.UpdateOrder(order);
            };



            view.Ret += () =>
            {
                orders = orderData.RetrieveOrder();
                this.view.LoadOrder(orders);
            };

            view.AddProduct += () =>
            {
                AddProdus();
            };

            view.Products += () =>
            {
                var productForm       = new FormProduct();
                var productRepository = new DataAccessProduct();
                var productPresenter  = new ProductOperations(productForm, productRepository);
                productForm.Show();
            };
            view.EmployeeCustomer += () =>
            {
                var customerForm       = new FormCustomerEmployee();
                var customerRepository = new DataAccessCustomer();
                var customerPresenter  = new CustomerOperations(customerForm, customerRepository);
                customerForm.Show();

                var productForm       = new FormProduct();
                var productRepository = new DataAccessProduct();
                var productPresenter  = new ProductOperations(productForm, productRepository);
            };
        }
Example #2
0
        private void btnReports_Click(object sender, EventArgs e)
        {
            var orderForm       = new FormOrder();
            var orderRepository = new DataAccessOrder();
            var orderPresenter  = new OrdersOperations(orderForm, orderRepository);

            orderForm.Show();
        }
        public void UpdateOrder(Order order)
        {
            DataAccessOrder dal = new DataAccessOrder();

            dal.UpdateOrder(order);
        }
        public void AddOrder(Order order)
        {
            DataAccessOrder dal = new DataAccessOrder();

            dal.AddOrder(order);
        }
        public IList <Order> RetrieveOrderList()
        {
            DataAccessOrder dal = new DataAccessOrder();

            return(dal.RetrieveOrder());
        }