Exemple #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();
        }
Exemple #2
0
        public void btOrderClick(object sender, EventArgs e)
        {
            LoginController.Log(Constant.ButtonOrderClick);

            Intent Intent = new Intent(this, typeof(OrderActivity));

            var CurrentDate = Utility.GetTodayDate();

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

            //get current data
            if (CurrentDate == this.StartDate)
            {
                LoginController.Log("CurrentDate == this.StartDate: " + this.StartDate.ToShortDateString());

                orderList = this.orderListAdapter.GetOrderList();
            }
            //get the newest data
            else
            {
                LoginController.Log("CurrentDate != this.StartDate: " + CurrentDate.ToShortDateString());

                orderList = OrderController.GetOrderList(CurrentDate);
            }

            List <OrderList1> Items = new List <OrderList1>();

            foreach (var order in orderList)
            {
                var isSkip = 0;

                if (order.IsSkip)
                {
                    isSkip = 1;
                }

                OrderList1 item = new OrderList1(order.StockId, order.StockName, order.ShouldNumber, order.StockNumber, order.OrderNumber, order.Unit, isSkip);
                Items.Add(item);
            }

            Intent.PutExtra("type", "order");

            Intent.PutParcelableArrayListExtra("key", Items.ToArray());

            StartActivity(Intent);

            this.OverridePendingTransition(Resource.Animation.slide_in_top, Resource.Animation.slide_out_bottom);
        }
Exemple #3
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 OrderAddListAdapter(this, OrderController.GetOrderList(StartDate));

            orderListView.Adapter = orderListAdapter;


            RegisterForContextMenu(orderListView);

            progress.Dismiss();
        }