public void SynchronizeTableConfig( ) { Dictionary <String, STTableConfigInfo> lstConfig = new Dictionary <String, STTableConfigInfo>(); STTableConfigController aliasCtrl = new STTableConfigController(); DataSet ds = aliasCtrl.GetAllObjects(); if (ds != null && ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { STTableConfigInfo configInfo = (STTableConfigInfo)aliasCtrl.GetObjectFromDataRow(dr); if (configInfo != null) { lstConfig.Add(configInfo.TableName, configInfo); } } } foreach (String strTableName in ABCDataLib.Tables.StructureProvider.DataTablesList.Keys) { if (lstConfig.ContainsKey(strTableName) == false) { STTableConfigInfo newInfo = new STTableConfigInfo(); newInfo.TableName = strTableName; newInfo.CaptionEN = strTableName; newInfo.IsCaching = false; aliasCtrl.CreateObject(newInfo); } } }
private void btnSave_Click(object sender, EventArgs e) { DevExpress.Utils.WaitDialogForm waiting = new DevExpress.Utils.WaitDialogForm(); waiting.SetCaption("Saving . . .!"); waiting.Text = ""; waiting.Show(); Cursor.Current = Cursors.WaitCursor; STTableConfigController aliasCtrl = new STTableConfigController(); foreach (DataRow dr in ((DataTable)this.gridControl1.DataSource).Rows) { STTableConfigInfo aliasInfo = (STTableConfigInfo)aliasCtrl.GetObjectFromDataRow(dr); if (aliasInfo != null) { aliasCtrl.UpdateObject(aliasInfo); } } ABCDataLib.Tables.ConfigProvider.InvalidateConfigList(); InvalidateData(); Cursor.Current = Cursors.Default; waiting.Close(); }