private void BtnGuestClick(object sender, EventArgs e) { try { if (DateTime.Now > Properties.Settings.Default.DateInstallation.AddDays(3)) { RadMessageBox.Show(Program.LanguageDefault.DictionaryLogin["msgGuestInvalid"], "Mensagem", MessageBoxButtons.OK); return; } RadMessageLocalizationProvider.CurrentProvider = new LocalizationProvider() { OkButton = "Continuar" }; DialogResult res = RadMessageBox.Show(Program.LanguageDefault.DictionaryLogin["msgGuestInfo"], "Mensagem", MessageBoxButtons.OKCancel); if (res == DialogResult.OK) { Cursor.Current = Cursors.WaitCursor; EnableFields(false); Program.LoginAuthentication = ListLoginAuthentication.Instance(Program.LanguageDefault).LoginOffline("guest", Utility.Cript("123456"), false); Program._applicationContext.MainForm = null; } RadMessageLocalizationProvider.CurrentProvider = new LocalizationProvider(); return; } catch (Exception ex) { RadMessageBox.Show(ex.Message, " "); EnableFields(true); LoadStatus(Program.LanguageDefault.DictionaryLogin["InsertLogin"]); } }
private void BtnOkClick(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; VerifyFields(); EnableFields(false); LoadStatus(Program.LanguageDefault.DictionaryLogin["ServerValidate"]); //if (cbxLembrar.Checked) // Thread.Sleep(1000); if (cbxOffline.Checked) { Program.LoginAuthentication = ListLoginAuthentication.Instance(Program.LanguageDefault).LoginOffline(txtLogin.Text.ToLower(), Utility.Cript(txtPassword.Text.ToLower()), cbxLembrar.Checked); } else { Program.LoginAuthentication = ListLoginAuthentication.Instance(Program.LanguageDefault).LoadLogin(txtLogin.Text.ToLower(), Utility.Cript(txtPassword.Text.ToLower()), cbxLembrar.Checked); } if (Program.LoginAuthentication != null) { Program.LoginAuthentication.Offline = cbxOffline.Checked; LoadStatus(Program.LanguageDefault.DictionaryLogin["ValidationSuccessful"]); ManagerWorkspace.Instance().LoadTheme(); //Thread.Sleep(1000); Program._applicationContext.MainForm = null; return; } RadMessageBox.Show(Program.LanguageDefault.DictionaryLogin["invalidLogin"], " "); EnableFields(true); LoadStatus(Program.LanguageDefault.DictionaryLogin["InsertLogin"]); } catch (Exception ex) { Cursor.Current = Cursors.Default; RadMessageBox.Show(ex.Message, " "); EnableFields(true); LoadStatus(Program.LanguageDefault.DictionaryLogin["InsertLogin"]); } }
private void VerifyLoginSaved() { try { Program.LoginAuthentication = ListLoginAuthentication.Instance(Program.LanguageDefault).LoginSaved(); if ((Program.LoginAuthentication == null) || (!Program.LoginAuthentication.Remember)) { return; } txtLogin.Text = Program.LoginAuthentication.Login.ToLower(); txtPassword.Text = Utility.Decript(Program.LoginAuthentication.Password); cbxLembrar.Checked = Program.LoginAuthentication.Remember; } catch (Exception ex) { RadMessageBox.Show("VerifyLoginSaved(): " + ex.Message, " "); } }