private void grdEstaciones_CellValueChanged(object sender, DataGridViewCellEventArgs e) { try { if (EsGridEstacionContruido) { if ((!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["IdEstacionGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["CodigoGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["NombreGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["NitGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["DireccionGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["TelefonoGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["IdCiudadGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[0].Cells["CodigoEstacionMenoCash"].Value.ToString()))) { oHelper.ActualizarEstacion(Int16.Parse(grdEstaciones.Rows[0].Cells["IdEstacionGrillaEstacion"].Value.ToString()), grdEstaciones.Rows[0].Cells["CodigoGrillaEstacion"].Value.ToString(), grdEstaciones.Rows[0].Cells["NombreGrillaEstacion"].Value.ToString(), grdEstaciones.Rows[0].Cells["NitGrillaEstacion"].Value.ToString(), grdEstaciones.Rows[0].Cells["DireccionGrillaEstacion"].Value.ToString(), grdEstaciones.Rows[0].Cells["TelefonoGrillaEstacion"].Value.ToString(), Int32.Parse(grdEstaciones.Rows[0].Cells["IdCiudadGrillaEstacion"].Value.ToString()), grdEstaciones.Rows[0].Cells["CodigoEstacionMenoCash"].Value.ToString()); RecuperarEstaciones(); } else if (((!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["CodigoGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["NombreGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["NitGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["DireccionGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["TelefonoGrillaEstacion"].Value.ToString())) && (!String.IsNullOrEmpty(grdEstaciones.Rows[e.RowIndex].Cells["IdCiudadGrillaEstacion"].Value.ToString()))) && (!String.IsNullOrEmpty(grdEstaciones.Rows[0].Cells["CodigoEstacionMenoCash"].Value.ToString()))) { oHelper.InsertarEstacion(grdEstaciones.Rows[0].Cells["CodigoGrillaEstacion"].Value.ToString(), grdEstaciones.Rows[0].Cells["NombreGrillaEstacion"].Value.ToString(), grdEstaciones.Rows[0].Cells["NitGrillaEstacion"].Value.ToString(), grdEstaciones.Rows[0].Cells["DireccionGrillaEstacion"].Value.ToString(), grdEstaciones.Rows[0].Cells["TelefonoGrillaEstacion"].Value.ToString(), Int32.Parse(grdEstaciones.Rows[0].Cells["IdCiudadGrillaEstacion"].Value.ToString()), grdEstaciones.Rows[0].Cells["CodigoEstacionMenoCash"].Value.ToString()); RecuperarEstaciones(); } //RecuperarDatosBasicos(oHelper); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }