Example #1
0
        //загрузка связанных источников для списка выключателей
        void CbrDataSourceLoad()
        {
            //для карточки проекта
            txtProjectNumber.Text = ProjectServices.GetProjectNumber(_project);

            //общее
            bs_EquipNote.DataSource = EquipServices.GetAllProjectNote();

            ////аналоги
            bs_CbrAn.DataSource       = EquipServices.GetProjectCbr(_project, true);
            bs_AnalogEquip.DataSource = EquipServices.GetAllEquipCbr(_project, true);

            bs_cbrCCbrAn.DataSource  = EquipServices.GetAllCbCur();
            bs_disCCbrAn.DataSource  = EquipServices.GetAllDisCur();
            bs_disMCbrAn.DataSource  = EquipServices.GetAllDisModel();
            bs_icuLCbrAn.DataSource  = EquipServices.GetAllIcuLiteral();
            bs_seriaCbrAn.DataSource = EquipServices.GetAllSeria();

            //основное
            bs_CbrPrj.DataSource   = EquipServices.GetProjectCbr(_project, false);
            bs_CbrEquip.DataSource = EquipServices.GetAllEquipCbr(_project, false);

            bs_cbrCCbrPrj.DataSource  = EquipServices.GetAllCbCur();
            bs_disCCbrPrj.DataSource  = EquipServices.GetAllDisCur();
            bs_disMCbrPrj.DataSource  = EquipServices.GetAllDisModel();
            bs_icuLCbrPrj.DataSource  = EquipServices.GetAllIcuLiteral();
            bs_seriaCbrPrj.DataSource = EquipServices.GetAllSeria();

            //для истории проекта
            bs_ProjectLog.DataSource    = ProjectServices.GetProjectHistory(_project);
            bs_ProjectNumber.DataSource = ProjectServices.GetAllProjectNum();
            bs_ProjectStage.DataSource  = ProjectServices.GetAllProjectStage();
            bs_ProjectState.DataSource  = ProjectServices.GetAllProjectState();
            bs_User.DataSource          = AuthServices.GetAllUser();
        }
Example #2
0
        //тип расцепителя
        private void pbxClearDisType_Click(object sender, EventArgs e)
        {
            dgvcCmbDisTyp.DefaultCellStyle.BackColor = System.Drawing.Color.White;
            if (disCurrent == null)
            {
                bs_disTCbr.DataSource = EquipServices.GetAllDisType();
            }

            disType = null;
            cboCbrDisType.ResetText();

            if (disModel == null)
            {
                if (manufacturer == null)
                {
                    bs_disMCbr.DataSource = EquipServices.GetAllDisModel();
                    cboCbrDisModel.ResetText();
                }
                else
                {
                    bs_disMCbr.DataSource = EquipServices.GetAllDisModel(manufacturer.Id);
                    cboCbrDisModel.ResetText();
                }
            }
            SearchCbr(null);
        }
Example #3
0
        //тип расцепителя
        private void cboCbrDisType_SelectionChangeCommitted(object sender, EventArgs e)
        {
            disType = cboCbrDisType.SelectedItem as DisType;

            if (disType != null)
            {
                SearchCbr(dgvcCmbDisTyp);
            }
            if (manufacturer != null)
            {
                bs_disMCbr.DataSource = EquipServices.GetAllDisModel(manufacturer.Id, disType.Id);
                cboCbrDisModel.ResetText();
            }
        }
Example #4
0
        //загрузка формы
        private void frmConfigurator_Load(object sender, EventArgs e)
        {
            using (frmInputBox frm = new frmInputBox(1 /*введите номер проекта*/))
            {
                if (frm.ShowDialog() == DialogResult.Yes)
                {
                    Project pr = ProjectServices.GetByNumber(frm.GetTxtValue);

                    if (pr != null)
                    {
                        _project = pr;
                    }
                }
            }

            rbtnGeneral.Checked = true;
            _blockNameMask      = txtResult.Text;

            bs_ProjectCbr.DataSource = ConfigServices.GetProjectCbr(_project, false);

            bs_cbrCCbrPrj.DataSource  = EquipServices.GetAllCbCur();
            bs_disCCbrPrj.DataSource  = EquipServices.GetAllDisCur();
            bs_disMCbrPrj.DataSource  = EquipServices.GetAllDisModel();
            bs_icuLCbrPrj.DataSource  = EquipServices.GetAllIcuLiteral();
            bs_seriaCbrPrj.DataSource = EquipServices.GetAllSeria();

            bs_Schema.DataSource     = ConfigServices.GetAllSchema();
            bs_BaseHeight.DataSource = ConfigServices.GetBaseSizes("H");
            bs_BaseWidth.DataSource  = ConfigServices.GetBaseSizes("B");

            foreach (Control ctr in this.Controls)
            {
                if (ctr.GetType() == typeof(ComboBox))
                {
                    ctr.ResetText();
                }
            }

            if (_project.IdNumber != 0)
            {
                tsProjectNumber.Text = ProjectServices.GetProjectNumber(_project);
            }
            else
            {
                tsProjectNumber.Text = "тестовый проект";
            }
        }
