Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
        private void InvalidateData( )
        {
            DataSet ds = new STTableConfigController().GetAllObjects();

            if (ds != null && ds.Tables.Count > 0)
            {
                this.gridControl1.DataSource = ds.Tables[0];
            }
        }
Exemplo n.º 3
0
        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();
        }