Example #1
0
        public int Sentencia(Ecategoria cat)
        {
            int          id  = 0;
            MySqlCommand cmd = new MySqlCommand("SentenciaCategoria", con.con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("id", MySqlDbType.Int32).Value         = cat.idcategoria;
            cmd.Parameters.Add("descripcion", MySqlDbType.Text).Value = cat.descripcion;
            cmd.Parameters.Add("accion", MySqlDbType.Text).Value      = cat.accion;

            try
            {
                con.Conectar();
                id = int.Parse(cmd.ExecuteScalar().ToString());
                con.Desconectar();
            }
            finally
            {
                con.Desconectar();
            }


            return(id);
        }
Example #2
0
        public static int Sentencia(Ecategoria c)
        {
            Dcategoria ca = new Dcategoria();

            return(ca.Sentencia(c));
        }