Пример #1
0
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            CandidateHome ch = new CandidateHome(user);

            this.Close();
            ch.Show();
        }
Пример #2
0
        private void LoginClick_Click(object sender, RoutedEventArgs e)
        {
            if (UserName.Text != "" && Password.Password.ToString() != "")
            {
                var res = (from r in dc.Users
                           where r.UserName == UserName.Text && r.Password == Password.Password.ToString()
                           select r).FirstOrDefault();

                User user = (User)res;

                if (user != null)
                {
                    if (user.UserType == "employer")
                    {
                        EmployerHome eh = new EmployerHome(user);

                        this.Close();
                        eh.Show();
                    }

                    else
                    {
                        CandidateHome ch = new CandidateHome(user);

                        this.Close();
                        ch.Show();
                    }
                }

                else
                {
                    MessageBox.Show("Incorrect username or password");
                }
            }

            else
            {
                if (UserName.Text == "" && Password.Password.ToString() == "")
                {
                    MessageBox.Show("Enter username and password");
                }

                else if (UserName.Text == "")
                {
                    MessageBox.Show("Enter username");
                }
                else
                {
                    MessageBox.Show("Enter Password");
                }
            }
        }
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            var res = (from u in dc.Users
                       where u.UserName == user.UserName
                       select u).FirstOrDefault();

            res.Gpa        = ((ComboBoxItem)Gpa.SelectedItem).HiddenValue;
            res.Experience = ((ComboBoxItem)Experience.SelectedItem).HiddenValue;
            res.Age        = ((ComboBoxItem)Age.SelectedItem).HiddenValue;

            dc.SubmitChanges();

            CandidateHome ch = new CandidateHome((User)res);

            this.Close();
            ch.Show();
        }
Пример #4
0
        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            if (user.UserType == "employer")
            {
                EmployerHome eh = new EmployerHome(user);

                this.Close();
                eh.Show();
            }

            else
            {
                CandidateHome eh = new CandidateHome(user);

                this.Close();
                eh.Show();
            }
        }
Пример #5
0
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            CandidateHome ch;
            EmployerHome  eh;

            if (user.UserType == "candidate")
            {
                ch = new CandidateHome(user);
                this.Close();
                ch.Show();
            }

            else
            {
                eh = new EmployerHome(user);
                this.Close();
                eh.Show();
            }
        }
Пример #6
0
        private void Send_Click(object sender, RoutedEventArgs e)
        {
            if (MessageBody.Text != "")
            {
                Message newMessage = new Message()
                {
                    Sender       = user.UserId,
                    Receiver     = reciever,
                    MessageTitle = MessageTitle.Text,
                    MessageBody  = MessageBody.Text,
                    MessageTime  = System.DateTime.Now
                };

                dc.Messages.InsertOnSubmit(newMessage);

                dc.SubmitChanges();

                if (user.UserType == "employer")
                {
                    EmployerHome eh = new EmployerHome(user);

                    this.Close();
                    eh.Show();
                }

                else
                {
                    CandidateHome eh = new CandidateHome(user);

                    this.Close();
                    eh.Show();
                }
            }

            else
            {
                MessageBox.Show("Message body can't be empty");
            }
        }