Пример #1
0
        private Mark GetMark()
        {
            int idMark;

            int.TryParse(_dgvSsDTP.Rows[_dgvSsDTP.SelectedCells[0].RowIndex].Cells[0].Value.ToString(), out idMark);
            return(MarkList.getInstance().getItem(idMark));
        }
Пример #2
0
        private void fillField(DataRow row)
        {
            int id;

            int.TryParse(row.ItemArray[0].ToString(), out id);
            ID = id;

            int.TryParse(row.ItemArray[1].ToString(), out _number);
            Grz        = row.ItemArray[2].ToString();
            vin        = row.ItemArray[3].ToString();
            Year       = row.ItemArray[4].ToString();
            eNumber    = row.ItemArray[5].ToString();
            bodyNumber = row.ItemArray[6].ToString();

            int idMark;

            int.TryParse(row.ItemArray[7].ToString(), out idMark);
            Mark = MarkList.getInstance().getItem(idMark);

            int.TryParse(row.ItemArray[8].ToString(), out _idModel);
            GradeID = row.ItemArray[9].ToString();
            ColorID = row.ItemArray[10];

            fillCarBuy(row);
        }
Пример #3
0
        private bool CopyFields()
        {
            if (cbGrade.SelectedValue == null)
            {
                MessageBox.Show("Для сохранения необходимо выбрать комплектацию", "Недостаточно данных", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return(false);
            }

            int idMark;

            int.TryParse(cbMark.SelectedValue.ToString(), out idMark);
            _car.Mark       = MarkList.getInstance().getItem(idMark);
            _car.ModelID    = cbModel.SelectedValue.ToString();
            _car.GradeID    = cbGrade.SelectedValue.ToString();
            _car.ColorID    = cbColor.SelectedValue;
            _car.vin        = tbVin.Text;
            _car.Grz        = mtbGRZ.Text;
            _car.eNumber    = tbENumber.Text.ToUpper();
            _car.bodyNumber = tbBodyNumber.Text.ToUpper();
            _car.Year       = tbYear.Text;

            _car.ownerID       = cbOwner.SelectedValue;
            _car.RegionBuyID   = cbRegionBuy.SelectedValue;
            _car.regionUsingID = cbRegionUsing.SelectedValue;
            _car.driverID      = cbDriver.SelectedValue;
            _car.dateOrder     = dtpDateOrder.Value;
            _car.IsGet         = chbIsGet.Checked;
            _car.dateGet       = dtpDateGet.Value;
            _car.cost          = Convert.ToDouble(tbCost.Text);
            _car.dop           = tbDOP.Text;
            _car.events        = tbEvents.Text;
            _car.idDiller      = Convert.ToInt32(cbDealer.SelectedValue);

            _pts.Number  = mtbNumberPTS.Text;
            _pts.Date    = Convert.ToDateTime(dtpDatePTS.Text);
            _pts.GiveOrg = tbGiveOrgPTS.Text;

            TextBox tbFilePTS = ucFilePTS.Controls["tbFile"] as TextBox;

            _pts.File = tbFilePTS.Text;
            _pts.Save();

            _sts.Number  = mtbNumberSTS.Text;
            _sts.Date    = Convert.ToDateTime(dtpDateSTS.Text);
            _sts.GiveOrg = tbGiveOrgSTS.Text;

            TextBox tbFileSTS = ucFileSTS.Controls["tbFile"] as TextBox;

            _sts.File = tbFileSTS.Text;
            _sts.Save();

            _car.Lising = (chbLising.Checked) ? mtbLising.Text : string.Empty;

            _car.InvertoryNumber = tbInvertoryNumber.Text;

            return(true);
        }
Пример #4
0
        public SsDTP(DataRow row)
        {
            int idMark;

            int.TryParse(row.ItemArray[0].ToString(), out idMark);
            Mark = MarkList.getInstance().getItem(idMark);

            int.TryParse(row.ItemArray[1].ToString(), out idServiceStantion);
        }
Пример #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (_workWithForm.IsEditMode())
            {
                MarkList markList = MarkList.getInstance();
                int      idMark;
                int.TryParse(cbMark.SelectedValue.ToString(), out idMark);
                _ssDTP.Mark = markList.getItem(idMark);

                _ssDTP.IDServiceStantion = cbServiceStantion.SelectedValue.ToString();

                _ssDTP.Save();

                DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                _workWithForm.SetEditMode(true);
            }
        }