private void UpdateCinfo(object sender, EventArgs e)
        {
            if ((FirstnameTBE.Text != "") && (LastnameTB.Text != ""))
            {
                FirstnameTBE.Text = SpaceStripper(FirstnameTBE.Text);
                LastnameTB.Text   = SpaceStripper(LastnameTB.Text);
            }
            instant2 = EmployeePortal.ReadXML <Customer>(Custpath);
            int index = 0;

            foreach (Customer p in instant2)
            {
                if (FirstnameTBE.Text.ToUpper() == p.Firstname.ToUpper() && LastnameTB.Text.ToUpper() == p.Lastname.ToUpper())
                {
                    index = instant2.IndexOf(p); ok = true;
                }
            }
            if (ok)
            {
                CustomerInfo customerinfo = new CustomerInfo(FirstnameTBE.Text, LastnameTB.Text, true, index);
                customerinfo.ShowDialog();
            }
            else
            {
                MessageBox.Show("Customer is not in directory.");
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
            EmployeePortal empportal = new EmployeePortal();

            empportal.ShowDialog();
        }
Example #3
0
 private void button2_Click(object sender, EventArgs e)
 {
     People = Admin.ReadXML <Manager>(path);
     for (int i = 0; i < People.Count; i++)
     {
         if (usernameAdminTB.Text.ToUpper() == People.ElementAt(i).username.ToUpper())
         {
             valid1 = true;
         }
         if (passwordAdminTB.Text.ToUpper() == People.ElementAt(i).password.ToUpper())
         {
             valid2 = true;
         }
         if (valid1 && valid2)
         {
             i = People.Count;
             EmployeePortal managerportal = new EmployeePortal(manage1);
             managerportal.Name = "Manager Portal";
             managerportal.ShowDialog();
             this.Close();
         }
     }
     if (!(valid1))
     {
         adminLoginError.Text = "***Unrecognizable username***";
     }
     else
     {
         adminLoginError.Text = ""; valid1 = false;
     }
     if (!(valid2))
     {
         adminLoginError.Text += "**invalid password***";
     }
     else
     {
         adminLoginError.Text += ""; valid2 = false;
     }
 }
Example #4
0
 private void button2_Click(object sender, EventArgs e)
 {
     instant = EmployeeForm.ReadXML <Employee>(userpath);
     for (int i = 0; i < instant.Count; i++)
     {
         if (usernameUserTB.Text.ToUpper() == instant.ElementAt(i).username.ToUpper())
         {
             valid1 = true;
         }
         if (passwordUserTB.Text.ToUpper() == instant.ElementAt(i).password.ToUpper())
         {
             valid2 = true;
         }
         if (valid1 && valid2)
         {
             i = instant.Count;
             EmployeePortal employeeportal = new EmployeePortal();
             employeeportal.ShowDialog();
             this.Close();
         }
     }
     if (!(valid1))
     {
         userLoginError.Text = "***Unrecognizable username***";
     }
     else
     {
         userLoginError.Text = ""; valid1 = false;
     }
     if (!(valid2))
     {
         userLoginError.Text += "**invalid password***";
     }
     else
     {
         userLoginError.Text += ""; valid2 = false;
     }
 }
        private void SellTickets_Click(object sender, EventArgs e)
        {
            //FirstnameTBE.Text = SpaceStripper(FirstnameTBE.Text);
            //LastnameTB.Text = SpaceStripper(LastnameTB.Text);
            instant2 = EmployeePortal.ReadXML <Customer>(Custpath);
            int index = 0;

            foreach (Customer p in instant2)
            {
                if (FirstnameTBE.Text.ToUpper() == p.Firstname.ToUpper() && LastnameTB.Text.ToUpper() == p.Lastname.ToUpper())
                {
                    index = instant2.IndexOf(p); ok = true; viewer = p;
                }
            }
            if (ok)
            {
                EmployeeSellTickets employeeselltickets = new EmployeeSellTickets(false, false, false, viewer);
                employeeselltickets.ShowDialog();
                ok = false;
            }
            else
            {
                if (FirstnameTBE.Text == "")
                {
                    MessageBox.Show("Please fill in customer Firstname");
                }
                else if (LastnameTB.Text == "")
                {
                    MessageBox.Show("Please fill in customer Lastname");
                }
                else
                {
                    MessageBox.Show("Customer is not in directory.");
                }
            }
        }