コード例 #1
0
    protected void Uploader1_FileUploaded(object sender, UploaderEventArgs args)
    {
        //Get the full path of file that will be saved.
        string virpath = "~/pages/imagenes/inmuebles/venta/" + args.FileGuid + System.IO.Path.GetExtension(args.FileName);


        //Map the path to to a physical path.
        string savepath = Server.MapPath(virpath);

        //Do not overwrite an existing file
        if (System.IO.File.Exists(savepath))
        {
            return;
        }

        //Move the uploaded file to the target location
        args.MoveTo(savepath);



        DtoCliente dto_cliente = new DtoCliente();

        dto_cliente.id_persona = int.Parse(Session["id_persona"].ToString());

        DtoImagenesPublicacion dto_imagenes_publicacion = new DtoImagenesPublicacion();

        dto_imagenes_publicacion.imagen = args.FileGuid + System.IO.Path.GetExtension(args.FileName);
        CtrImagenesPublicacion ctr_imagenes_publicacion = new CtrImagenesPublicacion();

        ctr_imagenes_publicacion.Ctr_Insertar_Imagenes_De_Propietario(dto_cliente, dto_imagenes_publicacion);
    }
コード例 #2
0
        public void Dao_Insertar_Imagenes_De_Propietario(DtoCliente dto_cliente, DtoImagenesPublicacion dto_imagenes_publicacion)
        {
            SqlCommand cmd = new SqlCommand("sp_Insertar_Publicacion", conexion);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@id_persona", dto_cliente.id_persona);
            cmd.Parameters.AddWithValue("@imagen", dto_imagenes_publicacion.imagen);

            conexion.Open();
            cmd.ExecuteNonQuery();
            conexion.Close();
        }
コード例 #3
0
 public void Ctr_Insertar_Imagenes_De_Propietario(DtoCliente dto_cliente, DtoImagenesPublicacion dto_imagenes_publicacion)
 {
     dao_imagenes_publicacion.Dao_Insertar_Imagenes_De_Propietario(dto_cliente, dto_imagenes_publicacion);
 }