コード例 #1
0
ファイル: ApplicationBrowser.cs プロジェクト: jb3622/Pimento
        public void RefreshGrid()
        {
            try
            {
                if (localDataContext == null)
                {
                    localDataContext = new LocalDataEntities(Properties.Settings.Default.LocalConnectionString);
                    localDataContext.DetectChanges();
                }
                bindingSource.DataSource = localDataContext.EDMApplications;

                foreach (var fieldName in new string[] {"Id", "UserMenuOptions", "Users"})
                {
                    var col = viewItems.Columns.ColumnByFieldName(fieldName);
                    if (col != null)
                    {
                        col.Visible = false;
                        col.OptionsColumn.ShowInCustomizationForm = false;
                    }
                }
                btnSave.Enabled = false;
                btnDelete.Enabled = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
ファイル: UserBrowser.cs プロジェクト: jb3622/Pimento
 public void RefreshGrid()
 {
     try
     {
         if (localDataContext == null)
         {
             localDataContext = new LocalDataEntities(Properties.Settings.Default.LocalConnectionString);
             localDataContext.DetectChanges();
         }
         bindingSource.DataSource = localDataContext.EDMUsers;
         btnSave.Enabled = false;
         btnDelete.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }