コード例 #1
0
 public Orders(
     IInputBoundary <Input> orderHexagonalTemplateBoundary,
     OrderPresenter orderHexagonalTemplatePresenter)
 {
     this.orderHexagonalTemplateBoundary  = orderHexagonalTemplateBoundary;
     this.orderHexagonalTemplatePresenter = orderHexagonalTemplatePresenter;
 }
コード例 #2
0
 public Orders(
     IInputBoundary <Input> orderEventSourcingTemplateBoundary,
     OrderPresenter orderEventSourcingTemplatePresenter)
 {
     this.orderEventSourcingTemplateBoundary  = orderEventSourcingTemplateBoundary;
     this.orderEventSourcingTemplatePresenter = orderEventSourcingTemplatePresenter;
 }
コード例 #3
0
        async Task LoadOrders(string value)
        {
            LoadingManager.OnLoading();
            Status _statusvalue = (Status)Enum.Parse(typeof(Status), value);

            var orderData = await orderDataStore.GetOrdersOfUserWithSpecificStatus(App.LogUser.UserId, _statusvalue, App.TokenDto.Token);


            KeyValues.Clear();

            KeyValues.Add("orderAdded", orderData);

            UserOrders.Clear();

            foreach (var item in orderData)
            {
                item.StoreOrder = await StoreDataStore.GetItemAsync(item.StoreId.ToString());

                var presenter = new OrderPresenter(item);

                UserOrders.Add(presenter);
            }

            LoadingManager.OffLoading();
        }
コード例 #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // Application.Run(new OrdersF());
            //Application.Run(new ProductsF());
            // Application.Run(new UsersF());
            //Application.Run(new LoginForm());

            var uD = new UserData();
            var pD = new ProductData();
            var oD = new OrderData();
            var lF = new LoginForm();
            var oF = new OrderForm();
            var pF = new ProductForm();
            var uF = new UserForm();
            var uO = new UserOperations();
            var rD = new ReportData();

            var uP = new UserPresenter(uF, uD, rD);
            var oP = new OrderPresenter(oF, oD, rD);
            var pP = new ProductPresenter(pF, pD);
            var lP = new LoginPresenter(lF, uD, oF, pF, uF, uO);

            Application.Run(lF);
        }
コード例 #5
0
 public ProductController() // Constructor
 {
     pp            = new ProductPresenter();
     model         = new ProductCategoryViewModel();
     prolist       = new List <ProductCategoryViewModel>();
     scp           = new ShoppingCartPresenter();
     op            = new OrderPresenter();
     orderlist     = new List <OrderViewModel>();
     listcartmodel = new List <CartViewModel>();
 }
コード例 #6
0
 private void orderEntryToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!FormBuilder.IsFormUnique(this, FormEnum.Order))
     {
         var order          = new Order(this);
         var OrderPresenter = new OrderPresenter(order);
         order.MdiParent = this;
         order.Show();
     }
 }
コード例 #7
0
        public void Setup()
        {
            _testOrder2 = TestCommon.TestOrder2;

            TestDbContext.ClearData();

            StoreTestProducts();
            StoreTestOrder();
            _viewMock  = new OrderViewMock();
            _presenter = new OrderPresenter(_viewMock, TestDbContext.Instance);
        }
コード例 #8
0
        public IActionResult History(int id)
        {
            var query  = new CustomerHistoryEFQuery(_context);
            var result = query.Execute(id).orders.Select(o => new
            {
                o.id,
                lastModified = o.lastModified.ToString("MM/dd/yyyy H:mm"),
                status       = OrderPresenter.PresenetStatus(o.status)
            });

            return(Json(result));
        }
コード例 #9
0
        public async Task SetOrders()
        {
            var userOrderData = orderDataStore.GetUserOrders(App.LogUser.UserId);


            UserOrders.Clear();

            foreach (var item in userOrderData)
            {
                item.StoreOrder = await StoreDataStore.GetItemAsync(item.StoreId.ToString());

                var presenter = new OrderPresenter(item);

                UserOrders.Add(presenter);
            }
        }
