示例#1
0
        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();
                }
            }
        }
示例#2
0
 private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
 {
     currentUser  = null;
     currentAdmin = null;
     ProductPage.Hide();
     CommandPage.Hide();
     AdminPage.Hide();
     LoginPage.Show();
 }
示例#3
0
 public Form()
 {
     InitializeComponent();
     ReadFromFile(0);// Citire Tot din Fisiere
     CommandPage.Hide();
     ProductPage.Hide();
     registerPanel.Hide();
     AdminPage.Hide();
 }