Exemple #1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            this.Hide();
            home f1 = new home();

            f1.Show();
        }
Exemple #2
0
        private void btnAcceptProposal_Click(object sender, EventArgs e)
        {
            foreach (string item in checkedListProposedM.CheckedItems)
            {
                string[] splitter = item.Split('-');
                ObjectManipulation.UserCollection.listOfUsers[ObjectManipulation.CurrentUserIndex].acceptSheduledMeeting(splitter[0]);
                ObjectManipulation.JSON_Serialized(ObjectManipulation.UserCollection);
            }
            this.Close();
            home f1 = new home();

            f1.Show();
        }
Exemple #3
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            if (ObjectManipulation.UserCollection != null)  // is textbox empty?
            {
                loginErrorLabel.Text = "";
                String searchName       = username.Text; // username check variable
                String searchPW         = password.Text; // password check variable
                int    counter          = 0;
                bool   leavingCondition = true;

                int listLength = ObjectManipulation.UserCollection.listOfUsers.Count(); // finds the length of users list (currently 6)


                while (leavingCondition)
                {
                    if (listLength == counter)
                    {
                        loginErrorLabel.Text = "login failed";
                        leavingCondition     = false;
                    }
                    else if (ObjectManipulation.UserCollection.listOfUsers[counter].userName == searchName)
                    {
                        if (ObjectManipulation.UserCollection.listOfUsers[counter].Password == searchPW)
                        {
                            ObjectManipulation.CurrentUserIndex = counter;
                            this.Hide();
                            home f1 = new home();
                            f1.Show();
                            leavingCondition = false;
                        }
                        else
                        {
                            loginErrorLabel.Text = "password incorrect";
                            leavingCondition     = false;
                        }
                    }
                    else if (ObjectManipulation.UserCollection.listOfUsers[counter].userName != searchName)
                    {
                        leavingCondition = true;
                    }
                    counter++;
                }
            }
            else
            {
                loginErrorLabel.Text = "please create a user";
            }
        }