Пример #1
0
        public void SaveTables( )
        {
            ABCWaitingDialog.Show("", "Saving . . .!");

            if (this.ViewFieldConfig.DataSource != null)
            {
                STFieldConfigsController configCtrl = new STFieldConfigsController();
                foreach (DataRow dr in ((DataView)this.ViewFieldConfig.DataSource).Table.Rows)
                {
                    STFieldConfigsInfo configInfo = (STFieldConfigsInfo)configCtrl.GetObjectFromDataRow(dr);
                    if (configInfo != null)
                    {
                        configCtrl.UpdateObject(configInfo);
                        isModified = true;
                    }
                }
            }
            STTableConfigsController aliasCtrl = new STTableConfigsController();

            foreach (STTableConfigsInfo aliasInfo in TableList)
            {
                aliasCtrl.UpdateObject(aliasInfo);
            }

            DataConfigProvider.SynchronizeTableConfigs();
            InvalidateTableList();

            ABCWaitingDialog.Close();

            isNeedSaveTable = false;
        }
Пример #2
0
        void Form_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (isNeedSaveField || isNeedSaveTable)
            {
                DialogResult result = ABCHelper.ABCMessageBox.Show("Do you want to save ?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    STTableConfigsInfo objTableConfig = (STTableConfigsInfo)ViewTableConfig.GetRow(ViewTableConfig.FocusedRowHandle);
                    if (objTableConfig != null && String.IsNullOrWhiteSpace(objTableConfig.TableName) == false)
                    {
                        SaveFieldConfig(objTableConfig.TableName);
                    }

                    SaveTables();
                }
            }

            if (isModified)
            {
                DataConfigProvider.SynchronizeTableConfigs();
                foreach (HostSurface surface in OwnerStudio.SurfaceManager.DesignSurfaces)
                {
                    (surface.DesignerHost.RootComponent as ABCView).RefreshBindingControl();
                }
            }
        }