Esempio n. 1
0
        public Boolean HireSeekerFor(Seeker s, Job j)
        {
            if (s != null && j != null)
            {
                var v = from job in db.TabJobApplications
                        where job.Applicant == s.Username && job.JId == GetJobIdByTitle(j.Title)
                        select job;

                TabJobApplication tab = v.First();

                tab.Status = "Hired";

                db.SubmitChanges();

                var w = from sek in db.TabSeekers
                        where sek.uname == s.Username
                        select sek;

                SendMailTo(w.First().email, "Congratulations!", "You have been seleced for the job: " + j.Title, new Admin());

                return(true);
            }

            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        public Boolean DeleteJob(Job job)
        {
            if (job != null)
            {
                var v = from j in db.TabJobs
                        where j.JId == Convert.ToInt32(GetJobIdByTitle(job.Title))
                        select j;

                var w = from k in db.TabJobApplications
                        where k.JId == GetJobIdByTitle(job.Title)
                        select k;

                var x = from l in db.TabJobSkills
                        where l.JId == Convert.ToInt32(GetJobIdByTitle(job.Title))
                        select l;

                if (v.Count() == 1)
                {
                    TabJob tab = v.First();
                    db.TabJobs.DeleteOnSubmit(tab);

                    if (x != null)
                    {
                        foreach (var item in x)
                        {
                            TabJobSkill tabSkill = item;
                            db.TabJobSkills.DeleteOnSubmit(tabSkill);
                        }
                    }

                    if (w != null)
                    {
                        foreach (var item in w)
                        {
                            TabJobApplication tabApp = item;
                            db.TabJobApplications.DeleteOnSubmit(tabApp);
                        }
                    }

                    db.SubmitChanges();
                    return(true);
                }

                else
                {
                    return(false);
                }
            }

            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        public Boolean DeleteJobApplication(Seeker s, Job j)
        {
            if (s != null && j != null)
            {
                var v = from application in db.TabJobApplications
                        where application.Applicant == s.Username && application.JId == GetJobIdByTitle(j.Title)
                        select application;

                TabJobApplication app = v.First();

                db.TabJobApplications.DeleteOnSubmit(app);
                db.SubmitChanges();

                return(true);
            }

            else
            {
                return(false);
            }
        }
Esempio n. 4
0
        public Boolean AddJobApplicationDetails(Job job, Seeker sek)
        {
            if (job != null && sek != null && CheckUserStatus(sek))
            {
                var v = from m in db.TabJobApplications
                        where m.JId == this.GetJobIdByTitle(job.Title) && m.Applicant == sek.Username
                        select m;

                var p = from q in db.TabJobs
                        where q.JId == Convert.ToInt32(GetJobIdByTitle(job.Title))
                        select q;

                if (v.Count() == 0)
                {
                    TabJobApplication application = new TabJobApplication();
                    application.JId       = this.GetJobIdByTitle(job.Title);
                    application.Applicant = sek.Username;
                    application.JTitle    = job.Title;
                    application.PostedBy  = p.First().PostedBy;



                    db.TabJobApplications.InsertOnSubmit(application);
                    db.SubmitChanges();

                    return(true);
                }

                else
                {
                    return(false);
                }
            }

            else
            {
                return(false);
            }
        }