Example #1
0
        public string eliminar(DPresentacion presentacion)
        {
            string        rpts   = "";
            SqlConnection consql = Conexion.conexion();

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = consql;
                cmd.CommandText = "speliminar_presentacion";
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@idpresentacion", idpresentacion);
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                rpts = ex.Message;
            }

            return(rpts);
        }
Example #2
0
        public string editar(DPresentacion presentacion)
        {
            string        repuesta = "";
            SqlConnection sqlcon   = Conexion.conexion();

            try
            {
                SqlCommand sqlcmd = new SqlCommand();
                sqlcmd.Connection  = sqlcon;
                sqlcmd.CommandText = "speditar_presentacion";
                sqlcmd.CommandType = CommandType.StoredProcedure;

                sqlcmd.Parameters.AddWithValue("@idpresentacion", idpresentacion);
                sqlcmd.Parameters.AddWithValue("@nombre", nombre);
                sqlcmd.Parameters.AddWithValue("@descripcion", descripcion);
                sqlcmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                repuesta = ex.Message;
            }

            return(repuesta);
        }
Example #3
0
        public DataTable buscarnombre_presentacion(DPresentacion presentacion)
        {
            DataTable     ap  = new DataTable("presentacion");
            SqlConnection con = new SqlConnection();

            try
            {
                con.ConnectionString = Conexion.cadena;
                SqlCommand sqlcmd = new SqlCommand();
                sqlcmd.Connection  = con;
                sqlcmd.CommandText = "spbuscar_presentacion";
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.Parameters.AddWithValue("@textobuscar", textobuscar);

                SqlDataAdapter sqldat = new SqlDataAdapter(sqlcmd);
                sqldat.Fill(ap);
            }
            catch (Exception)
            {
                ap = null;
            }

            return(ap);
        }