public int IngresaDetalleEventos(DetallesEventos de) { try { SqlConnection SqlCn = new SqlConnection(cn.LeerConexion()); SqlCommand cmd = new SqlCommand("Sp_Registro_Detalle_Eventos", SqlCn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@id_evento", SqlDbType.Int).Value = de.id_evento; cmd.Parameters.Add("@detalle_evento", SqlDbType.VarChar).Value = de.detalle_eventos; cmd.Parameters.Add("@id_user", SqlDbType.Int).Value = de.id_user; try { SqlCn.Open(); return(cmd.ExecuteNonQuery()); } catch (Exception ex) { throw new Exception(ex.Message); } finally { SqlCn.Close(); cmd.Dispose(); } } catch (Exception exx) { throw new Exception(exx.Message); } }
protected void btnAgregar_Click(object sender, EventArgs e) { try { if (valor.Value != "0") { Bu_Eventos eve = new Bu_Eventos(); DetallesEventos d = new DetallesEventos(); d.id_evento = Convert.ToInt32(valor.Value); d.detalle_eventos = txtDetalle.Value.ToString().Trim(); d.id_user = 16712750; eve.IngresaDetalleEventos(d); CargaTabla(Convert.ToInt32(valor.Value)); limpiar(); } else { Response.Write("<script language=javascript>alert('NO HAS SELECCIONADO UN EVENTO');</script>"); } } catch (Exception ex) { Response.Write("<script language=javascript>alert('ERROR DE REGISTRO: \n " + ex.ToString() + "');</script>"); } }
public int CierraEventos(DetallesEventos de) { return(new Co_Eventos().CierraEventos(de)); }
public int IngresaDetalleEventos(DetallesEventos de) { return(new Co_Eventos().IngresaDetalleEventos(de)); }