Exemplo n.º 1
0
    public AdjuntoBE GetByIdAdjunto(int IdAdjunto)
    {
        AdjuntoBE AdjuntoBE = new AdjuntoBE();
        AdjuntoBL AdjuntoBL = new AdjuntoBL();

        AdjuntoBE = AdjuntoBL.GetByIdAdjunto(connstring, IdAdjunto);

        return(AdjuntoBE);
    }
Exemplo n.º 2
0
    public void AdjuntoTemporalDeleteByIdCarga(string IdCarga)
    {
        AdjuntoBE AdjuntoBE = new AdjuntoBE();
        AdjuntoBL AdjuntoBL = new AdjuntoBL();

        AdjuntoBE.IdCarga             = IdCarga;
        AdjuntoBE.UsuarioModificacion = User.Identity.Name;

        AdjuntoBL.AdjuntoTemporalDeleteByIdCarga(connstring, AdjuntoBE);
    }
Exemplo n.º 3
0
    public void DeleteByIdCargaFilename(string FileName, string IdCarga)
    {
        AdjuntoBE AdjuntoBE = new AdjuntoBE();
        AdjuntoBL AdjuntoBL = new AdjuntoBL();

        AdjuntoBE.IdCarga       = IdCarga;
        AdjuntoBE.NombreAdjunto = FileName;

        AdjuntoBL.DeleteByIdCargaFilename(AdjuntoBE);
    }
Exemplo n.º 4
0
    public void GetById(int IdAdjunto)
    {
        AdjuntoBE AdjuntoBE = new AdjuntoBE();
        AdjuntoBL AdjuntoBL = new AdjuntoBL();

        AdjuntoBE = AdjuntoBL.GetByIdAdjunto(connstring, IdAdjunto);

        AdjuntoBE.AdjuntoFisico = null;

        JavaScriptSerializer js = new JavaScriptSerializer();
        string strJSON          = js.Serialize(AdjuntoBE);

        Context.Response.Clear();
        Context.Response.ContentType = "application/json";
        Context.Response.Flush();
        Context.Response.Write(strJSON);
    }
Exemplo n.º 5
0
    public void GetLastByUser()
    {
        AdjuntoBE AdjuntoBE = new AdjuntoBE();
        AdjuntoBL AdjuntoBL = new AdjuntoBL();

        string CuentaUsuario = User.Identity.Name;

        AdjuntoBE = AdjuntoBL.GetLastByUser(connstring, CuentaUsuario);

        AdjuntoBE.AdjuntoFisico = null;

        JavaScriptSerializer js = new JavaScriptSerializer();
        string strJSON          = js.Serialize(AdjuntoBE);

        Context.Response.Clear();
        Context.Response.ContentType = "application/json";
        Context.Response.Flush();
        Context.Response.Write(strJSON);
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string urltmp = HttpContext.Current.Request.Url.AbsoluteUri;

        try
        {
            idCarga.Value = Request.QueryString["IdCarga"].ToString();
        }
        catch (Exception ex)
        {}

        foreach (string s in Request.Files)
        {
            HttpPostedFile file = Request.Files[s];

            AdjuntoBE AdjuntoBE = new AdjuntoBE();
            AdjuntoBL AdjuntoBL = new AdjuntoBL();

            AdjuntoBE.IdCarga         = idCarga.Value.ToString();
            AdjuntoBE.NombreAdjunto   = file.FileName;
            AdjuntoBE.AdjuntoFileType = file.ContentType;
            AdjuntoBE.AdjuntoFileSize = file.ContentLength;
            AdjuntoBE.UsuarioCreacion = User.Identity.Name;

            using (var binaryReader = new BinaryReader(file.InputStream))
            {
                AdjuntoBE.AdjuntoFisico = binaryReader.ReadBytes(file.ContentLength);
            }

            AdjuntoBL.AdjuntoTemporalInsert(connstring, AdjuntoBE);
        }

        if (!Page.IsPostBack)
        {
        }
    }