public Orders( IInputBoundary <Input> orderHexagonalTemplateBoundary, OrderPresenter orderHexagonalTemplatePresenter) { this.orderHexagonalTemplateBoundary = orderHexagonalTemplateBoundary; this.orderHexagonalTemplatePresenter = orderHexagonalTemplatePresenter; }
public Orders( IInputBoundary <Input> orderEventSourcingTemplateBoundary, OrderPresenter orderEventSourcingTemplatePresenter) { this.orderEventSourcingTemplateBoundary = orderEventSourcingTemplateBoundary; this.orderEventSourcingTemplatePresenter = orderEventSourcingTemplatePresenter; }
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(); }
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); }
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>(); }
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(); } }
public void Setup() { _testOrder2 = TestCommon.TestOrder2; TestDbContext.ClearData(); StoreTestProducts(); StoreTestOrder(); _viewMock = new OrderViewMock(); _presenter = new OrderPresenter(_viewMock, TestDbContext.Instance); }
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)); }
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); } }
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) }) })); }
public OrderPage() { _presenter = new OrderPresenter(this, DbContext); }
public Save(OrderPresenter presenter) { _presenter = presenter; }
public Cancel(OrderPresenter presenter) { _presenter = presenter; }
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)); } }
public Back(OrderPresenter presenter) { _presenter = presenter; }
private void InitlizaPresenter() { Presenter = CreatePresenter<OrderPresenter>(); Presenter.View = this; }
public OrderView(IRestAPI api, ISettings settings, Order order) { InitializeComponent(); presenter = new OrderPresenter(this, api, settings, order); }
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(); }