//Función para borrar archivos adjuntos protected void Borrar(object sender, EventArgs e) { var id = Request.Form["__EVENTARGUMENT"]; ServPopulate del = new ServPopulate(); del.DeleteFile(id); BindGrid(((System.Web.UI.Page)sender).ClientQueryString.Split('=')[1]); }
protected void Page_Load(object sender, EventArgs e) { ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", " <script> var Username = '******';</script> "); if (Request.HttpMethod == "POST" && Request.Files.Count != 0) { /* using (Stream fs = Request.Files[0].InputStream) { using (BinaryReader br = new BinaryReader(fs)) { byte[] archivo = br.ReadBytes((Int32)fs.Length);*/ ServPopulate docs = new ServPopulate(); int Llave = docs.UploadArchivo(long.Parse(Request.Params[0]), Request.Params[1], Request.Params[2], Request.Params[3]/*archivo*/); Request.Files[0].SaveAs(Server.MapPath("~/Documentos/") + Llave + '_' + Request.Params[2]); /*} }*/ } //Manejo de los PostBack ClientScript.GetPostBackEventReference(this, string.Empty); }
protected void Page_Load(object sender, EventArgs e) { if (Request.HttpMethod == "POST") { /* using (Stream fs = Request.Files[0].InputStream) { using (BinaryReader br = new BinaryReader(fs)) { byte[] archivo = br.ReadBytes((Int32)fs.Length);*/ ServPopulate docs = new ServPopulate(); int Llave = docs.UploadArchivo(long.Parse(Request.Params[0]), Request.Params[1], Request.Params[2], "-1"/*archivo*/); Request.Files[0].SaveAs(Server.MapPath("~/Documentos/") + Llave+'_'+Request.Params[2]); /* } }*/ } //Manejo de los PostBack ClientScript.GetPostBackEventReference(this, string.Empty); if (Request.Form["__EVENTTARGET"] == "See") { See(this, new EventArgs()); } }
public IEnumerable<SelectableDTO> GetVice(string Aux) { var data = new ServPopulate(); return data.GetVice(); }
public IEnumerable<SelectableDTO> GetTipoArchivo(string Aux) { var data = new ServPopulate(); return data.GetTipoArchivo(); }
public IEnumerable<SelectableDTO> GetNCliente(string CodCliente) { var data = new ServPopulate(); return data.GetNCliente(CodCliente); }
//Función para relacionar los archivos existentes a un Id de Solicitud ingresado private void BindGrid(string Obra) { ServPopulate data = new ServPopulate(); GridFiles.DataSource = data.GetFiles(Obra); GridFiles.DataBind(); /* string constr = ConfigurationManager.ConnectionStrings["HCR"].ConnectionString; using (SqlConnection con = new SqlConnection(constr)) { using (SqlCommand cmd = new SqlCommand()) { cmd.CommandText = "select Id, Nombre, C.IdBusinessctg as Tipo from tblFiles as A inner join tblHSolicitudes as B on A.Llave=B.Llave inner join ctg.tbCtg as C on A.Tipo=C.IdCtg Where A.Data is not null AND A.Llave =" + IdCupo.Text + " ORDER BY Tipo DESC"; cmd.Connection = con; con.Open(); GridFiles.DataSource = cmd.ExecuteReader(); GridFiles.DataBind(); con.Close(); } }*/ }