Exemple #1
0
        //Handle when user click Back on tablet
        public override void OnBackPressed()
        {
            Intent Intent = new Intent(this, typeof(HomeActivity));

            var orderList = this.orderListAdapter.GetOrderList();

            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.PutParcelableArrayListExtra("key", Items.ToArray());

            Intent.SetFlags(ActivityFlags.ClearTask | ActivityFlags.NewTask);

            StartActivity(Intent);

            this.OverridePendingTransition(Resource.Animation.slide_in_top, Resource.Animation.slide_out_bottom);

            this.Finish();
        }
Exemple #2
0
        //Handle when user click LIST button
        public void btFinalClick(object sender, EventArgs e)
        {
            //Save the last value
            //			try {
            //
            //				var stockNumber = Double.Parse (edit_Stock.Text);
            //
            //				if (Settings.CKStaff || this.EditType == "amend") {
            //					this.orderListAdapter.SetOrderAtPosition (selectedIndex, stockNumber);
            //				}
            //				else
            //				{
            //					this.orderListAdapter.SetStockAtPosition (selectedIndex, stockNumber);
            //					this.orderListAdapter.SetOrderAtPosition (selectedIndex, this.orderListAdapter.GetItemAtPosition (selectedIndex).ShouldNumber - stockNumber);
            //				}
            //
            //
            //			} catch (Exception ew) {
            //
            //				Console.WriteLine (ew.StackTrace);
            //
            //				Toast.MakeText (this, "Input not valid", ToastLength.Short).Show ();
            //				return;
            //			}

            LoginController.Log(Constant.ButtonListClick);


            //Go back to homepage
            Intent Intent = new Intent(this, typeof(HomeActivity));

            var orderList = this.orderListAdapter.GetOrderList();

            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.PutParcelableArrayListExtra("key", Items.ToArray());

            Intent.SetFlags(ActivityFlags.ClearTask | ActivityFlags.NewTask);

            StartActivity(Intent);

            this.OverridePendingTransition(Resource.Animation.slide_in_top, Resource.Animation.slide_out_bottom);

            this.Finish();
        }
Exemple #3
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 #4
0
        public void btAmendClick(object sender, EventArgs e)
        {
            new AlertDialog.Builder(this)
            .SetPositiveButton("Yes", async(sender1, args) =>
            {
                LoginController.Log(Constant.ButtonAmendClick);

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

                var orderList = this.orderListAdapter.GetOrderList();

                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.PutParcelableArrayListExtra("key", Items.ToArray());

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

                StartActivity(Intent);

                this.OverridePendingTransition(Resource.Animation.slide_in_top, Resource.Animation.slide_out_bottom);
            })
            .SetNegativeButton("No", (sender3, args) =>
            {
                // User pressed no
            })
            .SetTitle("This button will allow you to enter or change the order number, Continue ?")
            .Show();
        }