public LoaihoaViewModel() { loaihoaRepository = new LoaihoaRepository(); LoadLoaihoa(); AddLoaiHoa = new Command(Insert); UpdateLoaiHoa = new Command(Update, CanExe); DeleteLoaiHoa = new Command(Delete, CanExe); loaihoa = new Loaihoa(); }
public ThemHoaViewMode() { loaihoaRepository = new LoaihoaRepository(); hoaRepository = new HoaRepository(); loaihoas = loaihoaRepository.GetLoaihoas(); dshoa = hoaRepository.GetHoas(); loaihoa = new Loaihoa(); hoa = new Hoa(); AddHoa = new Command(InsertHoa); }
public bool DeleteLoaihoa(Loaihoa h) { try { using (var connection = new SQLiteConnection(System.IO.Path.Combine(folder, "qlhoa.db"))) { connection.Delete(h); return(true); } } catch (SQLiteException ex) { return(false); } }
public bool UpdateLoaihoa(Loaihoa lh) { try { using (var connection = new SQLiteConnection(System.IO.Path.Combine(folder))) { connection.Update(lh); return(true); } } catch (SQLiteException ex) { return(false); } }
public bool InsertLoaihoa(Loaihoa lh) { try { using (var connection = new SQLiteConnection(System.IO.Path.Combine(folder, "qlhoa.db"))) { connection.Insert(lh); return(true); } } catch { return(false); } }
private void cmdGhi_Clicked(Object sender, EventArgs e) { HoaDatabase db = new HoaDatabase(); Loaihoa l = new Loaihoa { Tenloai = txtTenLoai.Text }; if (db.InsertLoaiHoa(l) == true) { DisplayAlert("Thông báo", "Thêm loại hoa thành công", "OK"); } else { DisplayAlert("Thông báo", "Thêm hoa bị lỗi", "OK"); } }
public bool UpdateLoaihoa(Loaihoa h) { try { using (var connection = new SQLiteConnection(System.IO.Path.Combine(folder, "qlhoa.db"))) { connection.Update(h); return(true); } } catch (SQLiteException ex) { // Log.Info("SQLiteEx", ex.Message); return(false); } }
public bool InsertLoaiHoa(Loaihoa loai) { try { //using (var connection = new // SQLiteConnection(System.IO.Path.Combine(folder, "qlhoa.db"))) //{ // connection.Insert(loai); // return true; //} using (var connection = new SQLiteConnection(System.IO.Path.Combine(folder, "qlhoa.db"))) { connection.Insert(loai); return(true); } } catch (SQLiteException ex) { // Log.Info("SQLiteEx", ex.Message); return(false); } }
public bool Insert(Loaihoa lh) { return db.InsertLoaihoa(lh); }
public bool Update(Loaihoa loaihoa) { return(db.UpdateLoaihoa(loaihoa)); }
public bool Delete(Loaihoa loaihoa) { return(db.DeleteLoaihoa(loaihoa)); }
public bool Insert(Loaihoa loaihoa) { return(db.InsertLoaihoa(loaihoa)); }
public bool Delete(Loaihoa lh) { return db.DeleteLoaihoa(lh); }
public bool Update(Loaihoa lh) { return db.UpdateLoaihoa(lh); }
public bool Delete(Loaihoa h) { return(db.DeleteLoaihoa(h)); }
public bool Update(Loaihoa h) { return(db.UpdateLoaihoa(h)); }
public bool Insert(Loaihoa h) { return(db.InserLoaihoa(h)); }