private void metroTile1_Click(object sender, EventArgs e) { LoginFrm lfm = new LoginFrm(); lfm.Show(); this.Hide(); }
public LoginController(LoginFrm pLoginFrm) { loginFrm = pLoginFrm; loginFrm.Load += new EventHandler(SetearValoresIniciales); //btnLogin loginFrm.btnLogin.Click += new EventHandler(BtnLogin_Click); loginFrm.btnLogin.Enter += new EventHandler(BtnLogin_Enter); loginFrm.btnLogin.Leave += new EventHandler(BtnLogin_Leave); //TxtUsuario loginFrm.txtUsuario.Enter += new EventHandler(TxtUsuario_Enter); loginFrm.txtUsuario.Leave += new EventHandler(TxtUsuario_Leave); loginFrm.txtUsuario.KeyPress += new KeyPressEventHandler(TxtUsuario_KeyPress); //txtContraseña loginFrm.txtContraseña.Enter += new EventHandler(TxtContraseña_Enter); loginFrm.txtContraseña.Leave += new EventHandler(TxtContraseña_Leave); loginFrm.txtContraseña.KeyPress += new KeyPressEventHandler(TxtContraseña_KeyPress); //btnCerrar loginFrm.btnCerrar.Click += new EventHandler(BtnCerrar_Click); //btnMinimizar loginFrm.btnMinimizar.Click += new EventHandler(BtnMinimizar_Click); //Mostrar Conexion con servidor de Autenticacion MostrarMensaje("Intentando establecer conexion", loginFrm.lblConexionConServidorDeAutenticacion); loginFrm.backgroundWorker1.DoWork += new DoWorkEventHandler(BackgroundWorker1_DoWork); loginFrm.backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BackgroundWorker1_RunWorkerCompleted); loginFrm.backgroundWorker1.RunWorkerAsync(); }
public LoginFrm getLoginFrm() { if (loginFrm == null) { loginFrm = new LoginFrm(); } return(loginFrm); }
public virtual void KeyDown(LoginFrm loginFrm) { if (string.IsNullOrWhiteSpace(CurrentUser)) { MessageBoxService.ShowMessage($"用户名不能为空", "提示信息", MessageButton.OK, MessageIcon.Error); return; } LogOn(loginFrm); }
private void FrmMain_Load(object sender, EventArgs e) { IsMdiContainer = true; using (SplashFrm SC = new SplashFrm())// Show Splash Screen.. SC.ShowDialog(); using (LoginFrm FrmLogin = new LoginFrm())// Show Login Screen.. FrmLogin.ShowDialog(); RebuildForms(); if (File.Exists(MyCL.FileName)) UserLookAndFeel.Default.SetSkinStyle(LoadSettings(MyCL.FileName).SkinName); LoadCReports();// Load Struc CReports Into LUE; //EnableMenuItem(); }
private void btn_connection_Click(object sender, EventArgs e) { LoginFrm frm; if (this.ip == null || this.userName == null || this.pw == null) { frm = new LoginFrm(false); } else { frm = new LoginFrm(true, this.ip, this.userName, this.pw); } frm.StartPosition = FormStartPosition.CenterParent; frm.SSHConnected += AddUser; frm.ShowDialog(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); LoginFrm _LoginFrm = new LoginFrm(); _LoginFrm.ShowDialog(); if (_LoginFrm.DialogResult == DialogResult.OK) { BienvenidoFrm bienvenido = new BienvenidoFrm(); bienvenido.ShowDialog(); if (bienvenido.DialogResult == DialogResult.OK) { Application.Run(new PrincipalFrm()); } } }
private void LogOn(LoginFrm loginFrm) { try { string sqlStr = $"SELECT vchar_user FROM tb_SFIuser WHERE vchar_user='******'"; string user = SQLHelper.GetStringFromDB <string>(sqlStr); if (string.IsNullOrWhiteSpace(user)) { MessageBoxService.ShowMessage($"用户名错误", "提示信息", MessageButton.OK, MessageIcon.Information); } else { MainFrm.CurrentUser = user; loginFrm.DialogResult = System.Windows.Forms.DialogResult.OK; } } catch (Exception ex) { MessageBoxService.ShowMessage($"登录失败:{ex.Message}", "提示信息", MessageButton.OK, MessageIcon.Error); } }
public void handleOk(LoginFrm form) { LoginStatus status = ls.login(Username, Password); switch (status) { case LoginStatus.Success: form.Hide(); IninConfig(); MainFrm mf = new MainFrm(); mf.FormClosed += (s, e) => { form.Close(); }; mf.Show(); Usernames.Add(Username); Usernames = Usernames.Distinct <string>().ToList(); WriteUsername(); break; case LoginStatus.UsernameErr: XtraMessageBox.Show("用户名错误,请重新输入", "信息提示"); form.SelectAll("teUsername"); break; case LoginStatus.PasswordErr: XtraMessageBox.Show("密码错误,请重新输入", "信息提示"); form.SelectAll("tePsw"); break; case LoginStatus.ConnectionErr: XtraMessageBox.Show("不能连接数据库,请查看原因", "信息提示"); break; default: break; } }
private void button1_Click(object sender, EventArgs e) { if (!textBoxOldPwd.Text.Equals(Parameter.user.Password)) { MessageBox.Show("原密码输入错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxOldPwd.Text = ""; return; } if (!textBoxNewPwd.Text.Equals(textBoxConfirmPwd.Text)) { MessageBox.Show("新密码两次输入不一致!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); textBoxNewPwd.Text = ""; textBoxConfirmPwd.Text = ""; return; } Parameter.user.Password = textBoxConfirmPwd.Text; MessageLocal msg = userDao.updatePwd(Parameter.user); if (!msg.IsSucess) { MessageBox.Show(msg.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); Parameter.user = null; LoginFrm loginFrm = new LoginFrm(); loginFrm.setIsOpenMain(false); loginFrm.ShowDialog(); if (null == Parameter.user) { this.Close(); return; } } // 重新加载用户权限 this.Close(); }
public virtual void Login(LoginFrm loginFrm) { LogOn(loginFrm); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);//捕获系统所产生的异常。 Application.ApplicationExit += new EventHandler(Application_ApplicationExit); SplashScreenManager.ShowForm(typeof(YIESplashScreen)); YIESplashScreen.SendSplashScreenManager("读取用户配置..."); Program.CheckInstance(); //单个实例程序运行 SystemConfig.ReadSettings(); //读取用户配置 //账套服务器数据连接测试 YIESplashScreen.SendSplashScreenManager("测试数据库连接..."); if (!BridgeDataBase.InitializeBridge()) { Application.Exit(); OpenConnTools.OpenTools(); return; } YIESplashScreen.SendSplashScreenManager("注册控件和汉化信息..."); //注册皮肤 #region 注册皮肤 DevExpress.UserSkins.BonusSkins.Register(); DevExpress.Skins.SkinManager.EnableFormSkins(); UserLookAndFeel.Default.SetSkinStyle(SystemConfig.CurrentConfig.SkinName); #endregion #region 控件汉化 System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-Hans"); System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-Hans"); #endregion //YIESplashScreen.SendSplashScreenManager("检查系统更新..."); //if(CheckVision.YIEMISVision()) //{ // //执行更新方法 // Application.Exit(); //} YIESplashScreen.SendSplashScreenManager("系统登录信息"); //系统登录 //if( YIESetOfBooks.Login() ) if (LoginFrm.Login()) { //检查系统时间,相差2分钟以上不允许登录 //if (!CheckServerDate()) Application.Exit(); Program.YIEMainForm = new YIEMain(); //窗口初始化 Program.YIEMainForm.InitUserInterface(); Program.YIEMainForm.Show(); Application.Run(Program.YIEMainForm); } else//登录失败,退出程序 { Application.Exit(); } }
private void MainFrm_Load(object sender, EventArgs e) { //Load Reports from file and create its item in the interface LoadSQLReports(); //Load Skins and layout DevExpress.XtraBars.Helpers.SkinHelper.InitSkinGallery(galleryControlSkins, true); UserLookAndFeel.Default.StyleChanged += Default_StyleChanged; if (System.IO.File.Exists(FXFW.SqlDB.StyleSettingsPath)) UserLookAndFeel.Default.SetSkinStyle(LoadSettings(FXFW.SqlDB.StyleSettingsPath).SkinName); if (System.IO.File.Exists(FXFW.SqlDB.duckSettingsPath)) dockManagerMain.RestoreLayoutFromXml(FXFW.SqlDB.duckSettingsPath); // Show Splash Screen.. using (SplashFrm SC = new SplashFrm()) SC.ShowDialog(); // Show Login Screen.. using (LoginFrm FrmLogin = new LoginFrm()) { // Create Administrator user if not exists b4 show login form RoleDetialFrm role = new RoleDetialFrm(); role.PrepareAdminRole(); role.Dispose(); FrmLogin.ShowDialog(); } //must choose asase_code to enable the application //Load CD_Asase LoadAsase(); LoadUserPriv(FXFW.SqlDB.UserInfo.UserID); }