예제 #1
0
        public void login(object o)
        {
            Customer cus = new Customer();

            cus.UserName = this.UserName;
            cus.Password = this.Password;
            cusList      = cs.readDataBase(cus);
            bool result = false;

            for (int i = 0; i < cusList.Count; i++)
            {
                if (string.Equals(cusList[i].UserName, this.UserName) && string.Equals(cusList[i].Password, this.Password))
                {
                    result = true;
                }
                else
                {
                    result = false;
                }
            }

            if (result)
            {
                CustomerCart cc = new CustomerCart();
                cc.ShowDialog();
            }
            else
            {
                MessageBox.Show("Login Denied");
            }
        }
예제 #2
0
        public void signUp(object o)
        {
            Customer cus = new Customer();

            cus.UserName = this.UserName1;
            cus.Password = this.Password1;

            cs.addData(cus);
            CustomerCart cc = new CustomerCart();

            cc.ShowDialog();
        }