public static void UpdateChiTietMua(ChiTietMuaModel ctm)
 {
     using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
     {
         cnn.Execute("update ChiTietMua set SOLUONG = @SoLuong ,DONGIA = @DonGia WHERE MAPHIEUMUAHANG = @maPhieuMuaHang AND MASP = @maSP", ctm);
     }
 }
 public static void RemoveChiTietMua(ChiTietMuaModel ctm)
 {
     using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
     {
         cnn.Execute("DELETE FROM CHITIETMUA WHERE MAPHIEUMUAHANG = @maPhieuMuaHang AND MASP = @maSP", ctm);
     }
 }
 public static long SaveChiTietMua(ChiTietMuaModel ctm)
 {
     using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
     {
         long lastRowID = (long)cnn.ExecuteScalar("insert into ChiTietMua(MAPHIEUMUA,MASP,SOLUONG,DONGIA,THANHTIEN) values (@MaPhieuMua,@MaSP,@SoLuong,@DonGia,@ThanhTien); SELECT last_insert_rowid()", ctm);
         //lastRowID dùng để xác định ID của một hàng vừa được thêm vào.
         return(lastRowID);
     }
 }