コード例 #1
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();
        }
コード例 #2
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();
            }
        }