コード例 #1
0
        /// <summary>
        /// Отобразить форму редактирования или просмотра таблицы срезов
        /// </summary>
        public static void Show(string directory, string tableName, bool editMode, Log errLog)
        {
            if (string.IsNullOrEmpty(directory))
            {
                throw new ArgumentException("directory");
            }
            if (string.IsNullOrEmpty(tableName))
            {
                throw new ArgumentException("tableName");
            }
            if (errLog == null)
            {
                throw new ArgumentNullException("errLog");
            }

            EventAdapter eventAdapter = new EventAdapter();

            eventAdapter.Directory = directory;
            eventAdapter.TableName = tableName;
            DataTable dataTable = new DataTable();

            if (LoadDataTable(eventAdapter, errLog, ref dataTable))
            {
                FrmEventTableEdit frmEventTableEdit = new FrmEventTableEdit();
                frmEventTableEdit.errLog       = errLog;
                frmEventTableEdit.eventAdapter = eventAdapter;
                frmEventTableEdit.dataTable    = dataTable;
                frmEventTableEdit.editMode     = editMode;
                frmEventTableEdit.ShowDialog();
            }
        }
コード例 #2
0
ファイル: FrmEventTableEdit.cs プロジェクト: iyus/scada
        /// <summary>
        /// Отобразить форму редактирования или просмотра таблицы срезов
        /// </summary>
        public static void Show(string directory, string tableName, bool editMode, Log errLog)
        {
            if (string.IsNullOrEmpty(directory))
                throw new ArgumentException("directory");
            if (string.IsNullOrEmpty(tableName))
                throw new ArgumentException("tableName");
            if (errLog == null)
                throw new ArgumentNullException("errLog");

            EventAdapter eventAdapter = new EventAdapter();
            eventAdapter.Directory = directory;
            eventAdapter.TableName = tableName;
            DataTable dataTable = new DataTable();

            if (LoadDataTable(eventAdapter, errLog, ref dataTable))
            {
                FrmEventTableEdit frmEventTableEdit = new FrmEventTableEdit();
                frmEventTableEdit.errLog = errLog;
                frmEventTableEdit.eventAdapter = eventAdapter;
                frmEventTableEdit.dataTable = dataTable;
                frmEventTableEdit.editMode = editMode;
                frmEventTableEdit.ShowDialog();
            }
        }