public bool addCTHDChi(CT_HoaDonChi cthdChi) { try { da = new QLCafeDataContext(); da.CT_HoaDonChis.InsertOnSubmit(cthdChi); da.SubmitChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.Message); } }
public bool deleteCTHDChi(string maHD, string maNL) { try { da = new QLCafeDataContext(); CT_HoaDonChi hd = da.CT_HoaDonChis.Where(o => o.maHDC == maHD && o.maNL == maNL).FirstOrDefault(); da.CT_HoaDonChis.DeleteOnSubmit(hd); da.SubmitChanges(); return(true); } catch { return(false); } }