コード例 #10
0
        public ActionResult Details(int id)
        {
            var query  = new OrderDetailsEFQuery(_context);
            var result = query.Execute(id);

            return(Json(new
            {
                result.id,
                status = OrderPresenter.PresenetStatus(result.status),
                creatAt = result.createdAt.ToString("MM/dd/yyyy H:mm"),
                products = result.products.Select(p => new
                {
                    p.id,
                    p.name,
                    p.sku,
                    p.descripciton,
                    status = OrderPresenter.PresentStatus(p.status)
                })
            }));
        }
コード例 #11
0
 public OrderPage()
 {
     _presenter = new OrderPresenter(this, DbContext);
 }
コード例 #12
0
ファイル: OrderView.cs プロジェクト: galievruslan/mss-mobile
 public Save(OrderPresenter presenter)
 {
     _presenter = presenter;
 }
コード例 #13
0
ファイル: OrderView.cs プロジェクト: galievruslan/mss-mobile
 public Cancel(OrderPresenter presenter)
 {
     _presenter = presenter;
 }
コード例 #14
0
ファイル: OrderView.cs プロジェクト: galievruslan/mss-mobile
        private void OrderViewLoad(object sender, EventArgs e)
        {
            if (_presenter == null) {
                if (_orderViewModel != null && _routePointViewModel != null)
                    _presenter = _presentersFactory.CreateOrderPresenter(this,
                                                                         _routePointViewModel,
                                                                         _orderViewModel);
                else {
                    if (_routePointViewModel != null)
                        _presenter = _presentersFactory.CreateOrderPresenter(this,
                                                                _routePointViewModel);
                    else
                        _presenter = _presentersFactory.CreateOrderPresenter(this, _orderViewModel);
                }

                _viewModel = _presenter.Initialize();

                _orderDateTextBox.Text = _viewModel.OrderDate.ToString(_localizationManager.Localization.GetLocalizedValue("dateformat"));
                _shippingDatePicker.Value = _viewModel.ShippingDate;
                _customerTextBox.Text = _viewModel.CustomerName;
                _shippingAddressTextBox.Text = _viewModel.ShippingAddressName;
                _priceListTextBox.Text = _viewModel.PriceListName;
                _warehouseTextBox.Text = _viewModel.WarehouseName;
                _amountValueLable.Text = _viewModel.Amount.ToString(_localizationManager.Localization.GetLocalizedValue("decimalformat"));
                _notesTextBox.Text = _viewModel.Note;

                orderItemListBox.ItemDataNeeded += ItemDataNeeded;
                orderItemListBox.ItemSelected += ItemSelected;
                orderItemListBox.SetListSize(_presenter.InitializeListSize());

                ViewContainer.RegisterLeftAction(new Save(_presenter));
                ViewContainer.RegisterRightAction(new Cancel(_presenter));
            }
        }
コード例 #15
0
ファイル: Main.cs プロジェクト: abonSerg/Clinic
 private void orderEntryToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!FormBuilder.IsFormUnique(this, FormEnum.Order))
     {
         var order = new Order(this);
         var OrderPresenter = new OrderPresenter(order);
         order.MdiParent = this;
         order.Show();
     }
 }
コード例 #16
0
 public Back(OrderPresenter presenter)
 {
     _presenter = presenter;
 }
コード例 #17
0
ファイル: OrderUI.cs プロジェクト: ravishankar54/Practice
 private void InitlizaPresenter()
 {
     Presenter = CreatePresenter<OrderPresenter>();
     Presenter.View = this;
 }
コード例 #18
0
 public OrderView(IRestAPI api, ISettings settings, Order order)
 {
     InitializeComponent();
     presenter = new OrderPresenter(this, api, settings, order);
 }
