Beispiel #1
0
 public Managerui(string incPin)
 {
     ATMManager atmm = new ATMManager();
     _Pin = incPin;
     _atmm = atmm ;
     atmm.ReadAccounts();
     InitializeComponent();
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string path = @"c:\Customers.txt";

                StreamReader sr = new StreamReader(path);
                {
                    string str = sr.ReadLine();

                    while (str != null)
                    {
                        string[] password = str.Split(',');

                        _userName = password[0];
                        _loginPin = password[1];

                        //if (_userName == "Admin" && _loginPin == "Admin")
                        //{
                        //    ATMManager atmm = new ATMManager();
                        //    atmm.ReadAccounts();

                        //    AdminForm ad = new AdminForm(atmm);
                        //    ad.Show();

                        //}

                        if (_loginPin == PassWordtextBox.Text && _userName == UserNametextBox.Text)
                        {

                            if (_userName == "Admin" && _loginPin == "Admin")
                            {
                                ATMManager atmm = new ATMManager();
                                atmm.ReadAccounts();

                                AdminForm ad = new AdminForm(atmm);
                                ad.Show();
                                this.Hide();
                            }

                            else
                            {
                                Managerui mui = new Managerui(_loginPin);
                                mui.Show();
                                this.Hide();
                            }

                        }
                        str = sr.ReadLine();
                    }
                    sr.Close();
                }
        }