Torna al Thread

private string _log; public string Log { get { return _log; } set { _log = value; } } private string _pass; public string Pass { get { return _pass; } set { _pass = value; } } Pannello p = null; public event LoggaturaEventHandler Loggato; public Login() { p = new Pannello(); InitializeComponent(); } protected virtual void OnLoggato(LoggaturaEventArgs e) { LoggaturaEventHandler evLoggato = Loggato; if (evLoggato != null) { evLoggato(this, e); } } private void btnlogin_Click(object sender, EventArgs e) { this.Log = txtuser.Text.Trim(); this.Pass = txtpassword.Text.Trim(); if (this.Log.Trim() != "" && this.Pass.Trim() != "") { if (UtenteLoggato()) { this.Loggato += new LoggaturaEventHandler(p.Loggato); LoggaturaEventArgs arLoggato = new LoggaturaEventArgs(UtenteLoggato()); OnLoggato(arLoggato); this.Hide(); //p.Close(); } else { MessageBox.Show("Attenzione Login errata.Rirova", "Attenzione", MessageBoxButtons.OK); } } else { MessageBox.Show("Attenzione i Campi Login e Password sono Obbligatori!", "Attenzione", MessageBoxButtons.OK); } } private bool UtenteLoggato() { bool l = this.Log == "admin" && this.Pass == "admin" ? true : false; return l; }
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5