示例#1
0
        protected virtual void InitializeComponents()
        {
            this.m_panelManagement = new Panel();
            this.m_panelRDGValues  = new Panel();

            this.btnSet     = new System.Windows.Forms.Button();
            this.btnRefresh = new System.Windows.Forms.Button();

            //this.dgwAdminTable = new DataGridViewAdmin();
            this.mcldrDate            = new System.Windows.Forms.MonthCalendar();
            this.comboBoxTecComponent = new System.Windows.Forms.ComboBox();
            this.gbxDividerChoice     = new GroupBoxDividerChoice();

            initializeLayoutStyle(2, 1);

            this.SuspendLayout();

            //((System.ComponentModel.ISupportInitialize)(this.dgwAdminTable)).BeginInit();

            //
            //m_panelManagement
            //
            this.m_panelManagement.Dock = DockStyle.Fill;

            //
            //m_panelRDGValues
            //
            this.m_panelRDGValues.Dock = DockStyle.Fill;

            this.Controls.Add(m_panelManagement, 0, 0);
            this.Controls.Add(m_panelRDGValues, 1, 0);

            this.m_panelManagement.Controls.Add(this.mcldrDate);
            this.m_panelManagement.Controls.Add(this.comboBoxTecComponent);
            this.m_panelManagement.Controls.Add(this.gbxDividerChoice);

            this.m_panelManagement.Controls.Add(this.btnSet);
            this.m_panelManagement.Controls.Add(this.btnRefresh);

            //this.Controls.Add(this.dgwAdminTable);

            this.Dock = System.Windows.Forms.DockStyle.Fill;
            //this.Location = new System.Drawing.Point(8, 8);
            this.Name = "pnlAdmin";
            //this.Size = new System.Drawing.Size(760, 610);
            this.TabIndex = 1;
            //
            // mcldrDate
            //
            this.mcldrDate.Location          = new System.Drawing.Point(10, 38);
            this.mcldrDate.Name              = "mcldrDate";
            this.mcldrDate.TabIndex          = 0;
            this.mcldrDate.DateSelected     += new System.Windows.Forms.DateRangeEventHandler(this.mcldrDate_DateSelected);
            this.mcldrDate.Font              = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            this.mcldrDate.MaxSelectionCount = 1;
            this.mcldrDate.ShowToday         = false;
            this.mcldrDate.ShowTodayCircle   = false;

            int posY = 207;

            //
            // btnSet
            //
            this.btnSet.Location = new System.Drawing.Point(10, posY);
            this.btnSet.Name     = "btnSet";
            this.btnSet.Size     = new System.Drawing.Size(154, m_iSizeY);
            this.btnSet.TabIndex = 2;
            this.btnSet.Text     = "Сохранить в базу";
            this.btnSet.UseVisualStyleBackColor = true;
            this.btnSet.Click += new System.EventHandler(this.btnSet_Click);
            //
            // btnRefresh
            //
            this.btnRefresh.Location = new System.Drawing.Point(10, posY + 1 * (m_iSizeY + m_iMarginY));
            this.btnRefresh.Name     = "btnRefresh";
            this.btnRefresh.Size     = new System.Drawing.Size(154, m_iSizeY);
            this.btnRefresh.TabIndex = 2;
            this.btnRefresh.Text     = "Обновить из базы";
            this.btnRefresh.UseVisualStyleBackColor = true;
            this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
            //
            // gbxDividerChoice
            //
            this.gbxDividerChoice.Initialize(posY);
            //
            // btnLoadLayout
            //
            //this.btnLoadLayout.Location = new System.Drawing.Point(10, 282);
            //this.btnLoadLayout.Name = "btnLoad";
            //this.btnLoadLayout.Size = new System.Drawing.Size(154, 23);
            //this.btnLoadLayout.TabIndex = 2;
            //this.btnLoadLayout.Text = "Загрузить макет";
            //this.btnLoadLayout.UseVisualStyleBackColor = true;
            //this.btnLoadLayout.Click += new System.EventHandler(this.btnLoadLayout_Click);
            //
            // comboBoxTecComponent
            //
            this.comboBoxTecComponent.FormattingEnabled = true;
            this.comboBoxTecComponent.Location          = new System.Drawing.Point(10, 10);
            this.comboBoxTecComponent.Name     = "comboBoxTecComponent";
            this.comboBoxTecComponent.Size     = new System.Drawing.Size(154, 21);
            this.comboBoxTecComponent.TabIndex = 3;
            this.comboBoxTecComponent.SelectionChangeCommitted += new System.EventHandler(this.comboBoxTecComponent_SelectionChangeCommitted);
            this.comboBoxTecComponent.DropDownStyle             = ComboBoxStyle.DropDownList;
            //((System.ComponentModel.ISupportInitialize)(this.dgwAdminTable)).EndInit();
            this.ResumeLayout();
        }
