Esempio n. 1
0
        private bool checkFormInputs()
        {
            if (!inputHandler.checkNames(FirstNameBox.Text))
            {
                return(false);
            }

            if (!inputHandler.checkNames(LastNameBox.Text))
            {
                return(false);
            }

            try {
                PossitionBox.SelectedItem.ToString();
            }
            catch (Exception e)
            {
                MessageBox.Show("Need to select a possition");
                return(false);
            }

            if (!inputHandler.checkSIN(SINBox.Text))
            {
                return(false);
            }

            try
            {
                ContactInformation userInfo    = new ContactInformation(null, PhoneBox.Text);
                UserName           user        = new UserName(FirstNameBox.Text, LastNameBox.Text);
                Address            userAddress = new Address(SuiteBox.Text, StreetBox.Text, HouseBox.Text, CityBox.Text, ProvinceBox.Text, PostalBox.Text);
                Employee           newEmployee = new Employee(user, userAddress, userInfo, float.Parse(WageBox.Text, CultureInfo.InvariantCulture.NumberFormat), DateTime.Now, SINBox.Text, Employee.Position.Employee);
            }
            catch (Exception ex)
            {
                inputHandler.HandleException(ex);
                return(false);
            }

            return(true);
        }