Esempio n. 1
0
 public IList <OrderResponse> FilterOrder(
     [FromBody] OrderRequest request)
 {
     log.Info(string.Format(LogMessages.RequestMethod, RequestContext.Principal.Identity.Name, $"orders\\filter"));
     request = _repo.EditRequest(request, RequestContext.Principal.Identity.Name);
     return(OrderListAdapter.ConvertOrderList(_repo.GetOrders(request)));
 }
Esempio n. 2
0
        //Loading data
        public void InitData()
        {
            progress = new ProgressDialog(this, Resource.Style.StyledDialog);
            progress.Indeterminate = true;
            progress.SetMessage("Please wait...");
            progress.SetCancelable(true);
            progress.Show();

            orderListAdapter      = new OrderListAdapter(this, OrderController.GetOrderList(StartDate));
            orderListView.Adapter = orderListAdapter;

            this.mNotes.Text = OrderController.GetOrderNotes(StartDate);

            RegisterForContextMenu(orderListView);

            if (StartDate != Utility.GetTodayDate())
            {
                this.buttonOrder.Visibility = ViewStates.Invisible;
                this.buttonSend.Visibility  = ViewStates.Invisible;
                this.buttonAmend.Visibility = ViewStates.Invisible;
            }
            else
            {
                this.buttonOrder.Visibility = ViewStates.Visible;
                this.buttonSend.Visibility  = ViewStates.Visible;

                if (!Settings.CKStaff)
                {
                    this.buttonAmend.Visibility = ViewStates.Visible;
                }
            }

            progress.Dismiss();
        }
Esempio n. 3
0
        private void InitData()
        {
            if (orders == null)
            {
                return;
            }
            OrderListAdapter adapter = new OrderListAdapter(orders);

            orderList.SetAdapter(adapter);
        }
Esempio n. 4
0
        public void LoadOrderList()
        {
            StartDate            = Utility.GetTodayDate();
            StartDatePicker.Text = StartDate.ToString("dd'/'MM'/'yyyy");

            var items = Intent.GetParcelableArrayListExtra("key");

            if (items != null)
            {
                items = items.Cast <OrderList1> ().ToArray();

                List <OrderList> orderList = new List <OrderList> ();

                foreach (OrderList1 item in items)
                {
                    OrderList order = new OrderList();
                    order.StockId      = item.Id;
                    order.StockName    = item.StockName;
                    order.Unit         = item.Unit;
                    order.ShouldNumber = item.ShouldNumber;
                    order.StockNumber  = item.StockNumber;
                    order.OrderNumber  = item.OrderNumber;
                    if (item.IsSkip == 0)
                    {
                        order.IsSkip = false;
                    }
                    else
                    {
                        order.IsSkip = true;
                    }

                    orderList.Add(order);
                }

                orderListAdapter      = new OrderListAdapter(this, orderList);
                orderListView.Adapter = orderListAdapter;

                this.mNotes.Text = OrderController.GetOrderNotes(Utility.GetTodayDate());
            }
            else
            {
                InitData();
            }
        }
Esempio n. 5
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View v = inflater.Inflate(Resource.Layout.fragment_my_orders, container, false);
            ISharedPreferences pref = Application.Context.GetSharedPreferences("UserInfo", FileCreationMode.Private);

            userName = pref.GetString("Username", String.Empty);

            controller     = new Controller();
            mRecycleView   = v.FindViewById <RecyclerView>(Resource.Id.ordersListRecyclerView);
            mLayoutManager = new LinearLayoutManager(Activity);
            mRecycleView.SetLayoutManager(mLayoutManager);
            ordersList          = new OrdersList(userName);
            mAdapter            = new OrderListAdapter(ordersList);
            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);

            return(v);
        }
Esempio n. 6
0
		//Loading data
		public void InitData(){

			progress = new ProgressDialog (this,Resource.Style.StyledDialog);
			progress.Indeterminate = true;
			progress.SetMessage("Please wait...");
			progress.SetCancelable (true);
			progress.Show ();

			orderListAdapter = new OrderListAdapter (this, OrderController.GetOrderList(StartDate));
			orderListView.Adapter = orderListAdapter;

			this.mNotes.Text = OrderController.GetOrderNotes (StartDate);

			RegisterForContextMenu(orderListView);

			if (StartDate != Utility.GetTodayDate ()) {
				this.buttonOrder.Visibility = ViewStates.Invisible;
				this.buttonSend.Visibility = ViewStates.Invisible;
				this.buttonAmend.Visibility = ViewStates.Invisible;
			} else {
				this.buttonOrder.Visibility = ViewStates.Visible;
				this.buttonSend.Visibility = ViewStates.Visible;

				if(!Settings.CKStaff)
					this.buttonAmend.Visibility = ViewStates.Visible;
			}

			progress.Dismiss ();
		}
Esempio n. 7
0
		public void LoadOrderList()
		{

			StartDate = Utility.GetTodayDate();
			StartDatePicker.Text = StartDate.ToString("dd'/'MM'/'yyyy");

			var  items = Intent.GetParcelableArrayListExtra("key");
			if (items != null) {
				
				items = items.Cast<OrderList1> ().ToArray ();

				List<OrderList> orderList = new List<OrderList> ();

				foreach (OrderList1 item in items) {
					
					OrderList order = new OrderList ();
					order.StockId = item.Id;
					order.StockName = item.StockName;
					order.Unit = item.Unit;
					order.ShouldNumber = item.ShouldNumber;
					order.StockNumber = item.StockNumber;
					order.OrderNumber = item.OrderNumber;
					if (item.IsSkip == 0) {
						order.IsSkip = false;
					}
					else
						order.IsSkip = true;
					
					orderList.Add (order);

				}

				orderListAdapter = new OrderListAdapter (this, orderList);
				orderListView.Adapter = orderListAdapter;

				this.mNotes.Text = OrderController.GetOrderNotes (Utility.GetTodayDate ());

			}
			else
			{			
				InitData ();
			}
		}