public AdjuntoBE GetByIdAdjunto(int IdAdjunto) { AdjuntoBE AdjuntoBE = new AdjuntoBE(); AdjuntoBL AdjuntoBL = new AdjuntoBL(); AdjuntoBE = AdjuntoBL.GetByIdAdjunto(connstring, IdAdjunto); return(AdjuntoBE); }
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); }
public void DeleteByIdCargaFilename(string FileName, string IdCarga) { AdjuntoBE AdjuntoBE = new AdjuntoBE(); AdjuntoBL AdjuntoBL = new AdjuntoBL(); AdjuntoBE.IdCarga = IdCarga; AdjuntoBE.NombreAdjunto = FileName; AdjuntoBL.DeleteByIdCargaFilename(AdjuntoBE); }
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); }
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); }
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) { } }