Пример #1
0
        public Form1()
        {
            InitializeComponent();
            JobSeekerService.RegisterJobSeeker(new JobSeeker("LEONIT", "kULETA", null, "123456", 46, "Leonit", "MALE"));

            MessageBox.Show(JobSeekerService.DoesThisNameExist("LEONIT").ToString());
        }
Пример #2
0
        private void btnRegisterJobSeeker_Click(object sender, EventArgs e)
        {
            if (JobSeekerService.DoesThisNameExist(txtFirstName.Text) || BusinessService.DoesThisNameExist(txtFirstName.Text))
            {
                MessageBox.Show("This Name is already taken.", "Warning");
            }
            else
            {
                string gender = "asd";
                if (rdbMale.Checked)
                {
                    gender = "Male";
                }
                else
                {
                    gender = "Female";
                }
                var jobSeeker = new JobSeeker(gender, txtLastName.Text, cmbCities.SelectedItem.ToString(), txtFirstName.Text, Convert.ToInt32(txtAge.Text), txtUserName.Text, txtPasswordJobSeeker.Text);
                JobSeekerService.RegisterJobSeeker(jobSeeker);
                LoggedData.LoggedJobSeeker = jobSeeker;

                HomeJobSeeker h1 = new HomeJobSeeker();
                //     this.Close();
                h1.Show();
            }
        }
Пример #3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            // LoggedData.LoggedJobSeeker = null;

            bool Exists = JobSeekerService.DoesThisNameExist(txtUsername.Text);

            if (Exists)
            {
                //MessageBox.Show("Go to joobSeker web");

                //Initialzing object
                var user = JobSeekerService.GetByUsername(txtUsername.Text);
                LoggedData.LoggedJobSeeker.Username = txtUsername.Text;
                LoggedData.LoggedJobSeeker.Name     = user.Name;
                LoggedData.LoggedJobSeeker.Password = user.Password;
                LoggedData.LoggedJobSeeker.LastName = user.LastName;
                LoggedData.LoggedJobSeeker.Id       = user.Id;


                this.Close();
                HomeJobSeeker h = new HomeJobSeeker();
                h.Show();
            }
            else if (BusinessService.DoesThisNameExist(txtUsername.Text))
            {
                LoggedData.LoggedBusiness.Username = txtUsername.Text;
                Home h1 = new Home();
                h1.Show();
            }
        }
Пример #4
0
        private void btnRegisterBusiness_Click(object sender, EventArgs e)
        {
            if (BusinessService.DoesThisNameExist(txtBusinessName.Text) || JobSeekerService.DoesThisNameExist(txtBusinessName.Text))
            {
                MessageBox.Show("This Name is already taken.", "Warning");
            }
            else
            {
                var business = new Business(new BusinessType(cmbCategory.SelectedItem.ToString()),
                                            new Category(cmbTypeBusiness.SelectedItem.ToString()),
                                            txtBusinessName.Text, txtUsername.Text,
                                            txtBusinessPassword.Text);

                LoggedData.LoggedBusiness = business;

                BusinessService.RegisterBusiness(business);
                Home h1 = new Home();

                //   MessageBox.Show(LoggedData.LoggedBusiness.Name);
                // this.Close();
                h1.Show();
            }
        }