Ejemplo n.º 1
0
        protected void btnRegistrarPadre_Click(object sender, EventArgs e)
        {
            var exite = (from pa in contexto.TblUser where pa.strusuario == txtUsuario.Text select pa).FirstOrDefault();


            if (exite != null)
            {
                if (FotoPerfil.HasFile)
                {
                    string path = Server.MapPath("~/Imagenes/PadreRegistrado/" + FotoPerfil.FileName);
                    FotoPerfil.SaveAs(path);

                    TblPadre pad = new TblPadre();
                    pad.strNombre    = txtNombre.Text.ToUpper();
                    pad.strApellidoP = txtAPaterno.Text.ToUpper();
                    pad.strApellidoM = txtAMaterno.Text.ToUpper();
                    pad.intEdad      = Int32.Parse(txtEdad.Text);
                    pad.strSexo      = txtSexo.Text.ToUpper();
                    pad.strCorreo    = txtCorreo.Text;
                    pad.bitFoto      = path;
                    ControllerPadre ctrlPadre = new ControllerPadre();
                    ctrlPadre.InsertarPadre(GetDatosVista(pad));
                }

                this.Response.Redirect("../Login.aspx", true);
            }
            this.Response.Redirect("./RegistroPadre.aspx", true);
            Console.Write("Ya existe este usuario");
        }
Ejemplo n.º 2
0
 private void AlterarFoto_Click_1(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         FotoPerfil.ImageLocation = openFileDialog1.FileName;
         FotoPerfil.Load();
     }
 }
Ejemplo n.º 3
0
        public async Task <IActionResult> GetInmobiliariaImage(int id)
        {
            FotoPerfil foto = await _service.GetFoto(id);

            if (foto == null)
            {
                return(NotFound(new NotFoundApiResponse("No se encontró foto")));
            }
            return(File(foto.Data, "image/png", ""));
        }
Ejemplo n.º 4
0
        protected void btnRegistrarProfe_Click(object sender, EventArgs e)
        {
            if (FotoPerfil.HasFile)
            {
                string path = Server.MapPath("~/Imagenes/ProfeRegistrado/" + FotoPerfil.FileName);
                FotoPerfil.SaveAs(path);

                TblProfesor prof = new TblProfesor();
                prof.strNombre    = txtNombre.Text.ToUpper();
                prof.strApellidoP = txtAPaterno.Text.ToUpper();
                prof.strApellidoM = txtAMaterno.Text.ToUpper();
                prof.intEdad      = Int32.Parse(txtEdad.Text);
                prof.strSexo      = txtSexo.Text.ToUpper();
                prof.strCorreo    = txtCorreo.Text;
                prof.strCedula    = txtCedula.Text;
                prof.bitFoto      = path;
                ControllerProfesor ctrlProfe = new ControllerProfesor();
                ctrlProfe.InsertarProfe(GetDatosVista(prof));
            }
            this.Response.Redirect("./InicioAdmin.aspx", true);
        }