Esempio n. 1
0
 private void cb_kod_sub_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cb_kod_sub.Text != string.Empty)
     {
         l_sub.Text = SpravochnikUtil.GetSubWithKode(cb_kod_sub.Text);
     }
 }
Esempio n. 2
0
        private void FillAndPopulateTc()
        {
            float inaccuracyScales   = Settings.Default.InaccuracyScales;
            float inaccuracyRoulette = Settings.Default.InaccuracyRoulette;

            _currentAuto.Foto                 = videoPictuce1.GetImage();
            _currentAuto.MestoKontrolya       = Program.ControlPlace;
            _currentAuto.Ppvk                 = Program.PpvkName;
            _currentAuto.CarId                = SpravochnikUtil.IdentificationNumber;
            _currentAuto.SpecIndex            = Settings.Default.YearIndex;
            _currentAuto.InaccuracyRoulette   = inaccuracyRoulette;
            _currentAuto.Scales.Number        = Program.ScaleNumber;
            _currentAuto.Scales.CheckDateFrom = SpravochnikUtil.GetVesiDate(Program.ScaleNumber, "DateOT");
            _currentAuto.Scales.CheckDateTo   = SpravochnikUtil.GetVesiDate(Program.ScaleNumber, "DateDO");
            _currentAuto.Scales.Inaccuracy    = inaccuracyScales;
            _currentAuto.Road.RoadType        = Program.CurrentRoadType;
            _currentAuto.Road.IsFederalRoad   = Program.IsFederalRoad;
            _currentAuto.AutoType             = (AutoType)cb_vid_TC.SelectedIndex + 1;
            _currentAuto.Road.Distance        = float.Parse(tb_Rastoyan.Text);

            _currentAuto.AxisList.Clear();
            foreach (WheelControl wheel in WheelList.GetRange(0, GetWheelCount()))
            {
                AxisType axisType = ConvertToAxisType(wheel.WheelState);
                _currentAuto.AddNewAxis(axisType: axisType,
                                        distanceToNext: wheel.DistanceToNext,
                                        weightValue: wheel.ScalesValue);
            }

            Calculator.Populate(_currentAuto);
        }
Esempio n. 3
0
        public InitForm()
        {
            InitializeComponent();
            Text += $" {Assembly.GetExecutingAssembly().GetName().Version}";
            cb_imya_ppvk.Items.AddRange(SpravochnikUtil.GetItemCollections("sp_ppvk", "name_ppvk"));
            cb_vesi_zavod_nomer.Items.AddRange(SpravochnikUtil.GetItemCollections("sp_Vesi", "Zavod_nomer"));
            cb_mesto_prov.Items.AddRange(SpravochnikUtil.GetItemCollections("sp_Dis_Point", "Disl_point"));
            cb_Vid_Dor.Items.AddRange(SpravochnikUtil.GetItemCollections("TypesRoad", "Description", false));

            cb_imya_ppvk.Text        = SpravochnikUtil.GetDefaultValue("sp_ppvk", "name_ppvk");
            cb_vesi_zavod_nomer.Text = SpravochnikUtil.GetDefaultValue("sp_Vesi", "Zavod_nomer");
            cb_mesto_prov.Text       = SpravochnikUtil.GetDefaultValue("sp_Dis_Point", "Disl_point");
            cb_Vid_Dor.SelectedIndex = 0;
            cb_Clothes.SelectedIndex = 0;
            cb_Level.SelectedIndex   = 1;
        }
Esempio n. 4
0
        public void LoadActFromAuto(Auto auto)
        {
            _auto            = auto;
            l_nomer_act.Text = _auto.Id.ToString();
            if (_auto.Id == -1)
            {
                l_nomer_act.Text = "Новый";
            }
            SetCanEditAct(_auto.IsCanEdit);

            pb_foto.Image       = _auto.Foto;
            l_data.Text         = DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss");
            l_vid_1.Text        = SpravochnikUtil.GetAutoName(_auto.AutoType);
            l_km.Text           = _auto.Road.Distance.ToString();
            l_razm_usherba.Text = _auto.FullAutoDamage.ToString();
        }
Esempio n. 5
0
        }         // отключаем город и код субьекта при выборе другой страны

        private void FormAct_Load(object sender, EventArgs e)
        {
            if (_auto.IsCanEdit)
            {
                cb_inspekt.Items.AddRange(SpravochnikUtil.GetItemCollections("sp_Inspectors", "FIO"));
                cb_operat.Items.AddRange(SpravochnikUtil.GetItemCollections("sp_Operators", "FIO"));
                cb_kod_sub.Items.AddRange(SpravochnikUtil.GetItemCollections("sp_Kod_sub", "Kod"));
                cb_driver.Items.AddRange(SpravochnikUtil.GetItemCollections("sp_Driver", "name_Driver"));
                cb_vid_gruza.Items.AddRange(SpravochnikUtil.GetItemCollections("sp_Gruz", "name_gruz"));
                object[] col = SpravochnikUtil.GetItemCollections("sp_Mark", "name_Mark");
                cb_mark_1.Items.AddRange(col);
                cb_mark_2.Items.AddRange(col);
                cb_mark_3.Items.AddRange(col);

                cb_inspekt.Text = SpravochnikUtil.GetDefaultValue("sp_Inspectors", "FIO");
                cb_operat.Text  = SpravochnikUtil.GetDefaultValue("sp_Operators", "FIO");
                cb_kod_sub.Text = SpravochnikUtil.GetDefaultValue("sp_Kod_sub", "Kod");

                if (cb_strana.Text == string.Empty)
                {
                    cb_strana.Text = "Российская федерация";
                }
            }
        }
Esempio n. 6
0
 public void FillComboBox()
 {
     cb_vid_TC.Items.AddRange(SpravochnikUtil.GetItemCollections("TypesAuto", "NameAuto", false));
     cb_vid_TC.SelectedIndex = 0;
 }
Esempio n. 7
0
 private void cb_vesi_zavod_nomer_SelectedValueChanged(object sender, EventArgs e)
 {
     l_VesiAbout.Text = SpravochnikUtil.ToStringVesiDate(cb_vesi_zavod_nomer.SelectedItem.ToString());
 }