コード例 #1
0
        public void EliminarTag(UEUTag EU_Tag, String modif)
        {
            NpgsqlConnection conection = new NpgsqlConnection(ConfigurationManager.ConnectionStrings["Postgresql"].ConnectionString);

            try
            {
                NpgsqlCommand command = new NpgsqlCommand("sp_borrar_palabraclave", conection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add("_idpalabra", NpgsqlTypes.NpgsqlDbType.Integer).Value = EU_Tag.IdTag;
                command.Parameters.Add("_modif", NpgsqlTypes.NpgsqlDbType.Text).Value        = modif;
                conection.Open();
                command.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                if (conection != null)
                {
                    conection.Close();
                }
            }
        }
コード例 #2
0
        public DataTable MostrarTags(UEUTag EU_Tag)
        {
            DataTable        Tags      = new DataTable();
            NpgsqlConnection conection = new NpgsqlConnection(ConfigurationManager.ConnectionStrings["Postgresql"].ConnectionString);

            try
            {
                NpgsqlCommand command = new NpgsqlCommand("sp_mostrar_palabraclave", conection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add("_idproducto", NpgsqlTypes.NpgsqlDbType.Integer).Value = EU_Tag.IdProducto;
                conection.Open();
                NpgsqlDataAdapter DA = new NpgsqlDataAdapter(command);
                DA.Fill(Tags);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                if (conection != null)
                {
                    conection.Close();
                }
            }

            return(Tags);
        }
コード例 #3
0
 //METODO PARA AÑADIR UN NUEVO TAG
 public void añadir_tag(UEUTag data)
 {
     using (var db = new Mapeo("public"))
     {
         db.tag.Add(data);
         db.SaveChanges();
         DBAuditoria.insert(data, crearAcceso(), "dbo", "Palabra_clave");
     }
 }
コード例 #4
0
 //METODO PARA ELIMINAR UN TAG
 public void delete_tag(UEUTag tagg)
 {
     using (var db = new Mapeo("public"))
     {
         var data = db.tag.Find(tagg.IdTag);
         db.Entry(data).State = EntityState.Deleted;
         db.SaveChanges();
         DBAuditoria.delete(data, crearAcceso(), "dbo", "Palabra_clave");
     }
 }
コード例 #5
0
        private void BorrarPalabra(int idPalabra, String modif)
        {
            //DDAOTag DAO_Tag = new DDAOTag();
            DB_Producto daoTag = new DB_Producto();
            UEUTag      EU_Tag = new UEUTag();

            EU_Tag.IdTag = idPalabra;
            daoTag.delete_tag(EU_Tag);
            //DAO_Tag.EliminarTag(EU_Tag, modif);
        }
コード例 #6
0
ファイル: DB_Tag.cs プロジェクト: edkeran/compramatic
 public DataTable MostrarTags(UEUTag tag)
 {
     using (var db = new Mapeo("public"))
     {
         var data = (from palabraClave in db.tag
                     where palabraClave.IdProducto == tag.IdProducto
                     select palabraClave);
         ListToDataTable conv = new ListToDataTable();
         DataTable       res  = conv.ToDataTable <UEUTag>(data.ToList <UEUTag>());
         return(res);
     }
 }
コード例 #7
0
        private void RegistrarPalabra(String palabra, int idProducto, String modif)
        {
            //DDAOTag DAO_Tag = new DDAOTag();
            DB_Producto daoTag = new DB_Producto();
            UEUTag      EU_Tag = new UEUTag();

            EU_Tag.Palabra    = palabra;
            EU_Tag.IdProducto = idProducto;
            EU_Tag.ModifiedBy = modif;
            daoTag.añadir_tag(EU_Tag);
            //DAO_Tag.AgregarTag(EU_Tag, modif);
        }
コード例 #8
0
        public DataTable MostrarTags(int idProducto)
        {
            DB_Tag    daoTag = new DB_Tag();
            DataTable Tags   = new DataTable();
            UEUTag    EU_Tag = new UEUTag();

            //DDAOTag DAO_Tag = new DDAOTag();
            //daoTag.MostrarTags(EU_Tag);
            EU_Tag.IdProducto = idProducto;
            Tags = daoTag.MostrarTags(EU_Tag);
            return(Tags);
        }