private void buscaFotoRep() { representante repr = Form1.repLogado; if (repr != null) { pictureBox2.Image = (Image)Resources.ResourceManager.GetObject(repr.foto); ArredondaImagem.arredondar(pictureBox2); } }
private void textBox1_Leave(object sender, EventArgs e) { if (!String.IsNullOrEmpty(textBox1.Text)) { representante repr = db.representante.Where(rep => rep.email.Equals(textBox1.Text)).FirstOrDefault(); if (repr != null) { pictureBox1.Image = (Image)Resources.ResourceManager.GetObject(repr.foto); } else { MessageBox.Show("Representante não encontrado!"); } } }
private void button1_Click(object sender, EventArgs e) { representante repr = db.representante.Where(rep => rep.email.Equals(textBox1.Text) && rep.senha.Equals(textBox2.Text)) .FirstOrDefault(); if (repr != null) { repLogado = repr; this.Dispose(false); new Splash().Show(); } else { MessageBox.Show("Login incorreto!"); } }