public void ActualizarClave(Cuenta cuenta, string nuevaClave, string antiguaClave) { LogicControlSistema oLControlSistema = new LogicControlSistema(); DataCuenta oDCuenta = new DataCuenta(); if (cuenta.Clave.Trim() != antiguaClave.Trim()) { throw new Exception("Contraseña actual incorrecta."); } if (!Regex.IsMatch(nuevaClave, "[A-Za-z0-9]+")) { throw new Exception("Clave: Formato incorrecto"); } if (nuevaClave.Length < 8) { throw new Exception("Clave: Debe tener mas de 8 caracteres."); } cuenta.Clave = nuevaClave; oDCuenta.UpdClave(cuenta); oLControlSistema.GetCuentaLogin().Clave = nuevaClave; }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { LogicControlSistema enlace = new LogicControlSistema(); FormModificarClave form = new FormModificarClave(); form.Cuenta = enlace.GetCuentaLogin(); form.ShowDialog(); }
private void ActualizarVistaCuenta() { LogicControlSistema enlace = new LogicControlSistema(); Cuenta cuent = enlace.GetCuentaLogin(); CampNombre.Text = cuent.Nombre + " " + cuent.PrimerApellido + " " + cuent.SegundoApellido; CampNivel.Text = cuent.Nivel.ToString(); }
private void BtnInicia_Click(object sender, EventArgs e) { LogicControlSistema enlace = new LogicControlSistema(); try { enlace.AperturaAutorizacion(CampDni.Text, CampClave.Text); this.Visible = false; } catch (Exception ex) { MessageBox.Show(ex.Message, "Acceso Denegado"); } }
//ACCION QUE PERMITE INICIAR SESION //LLAMA FUNCIONES DEL SISTEMA INTERNO private void BtnInicio_Click(object sender, EventArgs e) { LogicControlSistema enlaceControlSistema = new LogicControlSistema(); try { if (enlaceControlSistema.IniciarSesion(CampDni.Text, CampClave.Text.Trim(' '))) { this.Visible = false; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void ActualizarCuenta(Cuenta cuenta) { LogicControlSistema oLControlSistema = new LogicControlSistema(); DataCuenta oDCuenta = new DataCuenta(); ValidarDatos(cuenta); if (oLControlSistema.GetCuentaLogin().Dni != cuenta.Dni && oDCuenta.CheckExistCuenta(cuenta.Dni)) { throw new Exception("Ya existe una cuenta para ese DNI"); } oDCuenta.UpdCuenta(cuenta); oLControlSistema.GetCuentaLogin().Dni = cuenta.Dni; oLControlSistema.GetCuentaLogin().Nombre = cuenta.Nombre; oLControlSistema.GetCuentaLogin().PrimerApellido = cuenta.PrimerApellido; oLControlSistema.GetCuentaLogin().SegundoApellido = cuenta.SegundoApellido; oLControlSistema.GetCuentaLogin().Especialidad = cuenta.Especialidad; oLControlSistema.GetCuentaLogin().CodigoPro = cuenta.CodigoPro; }
private void BtnAutorizacion_Click(object sender, EventArgs e) { LogicControlSistema logicaSistema = new LogicControlSistema(); LogicaExamen enlaceExamen = new LogicaExamen(); LogicaOrden enlaceOrden = new LogicaOrden(); ConfiguracionExamen.GetInstance().Loading = true; if (!logicaSistema.GetPase()) { ValidarAutorizacion(); CheckEstado.Checked = false; } if (logicaSistema.GetPase()) { examenes[idExamenSelected].Estado = EstadoExamen.EnProceso; CheckEstado.Checked = false; enlaceExamen.GuardarExamen(examenes[idExamenSelected]); enlaceOrden.ActualizarOrden(examenes, orden); ActualizarDGVEstadoExamen(); HabilitarTools(); UnblockPanelExamen(); } ConfiguracionExamen.GetInstance().Loading = false; }
static void Main() { bool TestPass = false; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { //test conexion System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(); con.ConnectionString = ConfiguracionDataAccess.GetInstance().CadenaConexion; con.Open(); con.Close(); TestPass = true; } catch (SqlException ex) { MessageBox.Show("Error de Conexion, proporciona este error a soporte tecnico: \n\n" + ex.Message, "Mensaje del Sistem"); } if (TestPass) { try { CargadorArchivos cargador = new CargadorArchivos(); // Creamos el subproceso Thread hiloAuxiliar = new Thread(new ThreadStart(cargador.cargar)); // Ejecutamos el subproceso hiloAuxiliar.Start(); // Esperamos a que se carguen los archivos mientras ejecuta el splash while (!hiloAuxiliar.IsAlive) { ; } PantallaDeCarga formCarga = new PantallaDeCarga(2, hiloAuxiliar); // ------- Cargamos y mostramos el formulario Splash durante 2 minimo ----- // Mostramos el formulario de forma modal. formCarga.ShowDialog(); formCarga.Dispose(); LogicControlSistema enlaceControlSistema = new LogicControlSistema(); do { FormInicioSesion form = new FormInicioSesion(); form.ShowDialog(); form.Dispose(); if (enlaceControlSistema.EsLoggeado()) { Principal formPrincipal = new Principal(); Application.Run(formPrincipal); if (!formPrincipal.Visible) { formPrincipal.Dispose(); } enlaceControlSistema.CerrarSesion(); } else { isRunning = false; } } while (isRunning); } catch (Exception ex) { MessageBox.Show(ex.Message); isRunning = false; } } //Application.Run(new Test()); }