Esempio n. 1
0
 public void ViewRecruiterInfo(Recruiter rec, MetroFramework.Controls.MetroLabel name, MetroFramework.Controls.MetroLabel number)
 {
     db.ViewRecruiterInfoToSeeker(rec, name, number);
 }
Esempio n. 2
0
        public Boolean ChangePasswordFor(Person obj, MetroTextBox oldPass, MetroTextBox newPass)
        {
            if (obj != null)
            {
                Login login;

                if (obj is Recruiter)
                {
                    Recruiter rec = (Recruiter)obj;

                    var v = from a in db.Logins
                            where a.uname == rec.Username && a.pass == oldPass.Text
                            select a;

                    if (v.Count() == 1)
                    {
                        login = v.First();

                        login.uname = rec.Username;
                        login.pass  = newPass.Text;

                        db.SubmitChanges();
                    }

                    return(true);
                }

                else if (obj is Seeker)
                {
                    Seeker seek = (Seeker)obj;

                    var v = from a in db.Logins
                            where a.uname == seek.Username && a.pass == oldPass.Text
                            select a;

                    if (v.Count() == 1)
                    {
                        login = v.First();

                        login.uname = seek.Username;
                        login.pass  = newPass.Text;

                        db.SubmitChanges();
                    }

                    return(true);
                }

                else if (obj is Admin)
                {
                    Admin admin = (Admin)obj;

                    var v = from a in db.Logins
                            where a.uname == admin.Username && a.pass == oldPass.Text
                            select a;

                    if (v.Count() == 1)
                    {
                        login = v.First();

                        login.uname = admin.Username;
                        login.pass  = newPass.Text;

                        db.SubmitChanges();
                    }

                    return(true);
                }
            }
            return(false);
        }
Esempio n. 3
0
        public Boolean SendMailTo(string to, string subject, string body, Person by)
        {
            if (body != null)
            {
                TabMail mail = new TabMail();

                if (by is Seeker)
                {
                    Seeker seek = (Seeker)by;

                    mail.Sender   = this.GetMailAddress(seek);
                    mail.Receiver = to;
                    mail.Subject  = subject;
                    mail.Body     = body;

                    db.TabMails.InsertOnSubmit(mail);
                    db.SubmitChanges();

                    return(true);
                }

                else if (by is Recruiter)
                {
                    Recruiter rec = (Recruiter)by;

                    mail.Sender   = this.GetMailAddress(rec);
                    mail.Receiver = to;
                    mail.Subject  = subject;
                    mail.Body     = body;

                    db.TabMails.InsertOnSubmit(mail);
                    db.SubmitChanges();

                    return(true);
                }

                else if (by is Admin)
                {
                    mail.Sender   = "admin@admin";
                    mail.Receiver = to;
                    mail.Subject  = subject;
                    mail.Body     = body;

                    db.TabMails.InsertOnSubmit(mail);
                    db.SubmitChanges();

                    return(true);
                }

                else
                {
                    return(false);
                }
            }


            else
            {
                return(false);
            }
        }
Esempio n. 4
0
        public Boolean InsertNew(Object any)
        {
            if (any is Recruiter)
            {
                Recruiter    obj = (Recruiter)any;
                TabRecruiter rec = new TabRecruiter();

                rec.fname        = obj.FirstName;
                rec.lname        = obj.LastName;
                rec.uname        = obj.Username;
                rec.mobile       = obj.MobileNumber;
                rec.email        = obj.EmailAddress;
                rec.address      = obj.Address;
                rec.designation  = obj.Designation;
                rec.organisation = obj.Organisation;
                rec.dob          = obj.DateOfBirth;
                rec.gender       = obj.Gender;

                db.TabRecruiters.InsertOnSubmit(rec);
                db.SubmitChanges();

                if (this.InserLogin(obj))
                {
                    return(true);
                }

                else
                {
                    return(false);
                }
            }

            else if (any is Seeker)
            {
                Seeker obj = (Seeker)any;

                TabSeeker seek = new TabSeeker();

                seek.fname   = obj.FirstName;
                seek.lname   = obj.LastName;
                seek.uname   = obj.Username;
                seek.mobile  = obj.MobileNumber;
                seek.email   = obj.EmailAddress;
                seek.address = obj.Address;
                seek.dob     = obj.DateOfBirth;
                seek.gender  = obj.Gender;

                db.TabSeekers.InsertOnSubmit(seek);
                db.SubmitChanges();

                foreach (var i in obj.skills)
                {
                    db.TabSkills.InsertOnSubmit(new TabSkill()
                    {
                        uname = obj.Username + obj.skills.IndexOf(i), skill = i, user = obj.Username
                    });
                }

                db.SubmitChanges();

                if (this.InserLogin(obj))
                {
                    return(true);
                }

                else
                {
                    return(false);
                }
            }


            return(false);
        }