예제 #1
0
        public static string Ingresar(DetEvento_Material mat)
        {
            string        rpt = "ok";
            SqlConnection cn  = new SqlConnection(Conexion.cn);

            try
            {
                DynamicParameters dp1 = new DynamicParameters();
                dp1.Add("@IdEvento", mat.IdEvento);
                dp1.Add("@IdMaterial", mat.IdMaterial);
                dp1.Add("@CostoUnitario", mat.CostoUnitario);
                dp1.Add("@Cantidad", mat.Cantidad);

                cn.Execute("itData.SP_I_DetEvento_Material", dp1, commandType: CommandType.StoredProcedure);
            }
            catch (Exception e)
            {
                rpt = "Excepción ocurrida: " + e.Message;
            }
            finally
            {
                cn.Close();
                cn.Dispose();
            }
            return(rpt);
        }
예제 #2
0
        public static DetEvento_Material Listar(int IdEvento, int IdMaterial)
        {
            DetEvento_Material lis = new DetEvento_Material();
            SqlConnection      cn  = new SqlConnection(Conexion.cn);

            try
            {
                DynamicParameters dypa = new DynamicParameters();
                dypa.Add("@IdEvento", IdEvento);
                dypa.Add("@IdMaterial", IdMaterial);

                lis = cn.Query <DetEvento_Material>("itData.SP_S_ID_DetEvento_Material", dypa, commandType: CommandType.StoredProcedure).First();
            }
            catch (Exception e)
            {
                lis = null;
                var rpt = "Excepción ocurrida: " + e.Message;
            }
            finally
            {
                cn.Close();
                cn.Dispose();
            }
            return(lis);
        }
예제 #3
0
 public string ActualizarDetEvento_Material(DetEvento_Material mat)
 {
     return DetEvento_MaterialDAO.Actualizar(mat);
 }
예제 #4
0
 public string IngresarDetEvento_Material(DetEvento_Material mat)
 {
     return DetEvento_MaterialDAO.Ingresar(mat);
 }
        public string Put([FromBody] DetEvento_Material value)
        {
            var rpt = gestorDetEvento_Material.ActualizarDetEvento_Material(value);

            return(rpt);
        }
        public string Post([FromBody] DetEvento_Material material)
        {
            var resp = gestorDetEvento_Material.IngresarDetEvento_Material(material);

            return(resp);
        }