private void botonCerrar_Cuenta_Click(object sender, EventArgs e) { DialogResult cancelarCuenta = MessageBox.Show("Seguro desea Cerrar la cuenta?", "ADVERTENCIA", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (cancelarCuenta == DialogResult.Yes) { baseDatos.ExecuteCommand("Delete from Usuarios where LoginUser ="******"'" + recibirNombre + "'" + ";"); baseDatos.SubmitChanges(); cerrar_cuenta = "Cerrar Cuenta"; System.Environment.Exit(9); } else { return; } }
private void botonRegistrase_Click(object sender, EventArgs e) { if (de_administrador_registro == "administrador_registro") { if (txtNombre.Text == "" || txtApellido.Text == "" || txtUser.Text == "" || txtContraseña.Text == "" || txtConfirmarContraseña.Text == "" || txtCorreo.Text == "" || txtTelefono.Text == "" || comboBoxDia.Text == "Dia" || comboBoxMes.Text == "Mes" || comboBoxAño.Text == "Año" || comboBoxSexo.Text == "Escoja su Sexo") { MessageBox.Show("Debe Leenar todos los Campos.", "Advertencia"); } else { Guardar_Datos(); MessageBox.Show("Usuario Registrado con Exito.", "AVISO"); activarElementos(); Hide(); } } if (de_administrador_modificar == "administrador_modificar") { baseDatos.ExecuteCommand("Update Usuarios set LoginUser ="******"'" + txtUser.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Nombre =" + "'" + txtNombre.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Apellido =" + "'" + txtApellido.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Contraseña =" + "'" + txtContraseña.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set eMail =" + "'" + txtCorreo.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Telefono =" + "'" + Convert.ToInt32(txtTelefono.Text) + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Pais =" + "'" + txtPais.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Fecha =" + "'" + comboBoxDia.SelectedItem + "/" + comboBoxMes.SelectedItem + "/" + comboBoxAño.SelectedItem + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Sexo =" + "'" + comboBoxSexo.SelectedItem + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.SubmitChanges(); Cargar_Datos(); } if (de_login_registro == "login_registro") { if (txtNombre.Text == "" || txtApellido.Text == "" || txtUser.Text == "" || txtContraseña.Text == "" || txtConfirmarContraseña.Text == "" || txtCorreo.Text == "" || txtTelefono.Text == "" || comboBoxDia.Text == "Dia" || comboBoxMes.Text == "Mes" || comboBoxAño.Text == "Año" || comboBoxSexo.Text == "Escoja su Sexo") { MessageBox.Show("Debe Leenar todos los Campos.", "Advertencia"); } if (checkBoxCondiciones.Checked == false) { MessageBox.Show("Debe aceptar las Condiciones de uso.", "Advertencia"); } else { Guardar_Datos(); Ruta_Corta.Administrador cambioFormulario = new Ruta_Corta.Administrador(); cambioFormulario.de_registro_a_user = "******"; cambioFormulario.recibirNombre = txtUser.Text; ocultar = true; Hide(); cambioFormulario.Show(); } } if (de_user_modificar == "user_modificar") { baseDatos.ExecuteCommand("Update Usuarios set LoginUser ="******"'" + txtUser.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Nombre =" + "'" + txtNombre.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Apellido =" + "'" + txtApellido.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Contraseña =" + "'" + txtContraseña.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set eMail =" + "'" + txtCorreo.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Telefono =" + "'" + Convert.ToInt32(txtTelefono.Text) + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Pais =" + "'" + txtPais.Text + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Fecha =" + "'" + comboBoxDia.SelectedItem + "/" + comboBoxMes.SelectedItem + "/" + comboBoxAño.SelectedItem + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.ExecuteCommand("Update Usuarios set Sexo =" + "'" + comboBoxSexo.SelectedItem + "'" + "where Id =" + Convert.ToString(id_Borrar) + ";"); baseDatos.SubmitChanges(); Cargar_Datos_Modificados(); } }