private void Btn_eliminar_Click(object sender, EventArgs e) { if (dgw_asignadas.CurrentRow != null) { if (MessageBox.Show("Esta seguro que desea eliminar el registro?", "Confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { FechaXTorneo fechaXTorneo = new FechaXTorneo(); fechaXTorneo.Fecha = new Fecha(); fechaXTorneo.Torneo = new Torneo(); fechaXTorneo.Fecha.IdFecha = Int32.Parse(dgw_asignadas.CurrentRow.Cells["id_fecha_col"].Value.ToString()); fechaXTorneo.Torneo.IdTorneo = Int32.Parse(dgw_asignadas.CurrentRow.Cells["id_torneo_col"].Value.ToString()); if (fechaXTorneoService.eliminar(fechaXTorneo)) { MessageBox.Show("Registro eliminado con exito!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Registro no eliminado!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } ActualizarGrilla(); } } else { MessageBox.Show("Primero debe seleccionar un registro", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public FrmEditarAsignacion(FechaXTorneo fechaXTorneo) { InitializeComponent(); this.fechaXTorneo = fechaXTorneo; fechaService = new FechaService(); torneoService = new TorneoService(); fechaXTorneoService = new FechaXTorneoService(); LlenarCombo(cboTorneo, torneoService.obtenerTodosTorneos(), "Nombre", "IdTorneo"); LlenarCombo(cboFecha, fechaService.obtenerTodasFechas(), "Nombre", "IdFecha"); }
public bool remove(FechaXTorneo fechaXTorneo) { string sql = "DELETE FechaXTorneo " + " WHERE nroFecha=@nroFecha AND idTorneo=@idTorneo "; Dictionary <string, object> parametros = new Dictionary <string, object>(); parametros.Add("idTorneo", fechaXTorneo.Torneo.IdTorneo); parametros.Add("nroFecha", fechaXTorneo.Fecha.IdFecha); return(DataManager.GetInstance().EjecutarSQL(sql, parametros) == 1); }
public bool getRepeat(FechaXTorneo oFechaxTorneo) { string sql = " SELECT * " + " FROM FechaXTorneo " + " WHERE nroFecha = '" + oFechaxTorneo.IdFecha + "' " + " AND idTorneo = '" + oFechaxTorneo.IdTorneo + "' " + " AND estado = 'S' "; return(DataManager.GetInstance().ConsultaSQL(sql).Rows.Count == 1); }
public bool ValidarRepetidos(FechaXTorneo oFechaxTorneo) { if (cambioDatos()) { if (fechaXTorneoService.obtenerRepetidos(oFechaxTorneo)) { MessageBox.Show("Ya existe registro con los mismos datos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } return(true); }
public bool modify(FechaXTorneo fechaXTorneo, int fechaSeleccionada, int torneoSeleccionado) { string sql = "UPDATE FechaXTorneo " + " SET nroFecha=@nroFecha, idTorneo=@idTorneo " + " WHERE nroFecha=@nroFechaSeleccionado AND idTorneo=@idTorneoSeleccionado "; Dictionary <string, object> parametros = new Dictionary <string, object>(); parametros.Add("idTorneo", fechaXTorneo.Torneo.IdTorneo); parametros.Add("nroFecha", fechaXTorneo.Fecha.IdFecha); parametros.Add("idTorneoSeleccionado", torneoSeleccionado); parametros.Add("nroFechaSeleccionado", fechaSeleccionada); return(DataManager.GetInstance().EjecutarSQL(sql, parametros) == 1); }
private FechaXTorneo ObjectMapping(DataRow row) { FechaXTorneo fechaXtorneo = new FechaXTorneo(); fechaXtorneo.Torneo = new Torneo(); fechaXtorneo.Fecha = new Fecha(); fechaXtorneo.Torneo.IdTorneo = Int32.Parse(row[0].ToString()); fechaXtorneo.Torneo.Nombre = row[1].ToString(); fechaXtorneo.Fecha.IdFecha = Int32.Parse(row[2].ToString()); fechaXtorneo.Fecha.Nombre = row[3].ToString(); return(fechaXtorneo); }
//-----------------------BOTONES ABM--------------------------------// private void Btn_editar_Click(object sender, EventArgs e) { if (dgw_asignadas.CurrentRow != null) { FechaXTorneo fechaXTorneo = new FechaXTorneo(); fechaXTorneo.Fecha = new Fecha(); fechaXTorneo.Torneo = new Torneo(); fechaXTorneo.Fecha.IdFecha = Int32.Parse(dgw_asignadas.CurrentRow.Cells["id_fecha_col"].Value.ToString()); fechaXTorneo.Torneo.IdTorneo = Int32.Parse(dgw_asignadas.CurrentRow.Cells["id_torneo_col"].Value.ToString()); fechaXTorneo.Fecha.Nombre = dgw_asignadas.CurrentRow.Cells["nombre_fecha_col"].Value.ToString(); fechaXTorneo.Torneo.Nombre = dgw_asignadas.CurrentRow.Cells["nombre_torneo_col"].Value.ToString(); FrmEditarAsignacion frmEditarAsignacion = new FrmEditarAsignacion(fechaXTorneo); AddOwnedForm(frmEditarAsignacion); frmEditarAsignacion.ShowDialog(); } else { MessageBox.Show("Primero debe seleccionar un registro", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public bool obtenerRepetidos(FechaXTorneo oFechaxTorneo) { return(FechaXTorneoDao.getRepeat(oFechaxTorneo)); }
public bool modificar(FechaXTorneo fechaXTorneo, int fechaSeleccionada, int torneoSeleccionado) { return(FechaXTorneoDao.modify(fechaXTorneo, fechaSeleccionada, torneoSeleccionado)); }
public bool eliminar(FechaXTorneo fechaXTorneo) { return(FechaXTorneoDao.remove(fechaXTorneo)); }