Пример #1
0
        private void WelcomeEnter_Click(object sender, RoutedEventArgs e)
        {
            LoginRegister lr = new LoginRegister(this);

            lr.Show();
            this.Hide();
        }
        private void UserLogout_Click(object sender, RoutedEventArgs e)
        {
            Collections.clearInstance();
            User.clearInstance();
            LoginRegistrationControl.clearInstance();
            DBReadWrite.clearInstance();
            LoginRegister lr = new LoginRegister();

            lr.Show();
            p.Close();
        }
Пример #3
0
        private void RecRegProceed_Click(object sender, RoutedEventArgs e)
        {
            if (iehp.isValidEmail(emailBox.Text) && iehp.isPhoneNumber(phoneBox.Text))
            {
                if (checkEmployerPresent.IsChecked == false)
                {
                    if (fromEdit)
                    {
                        UpdateFields();
                        profile.Close();
                        Profile rp = new Profile(currentUser);
                        rp.Show();
                        this.Close();
                    }

                    else
                    {
                        if (CompanyListComboBox.SelectedItem == null)
                        {
                            MessageBox.Show("Select a company or Add a new one");
                        }
                        else
                        {
                            currentUser.addUser(firstnameBox.Text, lastnameBox.Text, emailBox.Text, phoneBox.Text, photo, jobposBox.Text, CompanyListComboBox.SelectedItem.ToString());
                            lrControl.register(currentUser);
                            LoginRegister lr = new LoginRegister();
                            //Profile p = new Profile(currentUser);
                            lr.Show();
                            this.Hide();
                        }
                    }
                }
                else
                {
                    currentUser.addUser(firstnameBox.Text, lastnameBox.Text, emailBox.Text, phoneBox.Text, photo, jobposBox.Text);
                    EmployerRegistration er = new EmployerRegistration(currentUser, this);

                    er.Show();
                    this.Hide();
                }
            }
            else if (!iehp.isValidEmail(emailBox.Text) && !iehp.isPhoneNumber(phoneBox.Text))
            {
                MessageBox.Show("Provide valid Email & Phone Number!");
            }
            else if (!iehp.isValidEmail(emailBox.Text))
            {
                MessageBox.Show("Provide a valid Email address!");
            }
            else if (!iehp.isPhoneNumber(phoneBox.Text))
            {
                MessageBox.Show("Provide a valid Phone Number!");
            }
        }
 private void EmpRegProceed_Click(object sender, RoutedEventArgs e)
 {
     if (iehp.isValidEmail(emailBox.Text) && iehp.isPhoneNumber(phoneBox.Text) && iehp.isUrl(websiteBox.Text))
     {
         Company company = new Company(nameBox.Text, addressbox.Text, countryBox.Text, phoneBox.Text, emailBox.Text, websiteBox.Text, Convert.ToByte(btypeSlider.Value));
         lrControl.register(company);
         currentUser.CompanyId   = lrControl.getCompanyId(company.Name);
         currentUser.CompanyName = company.Name;
         lrControl.register(currentUser);
         LoginRegister lr = new LoginRegister();
         lr.Show();
         this.Hide();
     }
     else if (!iehp.isValidEmail(emailBox.Text) && !iehp.isPhoneNumber(phoneBox.Text) && !iehp.isUrl(websiteBox.Text))
     {
         MessageBox.Show("Provide valid Information!");
     }
     else if (!iehp.isValidEmail(emailBox.Text) && !iehp.isUrl(websiteBox.Text))
     {
         MessageBox.Show("Provide valid Email & Web Address!");
     }
     else if (!iehp.isUrl(websiteBox.Text) && !iehp.isPhoneNumber(phoneBox.Text))
     {
         MessageBox.Show("Provide valid Web Address & Phone Number!");
     }
     else if (!iehp.isValidEmail(emailBox.Text) && !iehp.isPhoneNumber(phoneBox.Text))
     {
         MessageBox.Show("Provide valid Email & Phone Number!");
     }
     else if (!iehp.isValidEmail(emailBox.Text))
     {
         MessageBox.Show("Provide a valid Email address!");
     }
     else if (!iehp.isPhoneNumber(phoneBox.Text))
     {
         MessageBox.Show("Provide a valid Phone Number!");
     }
     else if (!iehp.isUrl(websiteBox.Text))
     {
         MessageBox.Show("Provide a valid Web Address!");
     }
 }
        private void JSRegProceed_Click(object sender, RoutedEventArgs e)
        {
            if (iehp.isValidEmail(emailBox.Text) && iehp.isPhoneNumber(phoneBox.Text))
            {
                DateTime date = Convert.ToDateTime(birthdayPicker.SelectedDate);

                foreach (Button skillButton in slctskillsPanel.Children)
                {
                    skillList.Add(skillButton.Content.ToString());
                }
                if (fromEdit == true)
                {
                    updateFields();
                    profile.Close();
                    Profile jp = new Profile(currentUser);
                    jp.Show();
                }
                else
                {
                    currentUser.addUser(firstnameBox.Text, lastnameBox.Text, emailBox.Text, phoneBox.Text, photo, date, locationBox.Text, skillList);
                    lrControl.register(currentUser);
                    LoginRegister lr = new LoginRegister();
                    lr.Show();
                }

                this.Close();
            }
            else if (!iehp.isValidEmail(emailBox.Text) && !iehp.isPhoneNumber(phoneBox.Text))
            {
                MessageBox.Show("Provide valid Email & Phone Number!");
            }
            else if (!iehp.isValidEmail(emailBox.Text))
            {
                MessageBox.Show("Provide a valid Email address!");
            }
            else if (!iehp.isPhoneNumber(phoneBox.Text))
            {
                MessageBox.Show("Provide a valid Phone Number!");
            }
        }
 public ChooseProfile(LoginRegister lr)
 {
     InitializeComponent();
     lrWindow = lr;
 }