예제 #1
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!checkModified())
            {
                return;
            }

            _source = null;
            _device = null;

            object entityToSelect = null;

            if (sender == dataSourceToolStripMenuItem || sender == noSQLdataSourceToolStripMenuItem)
            {
                _source         = MetaSource.Create(_repository);
                _source.IsNoSQL = sender == noSQLdataSourceToolStripMenuItem;
                entityToSelect  = _source.Connection;
            }
            else if (sender == emailOutputDeviceToolStripMenuItem)
            {
                _device = OutputEmailDevice.Create();
            }
            else if (sender == fileServerDeviceToolStripMenuItem)
            {
                _device = OutputFileServerDevice.Create();
            }
            IsModified = true;
            init(entityToSelect);
        }
예제 #2
0
 void setContext(ITypeDescriptorContext context)
 {
     _metaConnection   = context.Instance as MetaConnection;
     _metaEnum         = context.Instance as MetaEnum;
     _metaTable        = context.Instance as MetaTable;
     _metaColumn       = context.Instance as MetaColumn;
     _metaJoin         = context.Instance as MetaJoin;
     _reportView       = context.Instance as ReportView;
     _reportOutput     = context.Instance as ReportOutput;
     _reportSchedule   = context.Instance as ReportSchedule;
     _parameter        = context.Instance as Parameter;
     _security         = context.Instance as SealSecurity;
     _emailDevice      = context.Instance as OutputEmailDevice;
     _fileServerDevice = context.Instance as OutputFileServerDevice;
     _model            = context.Instance as ReportModel;
     _configuration    = context.Instance as SealServerConfiguration;
 }
예제 #3
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!checkModified())
            {
                return;
            }

            _source = null;
            _device = null;

            object entityToSelect = null;

            if (sender == dataSourceToolStripMenuItem || sender == noSQLdataSourceToolStripMenuItem)
            {
                _source         = MetaSource.Create(_repository);
                _source.IsNoSQL = sender == noSQLdataSourceToolStripMenuItem;
                if (_source.IsNoSQL)
                {
                    //Add master table
                    MetaTable master = MetaTable.Create();
                    master.DynamicColumns = true;
                    master.IsEditable     = true;
                    master.Alias          = MetaData.MasterTableName;
                    master.Source         = _source;
                    _source.MetaData.Tables.Add(master);
                    entityToSelect = master;
                }
                else
                {
                    entityToSelect = _source.Connection;
                }
            }
            else if (sender == emailOutputDeviceToolStripMenuItem)
            {
                _device = OutputEmailDevice.Create();
            }
            else if (sender == fileServerDeviceToolStripMenuItem)
            {
                _device = OutputFileServerDevice.Create();
            }
            IsModified = true;
            init(entityToSelect);
        }
예제 #4
0
        private void openFile(string path)
        {
            bool openOK = true;

            try
            {
                if (Path.GetDirectoryName(path).ToLower() == _repository.SourcesFolder.ToLower())
                {
                    _source = MetaSource.LoadFromFile(path);
                    _source.InitReferences(_repository);
                    _device = null;
                }
                else if (Path.GetDirectoryName(path).ToLower() == _repository.DevicesEmailFolder.ToLower())
                {
                    _source = null;
                    _device = OutputEmailDevice.LoadFromFile(path, false);
                }
                else if (Path.GetDirectoryName(path).ToLower() == _repository.DevicesFileServerFolder.ToLower())
                {
                    _source = null;
                    _device = OutputFileServerDevice.LoadFromFile(path, false);
                }
                else
                {
                    openOK = false;
                    MessageBox.Show("The configuration file must be in a repository folder.\r\nA sub-folder of " + _repository.RepositoryPath, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                openOK = false;
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (openOK)
            {
                Properties.Settings.Default.LastUsedFile = path;
            }
            IsModified = false;
            init();
        }