Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public string ActualizarDetEvento_Local(DetEvento_Local value)
 {
     return(DetEvento_LocalDAO.Actualizar(value));
 }
Exemplo n.º 4
0
 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));
 }