private void btn_login_Click(object sender, EventArgs e) { verifica_acesso VA = new verifica_acesso(); Boolean troca_senha = false; try { if (VA.pesquisa_BD(txt_user.Text.ToString(), txt_pass.Text.ToString(), out troca_senha, out reg_user)) { if (troca_senha) { MessageBox.Show("Acesso Liberado : Você deve atualizar sua senha o mais breve possivel . \n \nPor mediadas de segurança não é aconselhavel usar a mesma senha por mais de 90 dias", "Acesso Liberado", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); frm_alterarsenha frm_alterarsenha = new frm_alterarsenha(reg_user); frm_alterarsenha.Show(); } if (reg_user.STATUS == "SENHA INICIAL") { MessageBox.Show("Senha Inicial . \n \nVoce deve trocar a senha AGORA", "Acesso Liberado", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); frm_alterarsenha frm_alterarsenha = new frm_alterarsenha(reg_user); frm_alterarsenha.Show(); } if (reg_user.STATUS == "bloqueado ") { MessageBox.Show("Acesso Valido porem seu perfil encontrase Bloqueado", "Acesso Valido", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { ativa_perfil(int.Parse(reg_user.PERFIL)); } gb_login.Visible = false; } } catch (System.ArgumentException ex) { MessageBox.Show(ex.Message, "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (System.AccessViolationException ex) { MessageBox.Show(ex.Message, "Erro Grave", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void lk_alterarSenha_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { reg_tmp.ID = txt_ID.Text; reg_tmp.NOME = txt_nome.Text; reg_tmp.DATA_ATUALIZACAO = DateTime.Parse(txt_data.Text); switch (txt_perfil.Text) { case "Administrador": reg_tmp.PERFIL = "1"; break; case "Gerente": reg_tmp.PERFIL = "2"; break; case "Operador": reg_tmp.PERFIL = "3"; break; case "Estagiario": reg_tmp.PERFIL = "4"; break; } reg_tmp.RG = txt_rg.Text; reg_tmp.SENHA = txt_senha.Text; reg_tmp.STATUS = txt_status.Text; Console.WriteLine(reg_tmp.ToString()); Console.WriteLine("---------- GRAVAR------------"); Console.WriteLine("ID:" + reg_tmp.ID); Console.WriteLine("SENHA:" + reg_tmp.SENHA); Console.WriteLine("DATA_ATUALIZACAO:" + reg_tmp.DATA_ATUALIZACAO); Console.WriteLine("NOME:" + reg_tmp.NOME); Console.WriteLine("RG:" + reg_tmp.RG); Console.WriteLine("STATUS:" + reg_tmp.STATUS); Console.WriteLine("PERFIL:" + reg_tmp.PERFIL); Console.WriteLine("-----------------------------"); frm_alterarsenha frm_alterarsenha = new frm_alterarsenha(reg_tmp); frm_alterarsenha.Show(); }