Example #5
0
        //загрузка источников для Current Breaker
        private void CbrDataSourceLoad()
        {
            //источники для таблицы поиска
            bs_manfCbr.DataSource  = EquipServices.GetAllManuf();
            bs_disCCbr.DataSource  = EquipServices.GetAllDisCur();
            bs_cbrCCbr.DataSource  = EquipServices.GetAllCbCur();
            bs_icuVCbr.DataSource  = EquipServices.GetAllIcu();
            bs_icuLCbr.DataSource  = EquipServices.GetAllIcuLiteral();
            bs_disTCbr.DataSource  = EquipServices.GetAllDisType();
            bs_disMCbr.DataSource  = EquipServices.GetAllDisModel();
            bs_seriaCbr.DataSource = EquipServices.GetAllSeria();
            bs_poleCbr.DataSource  = EquipServices.GetAllPoleNumber();
            bs_voltCbr.DataSource  = EquipServices.GetAllVoltage();

            //источники для таблицы выбранных
            bs_manfCbrPrj.DataSource  = EquipServices.GetAllManuf();
            bs_disCCbrPrj.DataSource  = EquipServices.GetAllDisCur();
            bs_cbrCCbrPrj.DataSource  = EquipServices.GetAllCbCur();
            bs_icuVCbrPrj.DataSource  = EquipServices.GetAllIcu();
            bs_icuLCbrPrj.DataSource  = EquipServices.GetAllIcuLiteral();
            bs_disTCbrPrj.DataSource  = EquipServices.GetAllDisType();
            bs_disMCbrPrj.DataSource  = EquipServices.GetAllDisModel();
            bs_seriaCbrPrj.DataSource = EquipServices.GetAllSeria();
            bs_poleCbrPrj.DataSource  = EquipServices.GetAllPoleNumber();
            bs_voltCbrPrj.DataSource  = EquipServices.GetAllVoltage();

            //источники для аналогов
            bs_manfCbrAn.DataSource  = EquipServices.GetAllManuf();
            bs_disCCbrAn.DataSource  = EquipServices.GetAllDisCur();
            bs_cbrCCbrAn.DataSource  = EquipServices.GetAllCbCur();
            bs_icuVCbrAn.DataSource  = EquipServices.GetAllIcu();
            bs_icuLCbrAn.DataSource  = EquipServices.GetAllIcuLiteral();
            bs_disTCbrAn.DataSource  = EquipServices.GetAllDisType();
            bs_disMCbrAn.DataSource  = EquipServices.GetAllDisModel();
            bs_seriaCbrAn.DataSource = EquipServices.GetAllSeria();
            bs_poleCbrAn.DataSource  = EquipServices.GetAllPoleNumber();
            bs_voltCbrAn.DataSource  = EquipServices.GetAllVoltage();

            //номер проекта
            bs_ProjectNum.DataSource = ProjectServices.GetAllProjectNum();

            //обозначения выключателей
            bs_EquipNote.DataSource = EquipServices.GetAllProjectNote();

            ComboResetText(gbxFilterCbr);
        }
Example #6
0
        //производитель
        private void pbxClearManuf_Click(object sender, EventArgs e)
        {
            dgvcCmbManf.DefaultCellStyle.BackColor = Color.White;
            bs_manfCbr.DataSource = EquipServices.GetAllManuf();

            manufacturer          = null;
            disModel              = null;
            bs_disMCbr.DataSource = EquipServices.GetAllDisModel();
            cboCbrDisModel.ResetText();
            cboCbrDisModel.Enabled = false;
            cboCbrManufact.ResetText();

            if (disCurrent == null)
            {
                bs_disCCbr.DataSource = EquipServices.GetAllDisCur();
                cboCbrDisCur.ResetText();
            }
            SearchCbr(null);
        }
Example #7
0
        //производитель
        private void cboCbrManufact_SelectionChangeCommitted(object sender, EventArgs e)
        {
            manufacturer = cboCbrManufact.SelectedItem as Manufacturer;

            if (manufacturer != null)
            {
                SearchCbr(dgvcCmbManf);
                bs_disCCbr.DataSource = EquipServices.GetAllDisCur(manufacturer.Id);
                cboCbrDisCur.ResetText();
                cboCbrDisModel.Enabled = true;

                if (disType != null)
                {
                    bs_disMCbr.DataSource = EquipServices.GetAllDisModel(manufacturer.Id, disType.Id);
                    cboCbrDisModel.ResetText();
                }
                else
                {
                    bs_disMCbr.DataSource = EquipServices.GetAllDisModel(manufacturer.Id);
                    cboCbrDisModel.ResetText();
                }
            }
        }