public List<DANGKYHOATDONG> SelectDANGKYHOATDONGbyMASV(int MaNguoiDung)
        {
            List<DANGKYHOATDONG> dsDKHoatDong = new List<DANGKYHOATDONG>();
            using (LinQDataContext db = new LinQDataContext(global::DAOAuction.Properties.Settings.Default.webdoantruongConnectionString))
            {
                ISingleResult<DANGKYHOATDONG_selectbySinhVienResult> lp = db.DANGKYHOATDONG_selectbySinhVien(MaNguoiDung);
                foreach (DANGKYHOATDONG_selectbySinhVienResult aDKHoatDong in lp)
                {
                    DANGKYHOATDONG var1 = new DANGKYHOATDONG();
                    var1.MaHoatDong = aDKHoatDong.MaHoatDong;
                    var1.MaNguoiDung = aDKHoatDong.MaNguoiDung;
                    dsDKHoatDong.Add(var1);
                }

                try
                {
                    // Save the changes.
                    db.SubmitChanges();
                }
                // Detect concurrency conflicts.
                catch (ChangeConflictException)
                {
                    // Resolve conflicts.
                    db.ChangeConflicts.ResolveAll(RefreshMode.KeepChanges);
                }
            }
            return dsDKHoatDong;
        }
 public int CapNhat(DANGKYHOATDONG lpDTO)
 {
     try
     {
         LinQDataContext db = new LinQDataContext(global::DAOAuction.Properties.Settings.Default.webdoantruongConnectionString);
         return db.DANGKYHOATDONG_update(
             lpDTO.MaNguoiDung,
             lpDTO.MaHoatDong
             );
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
 public int Xoa(DANGKYHOATDONG lpDTO)
 {
     DAODangKyHoatDong DANGKYHOATDONG = new DAODangKyHoatDong();
     return DANGKYHOATDONG.Xoa(lpDTO);
 }
 public int Them(DANGKYHOATDONG lpDTO)
 {
     DAODangKyHoatDong DANGKYHOATDONG = new DAODangKyHoatDong();
     return DANGKYHOATDONG.Them(lpDTO);
 }
 public int CapNhat(DANGKYHOATDONG lpDTO)
 {
     DAODangKyHoatDong DANGKYHOATDONG = new DAODangKyHoatDong();
     return DANGKYHOATDONG.CapNhat(lpDTO);
 }
 public int Xoa(DANGKYHOATDONG lpDTO)
 {
     try
     {
         LinQDataContext db = new LinQDataContext(global::DAOAuction.Properties.Settings.Default.webdoantruongConnectionString);
         db.DANGKYHOATDONG_delete(
             lpDTO.MaNguoiDung,
             lpDTO.MaHoatDong
             );
         db.SubmitChanges();
         return 0;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }