public void SaveFolderListToDb()
        {
            using (var db = new Models.DatabaseContext())
            {
                var folders = db.Folders.ToList();

                foreach (var folder in folders)
                {
                    if (!_parentForm.FolderList.ContainsKey(folder.FolderName))
                    {
                        db.Folders.Remove(folder);
                    }
                }

                db.SaveChanges();

                foreach (var folder in _parentForm.FolderList.Values)
                {
                    db.Folders.AddOrUpdate(folder);
                }

                db.SaveChanges();
            }
        }
        public void SaveCollectionToDb()
        {
            using (var db = new Models.DatabaseContext())
            {
                var emails = db.Emails.ToList();

                foreach (var email in emails)
                {
                    if (!_parentForm.FolderList.ContainsKey(email.Id))
                    {
                        db.Emails.Remove(email);
                    }
                }

                db.SaveChanges();

                foreach (var email in _parentForm.EmailCollection.Values)
                {
                    db.Emails.AddOrUpdate(email);
                }

                db.SaveChanges();
            }
        }