Beispiel #1
0
        public IAACA(AdminWindow f, Admin admin)
        {
            InitializeComponent();
            this.admin = admin;

            listBox1.SelectedIndexChanged -= listBox1_SelectedIndexChanged;
            listBox1.DataSource            = admin.CarManager.CarList;
            listBox1.ValueMember           = "Model";

            listBox1.SelectedIndexChanged += listBox1_SelectedIndexChanged;
        }
Beispiel #2
0
        public IAFC(AdminWindow f, CarManager cm)
        {
            InitializeComponent();
            this.cm = cm;

            listBox1.SelectedIndexChanged -= listBox1_SelectedIndexChanged;
            listBox1.DataSource            = cm.CarList;
            listBox1.ValueMember           = "Model";

            listBox1.SelectedIndexChanged += listBox1_SelectedIndexChanged;
        }
Beispiel #3
0
        public AllAccounts(AdminWindow f, Admin admin)
        {
            InitializeComponent();
            this.admin = admin;

            listBox1.SelectedIndexChanged -= listBox1_SelectedIndexChanged;
            listBox1.DataSource            = admin.AccManager.AccountList;
            listBox1.ValueMember           = "Login";

            listBox1.SelectedIndexChanged += listBox1_SelectedIndexChanged;
        }
Beispiel #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     Account.Account account = accManager.findAccount(maskedTextBox1.Text);
     if (account == null)
     {
         label3.Text = "There is no account with such login!";
         maskedTextBox1.Clear();
         maskedTextBox2.Clear();
         return;
     }
     if (account.Password.Equals(maskedTextBox2.Text))
     {
         if (account as Account.User != null)
         {
             Account.User user = account as Account.User;
             Form3        nF   = new Form3(this, user);
             this.Visible = false;
             nF.ShowDialog();
             this.Dispose();
         }
         if (account as Account.Admin != null)
         {
             Account.Admin admin = account as Account.Admin;
             admin.AccManager = accManager;
             AdminWindow nF = new AdminWindow(this, admin);
             this.Visible = false;
             nF.ShowDialog();
             this.Dispose();
         }
         accManager.SaveInformation();
     }
     else
     {
         label3.Text = "Incorrect password!";
         maskedTextBox1.Clear();
         maskedTextBox2.Clear();
     }
 }
Beispiel #5
0
 public AddCar(AdminWindow f, CarManager cm)
 {
     this.cm   = cm;
     cm.Added += Messenger;
     InitializeComponent();
 }
Beispiel #6
0
 public DelCar(AdminWindow f, Admin admin)
 {
     InitializeComponent();
     this.admin = admin;
     this.admin.CarManager.Removed += Messenger;
 }
Beispiel #7
0
 public AddAccounts(AdminWindow f, Admin admin)
 {
     InitializeComponent();
     this.admin = admin;
     this.admin.AccManager.Added += Messenger;
 }