public bool insertHoaDon(string mhd, string user, DateTime ngay)
 {
     try
     {
         hoadon h = new hoadon();
         h.mahd = mhd;
         h.username = user;
         h.ngaymua = ngay;
         h.hoanthanh = false;
         h.Active = true;
         db.hoadons.InsertOnSubmit(h);
         db.SubmitChanges();
         return true;
     }
     catch
     {
         return false;
     }
 }
		private void detach_hoadons(hoadon entity)
		{
			this.SendPropertyChanging();
			entity.user = null;
		}
		private void attach_hoadons(hoadon entity)
		{
			this.SendPropertyChanging();
			entity.user = this;
		}
 partial void Deletehoadon(hoadon instance);
 partial void Updatehoadon(hoadon instance);
 partial void Inserthoadon(hoadon instance);