protected void btnEnviar_Click(object sender, EventArgs e) { UsuariosCTRL obj = new UsuariosCTRL(); UsuarioBO O = new UsuarioBO(); O.Nombre = txtNombre.Text; O.SitioWeb = txtSitio.Text; O.Telefono = txtTelefono.Text; O.Telefono2 = txtTelefono1.Text; O.Usuario = txtUsuario.Text; O.Correo = txtCorreo.Text; O.Contraseña = txtContraseña.Text; if (obj.GuardarR(O) != 0) { Response.Write("<script language=javascript>alert('Datos Guardados');</script>"); } else { Response.Write("<script language=javascript>alert('Algo salio mal');</script>"); } Limpiar(); }
protected void btnModificar_Click(object sender, EventArgs e) { UsuariosCTRL servicio = new UsuariosCTRL(); UsuarioBO datos = new UsuarioBO(); try { datos.IDUsuario = int.Parse(Session["IDUsuario"].ToString()); datos.Nombre = txtNombre.Text; datos.Correo = txtCorreo.Text; datos.Correo1 = txtCorreo2.Text; datos.Correo2 = txtCorreo3.Text; datos.Telefono = txtTelefono.Text; datos.SitioWeb = txtSitioWeb.Text; datos.Usuario = txtUsuario.Text; datos.Contraseña = txtContraseña.Text; string NombreImagen = Path.GetFileName(fupfoto.PostedFile.FileName); if (fupfoto.HasFile) { fupfoto.PostedFile.SaveAs(Server.MapPath("~/Img/") + NombreImagen); Image1.ImageUrl = "~/Img/" + NombreImagen; } //almacenar en la BD datos.Fotografia = "/" + NombreImagen; ////guardar foto //string NombreImagen = Path.GetFileName(FileUpload1.PostedFile.FileName); //FileUpload1.PostedFile.SaveAs(Server.MapPath("~/img/") + NombreImagen); //Image1.ImageUrl = "~/img/" + FileUpload1.PostedFile.FileName; ////almacenar en la BD //datos.Fotografia = "/" + NombreImagen; ; if (servicio.ActualizarAdmin(datos) == 1) { Response.Write("<script language=javascript>alert('Datos Actualizados','Los cambios se notaran al iniciar sesion de nuevo');</script>"); } else { Response.Write("<script language=javascript>alert('Datos Actualizados');</script>"); } //Actualizar(); } catch (Exception) { } }