Example #1
0
        void BtnModFoto_Click(object sender, EventArgs e)
        {
            ClUsuario.Insertar_Actividad_Pagina(14, Convert.ToInt32(Session["UsuarioId"]), ClUsuario.CorrId_ActividadPagina(), 2);
            if (UploadFoto.UploadedFiles.Count > 0)
            {
                Stream fileStream      = UploadFoto.UploadedFiles[0].InputStream;
                byte[] attachmentBytes = new byte[fileStream.Length];
                fileStream.Read(attachmentBytes, 0, Convert.ToInt32(fileStream.Length));
                ClPersona.Actualiza_Foto(Convert.ToInt32(Session["PersonaId"]), attachmentBytes, UploadFoto.UploadedFiles[0].ContentType, UploadFoto.UploadedFiles[0].FileName);
                fileStream.Close();
            }
            LblMensajeGodDatGen.Text = "Foto actualizada exitosamente";
            Btnsuccesdatgen.Visible  = true;
            StringBuilder sbScript = new StringBuilder();

            sbScript.Append("<script language='JavaScript' type='text/javascript'>\n");
            sbScript.Append("<!--\n");
            sbScript.Append(this.GetPostBackEventReference(this, "PBArg") + ";\n");
            sbScript.Append("// -->\n");
            sbScript.Append("</script>\n");

            this.RegisterStartupScript("AutoPostBackScript", sbScript.ToString());
        }