示例#1
0
        /// <summary>
        /// Add a new FolderSync
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormFolderSyncDetails f = new FormFolderSyncDetails(new FolderSync());

            if (f.ShowDialog() == DialogResult.OK)
            {
                MainDbContext.DB.FolderSyncs.Add(f.FolderSync);
                MainDbContext.DB.SaveChanges();
                RefreshControl();
            }
        }
示例#2
0
 /// <summary>
 /// Edit the selected FolderSync
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void butEdit_Click(object sender, EventArgs e)
 {
     if (lstFolderSyncs.SelectedItem != null)
     {
         FolderSync            folderSync = (FolderSync)lstFolderSyncs.SelectedItem;
         FormFolderSyncDetails f          = new FormFolderSyncDetails(folderSync);
         if (f.ShowDialog() == DialogResult.OK)
         {
             MainDbContext.DB.SaveChanges();
             RefreshControl();
         }
     }
 }