public int InsertHoaDon(HoaDonBan hd) { try { db.HoaDonBans.InsertOnSubmit(hd); db.SubmitChanges(); } catch { return -1; } return 1; }
public int UpdateHoaDonBan(HoaDonBan hd) { try { HoaDonBan d = db.HoaDonBans.SingleOrDefault(n => n.id == hd.id); d.idtthoadon = hd.idtthoadon; db.SubmitChanges(); } catch { return -1; } return 1; }
partial void DeleteHoaDonBan(HoaDonBan instance);
partial void UpdateHoaDonBan(HoaDonBan instance);
partial void InsertHoaDonBan(HoaDonBan instance);
private void detach_HoaDonBans(HoaDonBan entity) { this.SendPropertyChanging(); entity.TTHoaDon = null; }
private void attach_HoaDonBans(HoaDonBan entity) { this.SendPropertyChanging(); entity.TTHoaDon = this; }