Exemplo n.º 1
0
        private void Complete(object obj)
        {
            var result = obj as Item;

            //res.Listo = true;
            CompralistContext.Item_Complete(result, Username);
            //CompralistContext = App.CompralistContext;
        }
Exemplo n.º 2
0
        private async void Delete(object obj)
        {
            var item = obj as Item;

            //App.CompralistContext.ListItems.Remove(item);
            //App.CompralistContext.Item_Delete(item);
            CompralistContext.Item_Delete(item);
            //await App.Current.MainPage.DisplayToastAsync("DeleteCommand activado", 500);
            //CompralistContext.ListItems = App.CompralistContext.ListItems;
        }
Exemplo n.º 3
0
        private async void Add(object obj)
        {
            string result = await App.Current.MainPage.DisplayPromptAsync("Agregando...", "¿Que quieres agregar?", "Agregar", "Cancelar", "", 45);

            if (!string.IsNullOrWhiteSpace(result))
            {
                CompralistContext.Item_Add(result, Username);
            }
            //CompralistContext.List_OrderBy();
        }
Exemplo n.º 4
0
        //string hostURL = "https://compralist-web.conveyor.cloud/compraListHub";
        //"https://compralist.itesrc.net/compraListHub";


        public MainPage_VM()
        {
            CompralistContext = App.CompralistContext;
            CompralistContext.List_OrderBy();
            UserAvatar   = App.UserAvatar;
            AvatarString = Enum.GetName(typeof(Avatar), UserAvatar);
            Username     = App.Username;

            UserCommand     = new Command(User);
            DeleteCommand   = new Command(Delete);
            AddCommand      = new Command(Add);
            CompleteCommand = new Command(Complete);
        }