public static string Ingresar(DetEvento_Local value) { string rpt = "ok"; SqlConnection cn = new SqlConnection(Conexion.cn); try { DynamicParameters dp1 = new DynamicParameters(); dp1.Add("@IdLocal", value.IdLocal); dp1.Add("@IdEvento", value.IdEvento); dp1.Add("@FechaIni", value.FechaIni); dp1.Add("@FechaFin", value.FechaFin); dp1.Add("@Costo", value.Costo); dp1.Add("@Comentario", value.Comentario); cn.Execute("itData.SP_I_DetEVENTO_LOCAL", dp1, commandType: CommandType.StoredProcedure); } catch (Exception e) { rpt = "Excepción ocurrida: " + e.Message; } finally { cn.Close(); cn.Dispose(); } return(rpt); }
public static DetEvento_Local Listar(int IdEvento, int IdLocal) { DetEvento_Local lis = new DetEvento_Local(); SqlConnection cn = new SqlConnection(Conexion.cn); try { DynamicParameters dypa = new DynamicParameters(); dypa.Add("@IdLocal", IdLocal); dypa.Add("@IdEvento", IdEvento); lis = cn.Query <DetEvento_Local>("itData.SP_S_ID_DetEVENTO_LOCAL", dypa, commandType: CommandType.StoredProcedure).First(); } catch (Exception e) { lis = null; var rpt = "Excepción ocurrida: " + e.Message; } finally { cn.Close(); cn.Dispose(); } return(lis); }
public string ActualizarDetEvento_Local(DetEvento_Local value) { return(DetEvento_LocalDAO.Actualizar(value)); }
public string IngresarDetEvento_Local(DetEvento_Local value) { return(DetEvento_LocalDAO.Ingresar(value)); }
public string Post([FromBody] DetEvento_Local value) { return(gestorDetEvento_Local.IngresarDetEvento_Local(value)); }
public string Put([FromBody] DetEvento_Local value) { return(gestorDetEvento_Local.ActualizarDetEvento_Local(value)); }