Esempio n. 1
0
        private void openFile(string path)
        {
            bool openOK = true;
            if (Path.GetDirectoryName(path).ToLower() == _repository.SourcesFolder.ToLower())
            {
                _source = MetaSource.LoadFromFile(path, _repository);
                _device = null;
            }
            else if (Path.GetDirectoryName(path).ToLower() == _repository.DevicesEmailFolder.ToLower())
            {
                _source = null;
                _device = OutputEmailDevice.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);
            }

            if (openOK)
            {
                Properties.Settings.Default.LastUsedFile = path;
            }
            IsModified = false;
            init();
        }
Esempio n. 2
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();
            }
            IsModified = true;
            init(entityToSelect);
        }
Esempio n. 3
0
 private void closeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!checkModified()) return;
     _source = null;
     _device = null;
     IsModified = false;
     toolStripHelper.SetHelperButtons(null);
     init();
 }
Esempio n. 4
0
 public bool CanSelectDevice(OutputDevice item)
 {
     return(!ForbiddenDevices.Exists(i =>
                                     (string.IsNullOrEmpty(i.Name) || i.Name == item.Name)
                                     ));
 }
Esempio n. 5
0
        public ReportOutput AddOutput(OutputDevice device)
        {
            ReportOutput result = ReportOutput.Create();
            result.Name = Helper.GetUniqueName(string.Format("output ({0})", device.Name), (from i in Outputs select i.Name).ToList());
            if (device is OutputFolderDevice)
            {
                result.FolderPath = Repository.SealRepositoryKeyword + "\\Reports\\";
                result.FileName = FileHelper.CleanFilePath(DisplayNameEx);
            }

            result.Report = this;
            result.OutputDeviceGUID = device.GUID;
            result.ViewGUID = ViewGUID;
            result.InitReferences();
            Outputs.Add(result);
            return result;
        }
Esempio n. 6
0
        public ReportOutput AddOutput(OutputDevice device)
        {
            ReportOutput result = ReportOutput.Create();
            result.Name = Helper.GetUniqueName(string.Format("output ({0})", device.Name), (from i in Outputs select i.Name).ToList());
            if (device is OutputFolderDevice)
            {
                result.FolderPath = string.IsNullOrEmpty(FilePath) ? Repository.SealRepositoryKeyword + "\\Reports\\" : Path.GetDirectoryName(FilePath).Replace(Repository.RepositoryPath, Repository.SealRepositoryKeyword);
                result.FileName = Repository.SealReportDisplayNameKeyword;
            }

            result.Report = this;
            result.OutputDeviceGUID = device.GUID;
            result.ViewGUID = ViewGUID;
            result.InitReferences();
            Outputs.Add(result);
            return result;
        }