Exemplo n.º 1
0
        async void agregar_campo(object sender, System.EventArgs e)
        {
            if (await validarFormulario())
            {
                var dbpath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "UserDatabase.db");
                var db     = new SQLiteConnection(dbpath);
                db.CreateTable <Campo_custom>();

                var item = new Campo_custom()
                {
                    nombre_campo = EntryValor.Text,
                    IdColeccion  = this.idCollect
                };

                db.Insert(item);
                Device.BeginInvokeOnMainThread(async() =>
                {
                    //await Navigation.PopAsync();
                    this.recarga     = true;
                    var vUpdatedPage = new VerCamposCustom(this.objetoColeccion);
                    Navigation.InsertPageBefore(vUpdatedPage, this);
                    Navigation.PopAsync();
                });
            }
        }
Exemplo n.º 2
0
        async void agregar_campo(object sender, System.EventArgs e)
        {
            if (await validarFormulario())
            {
                var dbpath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "UserDatabase.db");
                var db     = new SQLiteConnection(dbpath);
                db.CreateTable <Campo_custom>();

                var item = new Campo_custom()
                {
                    nombre_campo = EntryValor.Text,
                    //IdColeccion = this.idcollect
                };

                db.Insert(item);
                Device.BeginInvokeOnMainThread(async() =>
                {
                    var result = await this.DisplayAlert("Agregada!", "Campo agregado", "OK", "Cancelar");

                    if (result)
                    {
                        await Navigation.PopAsync();
                    }
                });
            }
        }