Esempio n. 1
0
        /// <summary>
        /// Note: Continous function. does not commit.
        /// </summary>
        /// <param name="applicationId"></param>
        /// <param name="db"></param>
        public void MarkAsWatched(int applicationId, JobyJobsDB2 db)
        {
            var obj = ApplicationsCRUD.Get(applicationId, db);

            obj.watched = true;

            db.SetAsModified(obj);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns the relative file path of the CV of the seeker that had applied to the job in the current application.
        /// Also marks the current application as watched.
        /// Note: relative to the user-files folder.
        /// </summary>
        /// <param name="applicationId"></param>
        public string GetCandidateCVFile(int applicationId)
        {
            using (var db = new JobyJobsDB2())
            {
                //gets the cv file path.
                var dbApplication = ApplicationsCRUD.Get(applicationId);
                if (dbApplication == null)
                {
                    throw new JobyJobsException("no application with the given id");
                }
                string cvFilePath = _seekersBL.GetSeekerInternal(dbApplication.seeker_id, db).CV_File;

                //mark the application as watched by the current employer.
                this.MarkAsWatched(applicationId, db);

                //save db changes.
                db.SaveChanges();

                //returns it.
                return(cvFilePath);
            }
        }
Esempio n. 3
0
 public Application GetApplication(int applicationId)
 {
     return(ApplicationsCRUD.Get(applicationId).ToBusiness());
 }