protected void btnregistrar_Click(object sender, EventArgs e) { SaveClienteFoto(); //Configuracion para registrar cliente en la base de datos //Creo el objeto k TheGym k = new TheGym { NombreCliente = tbnombre.Text, ApellidoCliente = tbapellido.Text, EmailCliente = tbemail.Text, FechaCliente = tbfechadenacimiento.Text, TelefonoCliente = tbtelefono.Text, CalleCliente = tbcalle.Text, NumeroCliente = tbnumerocasa.Text, BarrioCliente = tbbarrio.Text, FKLocalidadCliente = ddllocalidad.SelectedValue, DNICliente = tbnumerodocumento.Text, FotoCliente = "~/ImagenesSistema/" + tbnumerodocumento.Text + extention, FKTipoDocumento = ddltipodedocumento.SelectedValue, }; try { k.AddNewCliente(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "$('#modal-default').modal('show');", true); } catch (Exception ex) { lblerror.Text = ex.Message.ToString(); } tbnombre.Text = string.Empty; tbapellido.Text = string.Empty; tbfechadenacimiento.Text = string.Empty; tbemail.Text = string.Empty; tbcalle.Text = string.Empty; tbnumerocasa.Text = string.Empty; tbbarrio.Text = string.Empty; tbcontraseña.Text = string.Empty; ddllocalidad.ClearSelection(); ddltipodedocumento.ClearSelection(); tbtelefono.Text = string.Empty; tbnumerodocumento.Text = string.Empty; tbusuario.Text = string.Empty; //daltan algunos }
protected void btnaceptar0_Click(object sender, EventArgs e) { try { SaveClienteFoto(); //Configuracion para registrar cliente en la base de datos //Creo el objeto k TheGym k = new TheGym { NombreCliente = tbnombre0.Text, ApellidoCliente = tbapellido0.Text, EmailCliente = tbemail1.Text, FechaCliente = tbfechanacimiento1.Text, TelefonoCliente = tbtelefono1.Text, DomicilioCliente = tbdomicilio.Text, DNICliente = tbdni0.Text, FotoCliente = "~/ImagenesSistema/" + fuImage.FileName }; try { k.AddNewCliente(); LblReg.Text = ("Cliente registrado con éxito."); } catch { } tbnombre0.Text = string.Empty; tbapellido0.Text = string.Empty; tbfechanacimiento1.Text = string.Empty; tbemail1.Text = string.Empty; tbtelefono1.Text = string.Empty; tbdomicilio.Text = string.Empty; tbdni0.Text = string.Empty; } catch (Exception ex) { LblReg.Text = ex.Message.ToString(); } }