Example #1
0
        public PartialViewResult UnsaveBingJob(SearchResult jobClicked)
        {
            // Load the current account
            Account account = Account.GetAccount(User.Identity.Name, RavenSession);
            if (account != null)
            {
                // Load the job
                var jobs = from j in account.Jobs
                           where j.URL == jobClicked.Url
                           select j;

                // Delete the job
                if (jobs != null && jobs.Count() > 0)
                {
                    Job job = jobs.First();
                    account.Jobs.Remove(job);
                    RavenSession.Store(account);
                }
            }

            return PartialView("JobNotSaved", jobClicked);
        }
 public ActionResult RedirectDisclaimer(SearchResult result)
 {
     return View("RedirectDisclaimer", result);
 }
Example #3
0
        public PartialViewResult SaveBingJob(SearchResult jobClicked)
        {
            // Check if job was already saved
            // Load the current account
            Account account = Account.GetAccount(User.Identity.Name, RavenSession);
            if (account != null)
            {
                var jobs = from j in account.Jobs
                           where j.URL == jobClicked.Url
                           select j;

                if (jobs != null && jobs.Count() > 0)
                {
                    return PartialView("JobSaved", jobClicked);
                }

                // Create the job
                var job = new Job
                {
                    JobStatus = new JobStatus(),
                    ShortDescription = jobClicked.Description,
                    Title = jobClicked.Title,
                    URL = jobClicked.Url
                };
                job.JobStatus.Status = "Lead";

                if (account != null)
                {
                    if (account.Jobs == null)
                        account.Jobs = new List<Job>();

                    account.Jobs.Add(job);
                }
            }

            return PartialView("JobSaved", jobClicked);
        }