示例#2
0
        protected override void InitializeComponents()
        {
            base.InitializeComponents();

            int posY     = 271
            , offsetPosY = m_iSizeY + 2 * m_iMarginY
            , iMarginX   = m_iMarginY
            , width      = 154
            , width2     = 154 / 2 - iMarginX
            , indx       = -1;

            Rectangle[] arRectControlUI = new Rectangle[] {
                new Rectangle(new Point(10, posY), new Size(154, m_iSizeY))                                                                     //BUTTON_CSV_IMPORT_PBR
                , new Rectangle(new Point(10, posY + 1 * (m_iSizeY + m_iMarginY)), new Size(154, m_iSizeY))                                     //, BUTTON_CSV_IMPORT_ADMINVALUESDEFAULT
                // ------ разделитель ------
                , new Rectangle(new Point(10, posY + (int)(2.7 * (m_iSizeY + m_iMarginY))), new Size(width, m_iSizeY))                          //, BUTTON_EXPORT_PBR
                , new Rectangle(new Point(10, posY + (int)(3.7 * (m_iSizeY + m_iMarginY))), new Size(width, m_iSizeY))                          //, CB_AUTO_EXPORT_PBR
                , new Rectangle(new Point(10, posY + (int)(4.6 * (m_iSizeY + m_iMarginY))), new Size(width2, m_iSizeY))                         //, LABEL_SHEDULE_EXPORT_PBR
                , new Rectangle(new Point(10 + width2 + 2 * iMarginX, posY + (int)(4.6 * (m_iSizeY + m_iMarginY))), new Size(width2, m_iSizeY)) //, LABEL_PERIOD_EXPORT_PBR
                , new Rectangle(new Point(10, posY + (int)(5.5 * (m_iSizeY + m_iMarginY))), new Size(width2, m_iSizeY))                         //, DTP_SHEDULE_EXPORT_PBR
                , new Rectangle(new Point(10 + width2 + 2 * iMarginX, posY + (int)(5.5 * (m_iSizeY + m_iMarginY))), new Size(width2, m_iSizeY)) //, DTP_PERIOD_EXPORT_PBR
            };

            this.btnImportCSV_PBRValues           = new Button();
            this.btnImportCSV_AdminDefaultValues  = new Button();
            this.btnExport_PBRValues              = new Button();
            this.cbAutoExport_PBRValues           = new CheckBox();
            this.labelSheduleExport_PBRValues     = new Label();
            this.dtpSheduleStartExport_PBRValues  = new DateTimePicker();
            this.dtpShedulePeriodExport_PBRValues = new DateTimePicker();
            this.labelPeriodExport_PBRValues      = new Label();
            this.gbxDividerChoice = new GroupBoxDividerChoice();
            this.dgwAdminTable    = new DataGridViewAdminKomDisp();

            this.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dgwAdminTable)).BeginInit();

            this.m_panelManagement.Controls.Add(this.btnImportCSV_PBRValues);
            this.m_panelManagement.Controls.Add(this.btnImportCSV_AdminDefaultValues);
            this.m_panelManagement.Controls.Add(this.gbxDividerChoice);
            this.m_panelManagement.Controls.Add(this.btnExport_PBRValues);
            this.m_panelManagement.Controls.Add(this.cbAutoExport_PBRValues);
            this.m_panelManagement.Controls.Add(this.labelSheduleExport_PBRValues);
            this.m_panelManagement.Controls.Add(this.labelPeriodExport_PBRValues);
            this.m_panelManagement.Controls.Add(this.dtpSheduleStartExport_PBRValues);
            this.m_panelManagement.Controls.Add(this.dtpShedulePeriodExport_PBRValues);
            this.m_panelRDGValues.Controls.Add(this.dgwAdminTable);

            //
            // btnImportCSV_PBRValues
            //
            indx = (int)INDEX_CONTROL_UI.BUTTON_CSV_IMPORT_PBR;
            this.btnImportCSV_PBRValues.Location = arRectControlUI [indx].Location;
            this.btnImportCSV_PBRValues.Name     = "btnImportCSV_PBRValues";
            this.btnImportCSV_PBRValues.Size     = arRectControlUI[indx].Size;
            this.btnImportCSV_PBRValues.TabIndex = 2;
            this.btnImportCSV_PBRValues.Text     = "Импорт из формата CSV";
            this.btnImportCSV_PBRValues.UseVisualStyleBackColor = true;
            this.btnImportCSV_PBRValues.Click  += new System.EventHandler(this.btnImportCSV_PBRValues_Click);
            this.btnImportCSV_PBRValues.Enabled = true;
            //
            // btnImportCSV_AdminDefaultValues
            //
            indx = (int)INDEX_CONTROL_UI.BUTTON_CSV_IMPORT_ADMINVALUESDEFAULT;
            this.btnImportCSV_AdminDefaultValues.Location = arRectControlUI[indx].Location;
            this.btnImportCSV_AdminDefaultValues.Name     = "btnImportCSV_AdminDefaultValues";
            this.btnImportCSV_AdminDefaultValues.Size     = arRectControlUI[indx].Size;
            this.btnImportCSV_AdminDefaultValues.TabIndex = 2;
            this.btnImportCSV_AdminDefaultValues.Text     = "Реком. по умолчанию";
            this.btnImportCSV_AdminDefaultValues.UseVisualStyleBackColor = true;
            this.btnImportCSV_AdminDefaultValues.Click += new System.EventHandler(this.btnImportCSV_AdminValuesDefault_Click);
            //this.ckbImportCSV_AdminDefaultValues.CheckedChanged += new EventHandler(ckbImportCSV_AdminDefaultValues_CheckedChanged);
            this.btnImportCSV_AdminDefaultValues.Enabled = true;
            //
            // gbxDividerChoice
            //
            gbxDividerChoice.Initialize(posY + 0 * (m_iSizeY + m_iMarginY));
            //
            // btnExport_PBRValues
            //
            indx = (int)INDEX_CONTROL_UI.BUTTON_EXPORT_PBR;
            this.btnExport_PBRValues.Location = arRectControlUI[indx].Location;
            this.btnExport_PBRValues.Name     = "btnExport_PBRValues";
            this.btnExport_PBRValues.Size     = arRectControlUI[indx].Size;
            this.btnExport_PBRValues.TabIndex = 2;
            this.btnExport_PBRValues.Text     = "Экспорт тек.ПБР";
            this.btnExport_PBRValues.UseVisualStyleBackColor = true;
            this.btnExport_PBRValues.Click  += new System.EventHandler(this.btnExport_PBRValues_Click);
            this.btnExport_PBRValues.Enabled = EnabledExportPBRValues;
            //
            // cbAutoExport_PBRValues
            //
            indx = (int)INDEX_CONTROL_UI.CB_AUTO_EXPORT_PBR;
            this.cbAutoExport_PBRValues.Location        = arRectControlUI[indx].Location;
            this.cbAutoExport_PBRValues.Name            = "cbAutoExport_PBRValues";
            this.cbAutoExport_PBRValues.Size            = arRectControlUI[indx].Size;
            this.cbAutoExport_PBRValues.TabIndex        = 2;
            this.cbAutoExport_PBRValues.Text            = "Автоматически";
            this.cbAutoExport_PBRValues.CheckedChanged += cbAutoExport_PBRValues_CheckedChanged;
            this.cbAutoExport_PBRValues.Enabled         = AllowUserSetModeExportPBRValues;
            //
            // labelSheduleExport_PBRValues
            //
            indx = (int)INDEX_CONTROL_UI.LABEL_SHEDULE_EXPORT_PBR;
            this.labelSheduleExport_PBRValues.Location = arRectControlUI[indx].Location;
            this.labelSheduleExport_PBRValues.Name     = "labelSheduleExport_PBRValues";
            this.labelSheduleExport_PBRValues.Size     = arRectControlUI[indx].Size;
            this.labelSheduleExport_PBRValues.TabIndex = 2;
            this.labelSheduleExport_PBRValues.Text     = "Начинать с:";
            //
            // labelPeriodExport_PBRValues
            //
            indx = (int)INDEX_CONTROL_UI.LABEL_PERIOD_EXPORT_PBR;
            this.labelPeriodExport_PBRValues.Location = arRectControlUI[indx].Location;
            this.labelPeriodExport_PBRValues.Name     = "labelPeriodExport_PBRValues";
            this.labelPeriodExport_PBRValues.Size     = arRectControlUI[indx].Size;
            this.labelPeriodExport_PBRValues.TabIndex = 2;
            this.labelPeriodExport_PBRValues.Text     = "Каждые:";
            //
            // dtpSheduleStartExport_PBRValues
            //
            indx = (int)INDEX_CONTROL_UI.DTP_SHEDULE_EXPORT_PBR;
            this.dtpSheduleStartExport_PBRValues.Location      = arRectControlUI[indx].Location;
            this.dtpSheduleStartExport_PBRValues.Name          = "dtpSheduleStartExport_PBRValues";
            this.dtpSheduleStartExport_PBRValues.Size          = arRectControlUI[indx].Size;
            this.dtpSheduleStartExport_PBRValues.TabIndex      = 2;
            this.dtpSheduleStartExport_PBRValues.Format        = DateTimePickerFormat.Custom;
            this.dtpSheduleStartExport_PBRValues.CustomFormat  = "00:mm:ss";
            this.dtpSheduleStartExport_PBRValues.ShowUpDown    = true;
            this.dtpSheduleStartExport_PBRValues.Value         = new DateTime(1970, 1, 1).AddSeconds(AdminTS_KomDisp.SEC_SHEDULE_START_EXPORT_PBR % 3600);
            this.dtpSheduleStartExport_PBRValues.ValueChanged += dtpSheduleStartExport_PBRValues_ValueChanged;
            this.dtpSheduleStartExport_PBRValues.Enabled       = AllowUserChangeSheduleStartExportPBRValues;
            //
            // dtpShedulePeriodExport_PBRValues
            //
            indx = (int)INDEX_CONTROL_UI.DTP_PERIOD_EXPORT_PBR;
            this.dtpShedulePeriodExport_PBRValues.Location      = arRectControlUI[indx].Location;
            this.dtpShedulePeriodExport_PBRValues.Name          = "dtpShedulePeriodExport_PBRValues";
            this.dtpShedulePeriodExport_PBRValues.Size          = arRectControlUI[indx].Size;
            this.dtpShedulePeriodExport_PBRValues.TabIndex      = 2;
            this.dtpShedulePeriodExport_PBRValues.Format        = DateTimePickerFormat.Custom;
            this.dtpShedulePeriodExport_PBRValues.CustomFormat  = "HH:mm:ss";
            this.dtpShedulePeriodExport_PBRValues.ShowUpDown    = true;
            this.dtpShedulePeriodExport_PBRValues.Value         = new DateTime(1970, 1, 1).AddSeconds(AdminTS_KomDisp.SEC_SHEDULE_PERIOD_EXPORT_PBR);
            this.dtpShedulePeriodExport_PBRValues.ValueChanged += dtpShedulePeriodExport_PBRValues_ValueChanged;;
            this.dtpShedulePeriodExport_PBRValues.Enabled       = AllowUserChangeShedulePeriodExportPBRValues;
            //
            // dgwAdminTable
            //
            this.dgwAdminTable.Location = new System.Drawing.Point(9, 9);
            this.dgwAdminTable.Size     = new System.Drawing.Size(714, 591);
            this.dgwAdminTable.TabIndex = 1;
            //this.dgwAdminTable.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgwAdminTable_CellClick);
            //this.dgwAdminTable.CellValidated += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgwAdminTable_CellValidated);
            ((System.ComponentModel.ISupportInitialize)(this.dgwAdminTable)).EndInit();

            this.ResumeLayout();

            cbAutoExport_PBRValues.Checked = EnabledExportPBRValues
                                             & (HStatisticUsers.IsAllowed((int)HStatisticUsers.ID_ALLOWED.AUTO_EXPORT_PBRVALUES_KOMDISP));
        }