Пример #1
0
        private void _dgvDTP_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (IsCellNoHeader(e.RowIndex))
            {
                int idDtp = Convert.ToInt32(_dgvDTP.Rows[e.RowIndex].Cells[0].Value);

                var dtp = _dtpList.getItem(idDtp);

                var aedtp = new DTP_AddEdit(dtp);
                aedtp.ShowDialog();
            }
        }
Пример #2
0
        private void _dgvDTP_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int idDTP = Convert.ToInt32(_dgvDTP.Rows[e.RowIndex].Cells[0].Value);

            DTP dtp = _dtpList.getItem(idDTP);

            DTP_AddEdit dtpAE = new DTP_AddEdit(dtp);

            if (dtpAE.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                loadDTP();
            }
        }
Пример #3
0
        private void btnAddDTP_Click(object sender, EventArgs e)
        {
            DTP dtp = _car.createDTP();

            DTP_AddEdit dtpAE = new DTP_AddEdit(dtp);

            if (dtpAE.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                _dtpList.Add(dtp);

                loadDTP();
            }
        }
Пример #4
0
        private void DoubleClickDTP(Point point)
        {
            if (_dgvMain.GetID() == 0)
            {
                return;
            }

            DTPList dtpList = DTPList.getInstance();
            DTP     dtp     = dtpList.getItem(_dgvMain.GetID());

            DTP_AddEdit dtpAE = new DTP_AddEdit(dtp);

            if (dtpAE.ShowDialog() == DialogResult.OK)
            {
                loadCars();
            }
        }
Пример #5
0
        private ToolStripMenuItem CreateNewDTP()
        {
            ToolStripMenuItem item = CreateItem("Новое ДТП");

            item.Click += delegate
            {
                Car car = _dgvMain.GetCar();
                if (car == null)
                {
                    return;
                }

                DTP dtp = car.createDTP();

                DTP_AddEdit dtpAE = new DTP_AddEdit(dtp);
                dtpAE.ShowDialog();
            };
            return(item);
        }
Пример #6
0
        private void Add_Click(object sender, EventArgs e)
        {
            DTP_AddEdit aedtp = new DTP_AddEdit(_car.createDTP());

            aedtp.ShowDialog();
        }