Esempio n. 1
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            bool chkvip     = XmlLoader.CheckIfVipCustomerExist(UserNameTextBox.Text, PassWordTextBox.Text);
            bool chkmng     = (UserNameTextBox.Text.ToString() == "admin") && (PassWordTextBox.Text == "admin")? true : false;
            bool chktypemng = XmlLoader.CheckIfManagerType(UserNameTextBox.Text);

            if (UserNameTextBox.Text != "" && PassWordTextBox.Text != "" && chkvip == true && chktypemng == false)
            {
                if (UserNameTextBox.Text != "Enter User Name Here" && PassWordTextBox.Text != "Enter Pass Word Here")
                {
                    VipLoginPanel.Visible                 = true;
                    UserNameTextBox.ForeColor             = Color.Gray;
                    UserNameTextBox.Text                  = "Enter User Name Here";
                    PassWordTextBox.UseSystemPasswordChar = false;
                    PassWordTextBox.ForeColor             = Color.Gray;
                    PassWordTextBox.Text                  = "Enter Pass Word Here";
                }
                else
                {
                    InvalidTextPanel.Visible = true;
                }
            }
            else if (UserNameTextBox.Text != "" && PassWordTextBox.Text != "" && chkmng == true && chktypemng == true)
            {
                MangerLoginPanel.Visible              = true;
                UserNameTextBox.ForeColor             = Color.Gray;
                UserNameTextBox.Text                  = "Enter User Name Here";
                PassWordTextBox.UseSystemPasswordChar = false;
                PassWordTextBox.ForeColor             = Color.Gray;
                PassWordTextBox.Text                  = "Enter Pass Word Here";
            }
            else
            {
                InvalidTextPanel.Visible = true;
            }
        }