Example #1
0
 public OrderListViewModel(OrderListView orderListView)
 {
     this.orderListView = orderListView;
     this.orderListView.EditBtn.Click        += EditBtn_Click;
     this.orderListView.AddB.Click           += AddB_Click;
     this.orderListView.SearchOrderBtn.Click += SearchOrderBtn_Click;
     this.orderListView.ClientListUserControl.LoadItems();
 }
 public void SetView(OrderAddAmendView viewAddAmend, OrderListView viewOrderList)
 {
     _viewOrderList                    = viewOrderList;
     _viewAddAmend                     = viewAddAmend;
     _viewAddAmend.ViewLoaded         += ViewLoaded;
     _viewAddAmend.CloseButtonClicked += CloseButtonClicked;
     _viewAddAmend.SaveButtonClicked  += SaveButtonClicked;
 }
        public OrderAddAmendView(OrderListView viewOrderList)
        {
            InitializeComponent();

            OrderAddAmendPresenter PresenterLayer = new OrderAddAmendPresenter();

            PresenterLayer.SetView(this, viewOrderList);

            _presenterAddAmend = PresenterLayer;
        }
Example #4
0
        public void SetView(OrderListView view)
        {
            _view                      = view;
            _view.ViewLoaded          += ViewLoaded;
            _view.AddButtonClicked    += AddButtonClicked;
            _view.AmendButtonClicked  += AmendButtonClicked;
            _view.DeleteButtonClicked += DeleteButtonClicked;

            _model = new OrderListModel();
        }
 private void LoadOrders()
 {
     _orders = new ObservableCollection <Order>();
     _orders.Add(new Order {
         OrderNumber = "1000", Description = "An Order"
     });
     _orders.Add(new Order {
         OrderNumber = "2000", Description = "Another Order"
     });
     _orders.Add(new Order {
         OrderNumber = "3000", Description = "Yet Another Order"
     });
     OrderListView.SetOrders(_orders);
 }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bm = new BusinessModel();
            if (!IsPostBack)
            {
                listUsers = new List <string>();
                listUsers.Add("All");
                UserContext uc    = new UserContext();
                List <User> users = uc.getAllUsers();
                foreach (User u in users)
                {
                    listUsers.Add(u.UserName);
                }
                ddlUsers.DataSource = listUsers;
                ddlUsers.DataBind();
                ddlUsers.SelectedIndex = 0;
            }
            if (Session["Username"] == null || Session["Role"] == null)
            {
                Response.Redirect("404.aspx");
            }
            if (Session["Role"].ToString() == "Admin")
            {
                ddlUsers.Visible = true;
                if (ddlUsers.SelectedValue == "All")
                {
                    orders = bm.getAllOrders();
                }
                else
                {
                    orders = bm.getOrders(ddlUsers.SelectedValue);
                }

                OrderListView.DataSource = orders;
                OrderListView.DataBind();
            }
            else
            {
                orders = bm.getOrders(Session["Username"].ToString());
                OrderListView.DataSource = orders;
                OrderListView.DataBind();
            }
        }
        public OrderListView GetOrders([FromUri] OrderListQuery olq)
        {
            OrderListView olv = new OrderListView();

            olv.Count = db.Orders.Count();

            var orders = db.Orders.Include(o => o.Customer).Include(o => o.OrderItems).OrderByDescending(o => o.OrderDate).Skip(olq.PageSize * (olq.RowCount - 1)).Take(olq.PageSize).Select(o => new OrderListItemView
            {
                OrderCode    = o.OrderCode,
                Id           = o.Id,
                OrderStatus  = o.OrderStatus,
                OrderDate    = o.OrderDate,
                Contract     = o.Customer.CPhone,
                CustomerName = o.Customer.CName,
                ProductNames = o.OrderItems.Where(oi => oi.State == 0).Select(oi => oi.Describe).ToList <string>(),
                Remark       = o.Remark
            }).ToList();

            olv.OrderListViewItems = orders;
            return(olv);
        }
Example #8
0
 /// <summary>
 /// After the user finished with adding the orders to the selected table
 /// this method will send the selected table object to the OrderListViewModel
 /// to update order list
 /// </summary>
 /// <param name="obj"></param>
 private void OnReceiveMenuItemsClose(Object obj)
 {
     SendSelectedTableToOrderListMessenger.Default.Send <TableModel>(SelectedTable);
     OrderList = new OrderListView();
 }
Example #9
0
        private void SaleOrderListButton_Click(object sender, EventArgs e)
        {
            OrderListView orderList = new OrderListView();

            Helper.AssignFormToPanel(DashboardView.Container, orderList);
        }