コード例 #19
0
        async Task LoadUserOrderWithStatus(string value)
        {
            LoadingManager.OnLoading();
            Status _statusvalue = (Status)Enum.Parse(typeof(Status), value);

            var orderData = await orderDataStore.GetOrdersOfUserWithSpecificStatus(App.LogUser.UserId, _statusvalue, App.TokenDto.Token);

            if (!KeyValues.ContainsKey("orderAdded"))
            {
                KeyValues.Add("orderAdded", orderData);
            }


            switch (_statusvalue)
            {
            case Status.Completed:
            {
                List <Order> tempData = new List <Order>();

                var data = await orderDataStore.GetOrdersOfUserWithSpecificStatusDifferent(KeyValues["orderAdded"], _statusvalue, App.LogUser.UserId);

                if (data != null)
                {
                    foreach (var item in KeyValues["orderAdded"])
                    {
                        if (!tempData.Any(o => o.OrderId == item.OrderId))
                        {
                            tempData.Add(item);
                        }
                    }

                    foreach (var item in data)
                    {
                        if (!tempData.Any(s => s.StoreId == item.StoreId))
                        {
                            tempData.Add(item);
                        }
                    }

                    KeyValues.Clear();
                    KeyValues.Add("orderAdded", tempData);


                    foreach (var item in KeyValues["orderAdded"])
                    {
                        if (!UserOrders.Any(s => s.OrderId == item.OrderId))
                        {
                            //Task.Run(async() =>
                            //{
                            //    item.StoreOrder = await StoreDataStore.GetItemAsync(item.StoreId.ToString());

                            //}).Wait();

                            item.StoreOrder = await StoreDataStore.GetItemAsync(item.StoreId.ToString());

                            var presenter = new OrderPresenter(item);

                            UserOrders.Add(presenter);
                        }
                    }
                }



                break;
            }

            case Status.NotSubmited:
            {
                List <Order> tempData = new List <Order>();

                var data = await orderDataStore.GetOrdersOfUserWithSpecificStatusDifferent(KeyValues["orderAdded"], _statusvalue, App.LogUser.UserId);

                if (data != null)
                {
                    foreach (var item in KeyValues["orderAdded"])
                    {
                        if (!tempData.Any(o => o.OrderId == item.OrderId))
                        {
                            tempData.Add(item);
                        }
                    }

                    foreach (var item in data)
                    {
                        if (!tempData.Any(s => s.StoreId == item.StoreId))
                        {
                            tempData.Add(item);
                        }
                    }

                    KeyValues.Clear();
                    KeyValues.Add("orderAdded", tempData);


                    foreach (var item in KeyValues["orderAdded"])
                    {
                        if (!UserOrders.Any(s => s.OrderId == item.OrderId))
                        {
                            item.StoreOrder = await StoreDataStore.GetItemAsync(item.StoreId.ToString());

                            var presenter = new OrderPresenter(item);

                            UserOrders.Add(presenter);
                        }
                    }
                }

                break;

                //UserOrders.Clear();

                //foreach (var item in orderData)
                //{

                //    item.StoreOrder = await StoreDataStore.GetItemAsync(item.StoreId.ToString());
                //    var presenter = new OrderPresenter(item);

                //    UserOrders.Add(presenter);
                //}
            }

            case Status.Submited:
            {
                List <Order> tempData = new List <Order>();

                var data = await orderDataStore.GetOrdersOfUserWithSpecificStatusDifferent(KeyValues["orderAdded"], _statusvalue, App.LogUser.UserId);

                if (data != null)
                {
                    foreach (var item in KeyValues["orderAdded"])
                    {
                        if (!tempData.Any(o => o.OrderId == item.OrderId))
                        {
                            tempData.Add(item);
                        }
                    }

                    foreach (var item in data)
                    {
                        if (!tempData.Any(s => s.StoreId == item.StoreId))
                        {
                            tempData.Add(item);
                        }
                    }

                    KeyValues.Clear();
                    KeyValues.Add("orderAdded", tempData);


                    foreach (var item in KeyValues["orderAdded"])
                    {
                        if (!UserOrders.Any(s => s.OrderId == item.OrderId))
                        {
                            item.StoreOrder = await StoreDataStore.GetItemAsync(item.StoreId.ToString());

                            var presenter = new OrderPresenter(item);

                            UserOrders.Add(presenter);
                        }
                    }
                }


                //UserOrders.Clear();

                //foreach (var item in orderData)
                //{

                //    item.StoreOrder = await StoreDataStore.GetItemAsync(item.StoreId.ToString());
                //    var presenter = new OrderPresenter(item);

                //    UserOrders.Add(presenter);
                //}

                break;
            }

            default:
                break;
            }

            LoadingManager.OffLoading();
        }