Пример #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
        // Asynchronously do the 'service' works
        private void DoWork()
        {
            DateTime            today = DateTime.Now;
            VsmartsellDBContext db    = new VsmartsellDBContext();

            SendMailForInvoice(today, db);
            SendMailForNearEnd(today, db);
            SendMailAfterEnd(today, db);
            db.Dispose();
        }