예제 #1
0
        public CustomDialog(object formObj, string str)
        {
            InitializeComponent();

            parentForm = formObj as MainFormAdmin;
            preValue   = str;
        }
예제 #2
0
        private void Enter_button_Click(object sender, EventArgs e)
        {
            bool correct = false;

            foreach (User user in UserArray)
            {
                if (user.Login == Login_textBox.Text && user.Password == Password_textBox.Text)
                {
                    Hide();
                    if (user.Login == "admin")
                    {
                        MainFormAdmin form = new MainFormAdmin(this);
                        form.Show();
                    }
                    else
                    {
                        MainForm form = new MainForm(this);
                        form.Show();
                    }

                    correct = true;
                    Login_textBox.Clear();
                    Password_textBox.Clear();

                    break;
                }
            }

            if (!correct)
            {
                MessageBox.Show(@"Login and password doesn't match.");
                Password_textBox.Clear();
            }
        }