private void BTAgregarCamion_Click(object sender, EventArgs e) { AgModCamiones AgregarCamion = new AgModCamiones(); AgregarCamion.ShowDialog(); TraerLista(); }
private void BTModifChofer_Click(object sender, EventArgs e) { try { if (DGV_Camiones.SelectedRows.Count == 0) { throw new Exception("No se ha seleccionado ningún Camión"); } if (DGV_Camiones.SelectedRows.Count > 1) { throw new Exception("Se ha seleccionado mas de un Camión"); } string _Codigo = DGV_Camiones.SelectedRows[0].Cells[0].Value.ToString(); string Desc = DGV_Camiones.SelectedRows[0].Cells[1].Value.ToString(); string Patent = DGV_Camiones.SelectedRows[0].Cells[2].Value.ToString(); string NomProve = DGV_Camiones.SelectedRows[0].Cells[4].Value.ToString(); string NomChof = DGV_Camiones.SelectedRows[0].Cells[5].Value.ToString(); string _Estado = DGV_Camiones.SelectedRows[0].Cells[6].Value.ToString(); string CodEmp = DGV_Camiones.SelectedRows[0].Cells[7].Value.ToString(); string _Aplica = DGV_Camiones.SelectedRows[0].Cells[8].Value.ToString(); string CodChof = DGV_Camiones.SelectedRows[0].Cells[9].Value.ToString(); string CodProveedor = DGV_Camiones.SelectedRows[0].Cells[10].Value.ToString(); string FechaVenc1 = DGV_Camiones.SelectedRows[0].Cells[11].Value.ToString(); string Coment1 = DGV_Camiones.SelectedRows[0].Cells[12].Value.ToString(); string FechaVenc2 = DGV_Camiones.SelectedRows[0].Cells[13].Value.ToString(); string Coment2 = DGV_Camiones.SelectedRows[0].Cells[14].Value.ToString(); string FechaVenc3 = DGV_Camiones.SelectedRows[0].Cells[15].Value.ToString(); string Coment3 = DGV_Camiones.SelectedRows[0].Cells[16].Value.ToString(); string FechaVenc4 = DGV_Camiones.SelectedRows[0].Cells[17].Value.ToString(); string Coment4 = DGV_Camiones.SelectedRows[0].Cells[18].Value.ToString(); string FechaVenc5 = DGV_Camiones.SelectedRows[0].Cells[19].Value.ToString(); string Coment5 = DGV_Camiones.SelectedRows[0].Cells[20].Value.ToString(); string OrdFecVenc1 = DGV_Camiones.SelectedRows[0].Cells[21].Value.ToString(); string OrdFecVenc2 = DGV_Camiones.SelectedRows[0].Cells[22].Value.ToString(); string OrdFecVenc3 = DGV_Camiones.SelectedRows[0].Cells[23].Value.ToString(); string OrdFecVenc4 = DGV_Camiones.SelectedRows[0].Cells[24].Value.ToString(); string OrdFecVenc5 = DGV_Camiones.SelectedRows[0].Cells[25].Value.ToString(); string _FechaEnt1 = DGV_Camiones.SelectedRows[0].Cells[26].Value.ToString(); string _FechaEnt2 = DGV_Camiones.SelectedRows[0].Cells[27].Value.ToString(); string _FechaEnt3 = DGV_Camiones.SelectedRows[0].Cells[28].Value.ToString(); string _FechaEnt4 = DGV_Camiones.SelectedRows[0].Cells[29].Value.ToString(); string _FechaEnt5 = DGV_Camiones.SelectedRows[0].Cells[30].Value.ToString(); string OrdFecEnt1 = DGV_Camiones.SelectedRows[0].Cells[31].Value.ToString(); string OrdFecEnt2 = DGV_Camiones.SelectedRows[0].Cells[32].Value.ToString(); string OrdFecEnt3 = DGV_Camiones.SelectedRows[0].Cells[33].Value.ToString(); string OrdFecEnt4 = DGV_Camiones.SelectedRows[0].Cells[34].Value.ToString(); string OrdFecEnt5 = DGV_Camiones.SelectedRows[0].Cells[35].Value.ToString(); string _Titulo = DGV_Camiones.SelectedRows[0].Cells[36].Value.ToString(); AgModCamiones ModifCamion = new AgModCamiones(_Codigo, Desc, Patent, NomProve, NomChof, _Estado, CodEmp, _Aplica, CodChof, CodProveedor, FechaVenc1, FechaVenc2, FechaVenc3, FechaVenc4, FechaVenc5, OrdFecVenc1, OrdFecVenc2, OrdFecVenc3, OrdFecVenc4, OrdFecVenc5, _FechaEnt1, _FechaEnt2, _FechaEnt3, _FechaEnt4, _FechaEnt5, OrdFecEnt1, OrdFecEnt2, OrdFecEnt3, OrdFecEnt4, OrdFecEnt5, Coment1, Coment2, Coment3, Coment4, Coment5, _Titulo); ModifCamion.ShowDialog(); TraerLista(); P_Filtrado.Visible = false; } catch (Exception err) { MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }