Ejemplo n.º 1
0
        public SACHKHUYENMAI deleteSachKhuyenMai(string MaSachKhuyenMai)
        {
            SACHKHUYENMAI skm = (from c in entity.SACHKHUYENMAIs where c.MASACH == MaSachKhuyenMai select c).FirstOrDefault();

            entity.SACHKHUYENMAIs.Remove(skm);
            entity.SaveChanges();
            return(skm);
        }
Ejemplo n.º 2
0
        public TAIKHOAN deleteTaiKhoan(string UserName)
        {
            TAIKHOAN tk = (from c in entity.TAIKHOANs where c.USERNAME == UserName select c).FirstOrDefault();

            entity.TAIKHOANs.Remove(tk);
            entity.SaveChanges();
            return(tk);
        }
        public CHITIETHOADON deleteHoaDon(int MaHoaDon)
        {
            CHITIETHOADON hoadon = (from c in entity.CHITIETHOADONs where c.MAHOADON == MaHoaDon select c).FirstOrDefault();

            entity.CHITIETHOADONs.Remove(hoadon);
            entity.SaveChanges();
            return(hoadon);
        }
Ejemplo n.º 4
0
        public TACGIA deleteTacGia(int MaTacGia)
        {
            TACGIA tg = (from c in entity.TACGIAs where c.MATG == MaTacGia select c).FirstOrDefault();

            entity.TACGIAs.Remove(tg);
            entity.SaveChanges();
            return(tg);
        }
Ejemplo n.º 5
0
        public KHO deleteKho(string MaKho)
        {
            KHO kho = (from c in entity.KHOes where c.MASACH == MaKho select c).FirstOrDefault();

            entity.KHOes.Remove(kho);
            entity.SaveChanges();
            return(kho);
        }
Ejemplo n.º 6
0
        public LOAISACH deleteLoaiSach(string MaLoaiSach)
        {
            LOAISACH loaisach = (from c in entity.LOAISACHes where c.MALOAISACH == MaLoaiSach select c).FirstOrDefault();

            entity.LOAISACHes.Remove(loaisach);
            entity.SaveChanges();
            return(loaisach);
        }
Ejemplo n.º 7
0
        public LINHVUC deleteLinhVuc(string MaLinhVuc)
        {
            LINHVUC linhvuc = (from c in entity.LINHVUCs where c.MALINHVUC == MaLinhVuc select c).FirstOrDefault();

            entity.LINHVUCs.Remove(linhvuc);
            entity.SaveChanges();
            return(linhvuc);
        }
Ejemplo n.º 8
0
        public THONGTINXUATBAN deleteThongTinXuatBan(string MaThongTinXuatBan)
        {
            THONGTINXUATBAN ttxb = (from c in entity.THONGTINXUATBANs where c.MASACH == MaThongTinXuatBan select c).FirstOrDefault();

            entity.THONGTINXUATBANs.Remove(ttxb);
            entity.SaveChanges();
            return(ttxb);
        }
Ejemplo n.º 9
0
 public SACH deleteSach(string MaSach)
 {
     try
     {
         SACH sach = (from c in entity.SACHes where c.MASACH == MaSach select c).FirstOrDefault();
         entity.SACHes.Remove(sach);
         entity.SaveChanges();
         return(sach);
     }
     catch (Exception)
     {
         return(null);
     }
 }
        public NHATKINHAPSACH deleteNhatKiNhapSach(int MaNhatKiNhapSach)
        {
            NHATKINHAPSACH nhatkinhapsach = (from c in entity.NHATKINHAPSACHes where c.STT == MaNhatKiNhapSach select c).FirstOrDefault();

            //entity.SaveChanges();
            KHO kho = (from c in entity.KHOes
                       where c.MASACH == nhatkinhapsach.MASACH
                       select c).FirstOrDefault();

            kho.TONGSOLUONG = kho.TONGSOLUONG - nhatkinhapsach.SOLUONG;
            if (kho.SOLUONGCON > kho.TONGSOLUONG)
            {
                kho.SOLUONGCON = kho.TONGSOLUONG;
            }
            entity.NHATKINHAPSACHes.Remove(nhatkinhapsach);
            entity.SaveChanges();



            return(nhatkinhapsach);
        }