Example #1
0
        private void BtnRegister_Click(object sender, EventArgs e)
        {
            custNameStatus.Text     = "";
            custEmailStatus.Text    = "";
            custCityStatus.Text     = "";
            custGenderStatus.Text   = "";
            custPasswordStatus.Text = "";

            string custName   = txtCustomerName.Text;
            string custEmail  = txtCustomerEmail.Text;
            string custCity   = txtCity.Text;
            string custGender = "";

            if (radioMale.Checked)
            {
                custGender = "male";
            }
            else
            {
                custGender = "female";
            }
            string custPassword = txtPassword.Text;

            bool res = checkForm(custName, custEmail, custCity, custGender, custPassword);

            if (res)
            {
                StoreClass.addCustomer(custName, custEmail, custCity, custGender, custPassword);
                MessageBox.Show("Customer Added Successfully");
                this.Close();
            }
        }
Example #2
0
        private void Login_Click(object sender, EventArgs e)
        {
            loginIDStatus.Text  = "";
            passwordStatus.Text = "";

            String username = txtLoginID.Text;
            string password = txtPassword.Text;

            bool res = checkForm(username, password);

            if (res)
            {
                bool check = StoreClass.checkCred(username, password);
                if (check)
                {
                    Frm_Home hm = new Frm_Home();
                    hm.Show();
                    this.Close();
                }
            }
        }