Skip to content

Commit

Permalink
Sistema de Salvar Login
Browse files Browse the repository at this point in the history
Salvar login
  • Loading branch information
CristianoRC committed Jun 26, 2016
1 parent 44d4a80 commit b7bd99c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
10 changes: 10 additions & 0 deletions Controller/Outros/Ferramentas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public static void SalvarUltimoLogin(string Login)
{
GeraraLog(ex);
}
finally
{
if (sw != null)
sw.Close ();
}
}

public static string RecuperarUltimoLogin()
Expand All @@ -47,6 +52,11 @@ public static string RecuperarUltimoLogin()
{
GeraraLog(ex);
}
finally
{
if (sr != null)
sr.Close ();
}

return saida;
}
Expand Down
5 changes: 3 additions & 2 deletions Software Ordem de servico.userprefs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Properties StartupItem="Model/Model.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release" />
<MonoDevelop.Ide.Workbench ActiveDocument="View/Opcoes/Frm_OpicoesInicial.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="View/Outros/Frm_Login.cs">
<Files>
<File FileName="View/Opcoes/Frm_OpicoesInicial.cs" Line="26" Column="66" />
<File FileName="View/Outros/Frm_Login.cs" Line="26" Column="6" />
<File FileName="Controller/Outros/Ferramentas.cs" Line="15" Column="53" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
Expand Down
8 changes: 4 additions & 4 deletions View/Outros/Frm_Login.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ public partial class Frm_Login : Form
public Frm_Login()
{
InitializeComponent();

Txt_Login.Text = Ferramentas.RecuperarUltimoLogin ();
}

private void logar()
Expand All @@ -25,10 +23,10 @@ private void logar()

if (UsuarioBase.Senha == Txt_Senha.Text.TrimEnd())
{
Frm_Pai Pai = new Frm_Pai(UsuarioBase.Nome, UsuarioBase.NivelAcesso);

Ferramentas.SalvarUltimoLogin (Txt_Login.Text);

Frm_Pai Pai = new Frm_Pai(UsuarioBase.Nome, UsuarioBase.NivelAcesso);

this.Visible = false;

Pai.Show();
Expand Down Expand Up @@ -92,6 +90,8 @@ Na hora de salvar se já existir um logo antigo ele ira salvar com o nome de log
//Carregando o logo da empresa para o PictureBox
pictureBox1.ImageLocation = "Logo.png";
}

Txt_Login.Text = Ferramentas.RecuperarUltimoLogin ();
}

private void Txt_Senha_KeyPress(object sender, KeyPressEventArgs e)
Expand Down

0 comments on commit b7bd99c

Please sign in to comment.