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(); } }
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(); } }
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(); } }
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(); } }
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); }
private void Add_Click(object sender, EventArgs e) { DTP_AddEdit aedtp = new DTP_AddEdit(_car.createDTP()); aedtp.ShowDialog(); }