Exemplo n.º 1
0
 public RestaurentViewModel()
 {
     user             = MainPageViewModel.GetCurrentUser();
     AddRestaurant    = new Command(AddRestaurantPage);
     ModifyRestaurant = new Command <object>(ModifyRestaurantPage);
     RestaurantList   = DBHelper.GetRestaurantList(new DBHelper(), user);
 }
Exemplo n.º 2
0
 public OwnerViewModel()
 {
     Restaurant = new Command(RestaurantDetails);
     Category   = new Command(CategoryDetails);
     Item       = new Command(ItemDetails);
     Logout     = new Command(UserLogout);
     user       = MainPageViewModel.GetCurrentUser();;
 }
        private void AddItemToCart(object obj)
        {
            var deleteSame = _addedItemList.FirstOrDefault(cus => cus.item_id == (obj as Item).item_id);

            _addedItemList.Remove(deleteSame);
            if ((obj as Item).quantity > 0)
            {
                _addedItemList.Add(obj as Item);
            }
            cart = new Cart()
            {
                // item = JsonConvert.SerializeObject(_addedItemList.ToArray()),
                cart_total = calculateTotal(_addedItemList),
                user_id    = MainPageViewModel.GetCurrentUser().user_id,
                rest_id    = rest.rest_id,
                rest_name  = rest.rest_name,
                item_count = _itemCount,
                cartItems  = _addedItemList,
            };
        }
Exemplo n.º 4
0
 public ItemViewModel()
 {
     user           = MainPageViewModel.GetCurrentUser();
     Submit         = new Command(SubmitItem);
     RestaurantList = GetAllRestaurants();
 }
Exemplo n.º 5
0
 public AddRestaurentViewModel()
 {
     AddRestaurantDetails = new Command(AddRestaurant);
     user = MainPageViewModel.GetCurrentUser();
 }
Exemplo n.º 6
0
 public CategoryViewModel()
 {
     user           = MainPageViewModel.GetCurrentUser();
     Submit         = new Command(SubmitCategory);
     RestaurantList = GetAllRestaurants();
 }