private void Login_Click(object sender, EventArgs e) { ReadFromFile(3); ReadFromFile(4); string username = lUsername.Text; string password = lPassword.Text; foreach (var item in Utilizatori) { if (item.Username == username && item.Password == password) { currentUser = new Guest(item.Id, item.Nume, item.Prenume, item.Username, item.Password, item.Email, false); LoginPage.Hide(); CommandPage.Hide(); ProductPage.Show(); AdminPage.Hide(); } } foreach (var item in Administratori) { if (item.Username == username && item.Password == password) { currentAdmin = new Admin(item.Id, item.Nume, item.Prenume, item.Username, item.Password, item.Email, true); LoginPage.Hide(); CommandPage.Hide(); ProductPage.Hide(); AdminPage.Show(); } } }
private void logoutToolStripMenuItem_Click(object sender, EventArgs e) { currentUser = null; currentAdmin = null; ProductPage.Hide(); CommandPage.Hide(); AdminPage.Hide(); LoginPage.Show(); }
public Form() { InitializeComponent(); ReadFromFile(0);// Citire Tot din Fisiere CommandPage.Hide(); ProductPage.Hide(); registerPanel.Hide(); AdminPage.Hide(); }