Esempio n. 1
0
        public MainForm1(Context db)
        {
            InitializeComponent();

            _configurationService           = new ConfigurationService(db);
            _configurationColumnService     = new ConfigurationColumnService(db);
            _configurationRowService        = new ConfigurationRowService(db);
            _configurationValueService      = new ConfigurationValueService(db);
            _configurationColumnFillService = new ConfigurationColumnFillService(db);

            var configurationsDto = _configurationService.GetAllConfigurationsDto();

            foreach (var item in configurationsDto)
            {
                var tab = AddTab(item);
                tab.SuspendLayout();
                AddButtonSave(item, AddPanel(tab, item.Index, 1), tab);
                SetComponents(item, tab);
                tab.ResumeLayout();
                tab.AutoScroll = false;
                var form1 = new View.UC_TextBox
                {
                    AutoScroll = true,
                    Location   = new System.Drawing.Point(4, 385),
                    Name       = $"userControl_{item.Id}",
                    Size       = new System.Drawing.Size(500, 132),
                    TabIndex   = 1,
                    Visible    = true
                };
                tab.Controls.Add(form1);
            }
        }
Esempio n. 2
0
        public Form2(Context db)
        {
            InitializeComponent();

            _configurationService       = new ConfigurationService(db);
            _configurationColumnService = new ConfigurationColumnService(db);
            _configurationRowService    = new ConfigurationRowService(db);
            _configurationValueService  = new ConfigurationValueService(db);

            var configurationsDto = _configurationService.GetAllConfigurationsDto();
            var tabPage           = new TabPage();

            foreach (var item in configurationsDto)
            {
                var configurationDto = _configurationService.GetConfigurationByIdDto(item.Id);

                var rowsDto    = _configurationRowService.GetRowsByConfigurationDto(item.Id);
                var columnsDto = _configurationColumnService.GetColumnsByConfigurationDto(item.Id);

                tabPage = new TabPage
                {
                    Name = $"{configurationDto.Name}",
                    Text = $"{configurationDto.Title}"
                };

                tabPage.SuspendLayout();

                //foreach (var col in columnsDto)
                //{
                //    ComboBoxFormService.GetComponent(col, tabPage);
                //    RadioButonFormService.GetComponent(col, tabPage);
                //    CheckBoxFormService.GetComponent(col, tabPage);
                //}

                tabPage.ResumeLayout();
                tabControl1.Controls.Add(tabPage);
            }
        }