Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

using using using using using using using using

System; System.Collections.Generic; System.Linq; System.Web; System.Web.UI; System.Web.UI.WebControls; VetMobil.core; System.Data;

public partial class Default : System.Web.UI.Page { public string Login { get { return txtLogin.Value.Trim(); } } public string Senha { get { return txtSenha.Value.Trim(); } } protected void Page_Load(object sender, EventArgs e) { } private bool ValidarFormulario() { bool erro = string.IsNullOrEmpty(this.Senha) s.Login);

string.IsNullOrEmpty(thi

if (erro) spanMensagemLogin.InnerText = "Todos os campos so necessrios."; return !erro; } protected void btEntrar_Click(object sender, EventArgs e) { if (!this.ValidarFormulario()) return; Autenticacao autentico = new Autenticacao(); if (autentico.Login(this.Login, this.Senha)) { autentico.Redirect(); } else { spanMensagemLogin.InnerText = "Usurio e/ou senha invlidos."; } } protected void btRegistar_Click(object sender, EventArgs e) { HttpContext.Current.Response.Redirect("~/Registo.aspx"); } }

You might also like