Esempio n. 1
0
        public override bool Delete(Supplier supplier)
        {
            Address      address = _context.Addresses.Find(supplier.AddressId);
            PhoneNumber  number  = _context.PhoneNumbers.Find(supplier.PhoneNumberId);
            EmailAddress email   = _context.EmailAddresses.Find(supplier.EmailAddressId);

            _context.Addresses.Remove(address);
            _context.PhoneNumbers.Remove(number);
            _context.EmailAddresses.Remove(email);
            _context.Suppliers.Remove(supplier);
            _context.SaveChanges();
            _context.Dispose();
            return(true);
        }
Esempio n. 2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Esempio n. 3
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         _ERSAIDB?.Dispose();
         _IMSDB?.Dispose();
         _PayslipsDb?.Dispose();
     }
     base.Dispose(disposing);
 }