Esempio n. 1
0
        private async void EditMenuItem()
        {
            if (ValidateInputs())
            {
                var menu = new Model.Menu()
                {
                    Id = menuId,
                    FoodDescription = editTextEditMenuDescription.Text,
                    Price           = Decimal.Parse(editTextEditMenuPrice.Text),
                    Available       = checkBoxMenuAvailabilityEdit.Checked,
                    CategoryId      = categoryList[spinnerMenuCategoriesEdit.SelectedItemPosition].Id
                };

                await menuService.SaveTableItemAsync(menu, false);

                Intent returnIntent = new Intent();
                SetResult(Result.Ok, returnIntent);

                Finish();
            }
            else
            {
                UserDialogs.Instance.Alert("Please enter the menu details");
            }
        }
Esempio n. 2
0
        public void AddToOrder(Model.Menu menu)
        {
            orderList.Add(menu);

            menuAdapter = new MenuAdapter(this, orderList);

            listviewOrderItems.Adapter = menuAdapter;

            SetPrice();
        }
Esempio n. 3
0
        public void EditMenu(Model.Menu menu)
        {
            Intent intent = new Intent(this, typeof(MenuEdit));

            intent.PutExtra("Id", menu.Id);
            intent.PutExtra("FoodDescription", menu.FoodDescription);
            intent.PutExtra("Price", string.Format("{0:N2}", menu.Price));
            intent.PutExtra("Available", menu.Available);
            intent.PutExtra("CategoryId", menu.CategoryId);
            StartActivityForResult(intent, 0);
        }