示例#1
0
 public bool InsertHoa(Hoa hoa)
 {
     try
     {
         using (var connection = new SQLiteConnection
                                     (System.IO.Path.Combine(folder, "hoa.db")))
         {
             connection.Insert(hoa);
             return(true);
         }
     }
     catch (SQLiteException)
     {
         return(false);
     }
 }
示例#2
0
        private void Themhoaclick(object sender, EventArgs e)
        {
            database db = new database();

            Hoa h = new Hoa
            {
                Tenhoa = txttenhoa.Text,
                Image  = txthinh.Text,
                Ghichu = txtmota.Text,
            };

            if (db.InsertHoa(h) == true)
            {
                DisplayAlert("Notify", "Success", "Ok");
            }
            else
            {
                DisplayAlert("Notify", "False", "Ok");
            }
        }