Example #1
0
        private void Button_Clicked_1(object sender, EventArgs e)
        {
            using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(App.DB_PATH))
            {
                reteta reteta = new reteta();
                conn.DropTable <reteta>();

                DisplayAlert("Succes", "Lista de cumparaturi este stearsa", "OK");
            }
        }
Example #2
0
        private void Button_Clicked(object sender, EventArgs e)
        {
            reteta reteta = new reteta()
            {
                NumeReteta  = numeReteta.Text,
                Ingrediente = ingredienteReteta.Text
            };

            using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(App.DB_PATH))
            {
                if (numeReteta.Text == null && ingredienteReteta.Text == null)
                {
                    DisplayAlert("Eroare", "Campurile trebuie completate", "OK");
                }

                else
                {
                    conn.CreateTable <reteta>();
                    conn.Insert(reteta);
                    DisplayAlert("Succes", "Reteta a fost introdusa in lista", "OK");
                }
            }
        }