Наследование: System.Web.UI.Page
        public async Task <ActionResult <IEnumerable <JobCandidate> > > Candidates(JobCandidate Candidate)
        {
            _context.JobCandidate.Add(Candidate);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetJobOrder", new { id = Candidate.Id }, Candidate));
        }
Пример #2
0
    public DataTable GetDataTable(DO_Scrl_JobCandidate objcategory, JobCandidate flag)
    {
        DataTable     dt   = new DataTable();
        SqlConnection conn = new SqlConnection();
        SQLManager    co   = new SQLManager();

        conn = co.GetConnection();
        SqlDataAdapter da = new SqlDataAdapter();

        da.SelectCommand             = new SqlCommand("Scrl_JobsListing", conn);
        da.SelectCommand.CommandType = CommandType.StoredProcedure;

        da.SelectCommand.Parameters.Add("@FlagNo", SqlDbType.Int).Value      = flag;
        da.SelectCommand.Parameters.Add("@CurrentPage", SqlDbType.Int).Value = objcategory.CurrentPage;
        da.SelectCommand.Parameters.Add("@PageSize", SqlDbType.Int).Value    = objcategory.CurrentPageSize;

        if (Convert.ToString(objcategory.Job_ID) != "")
        {
            da.SelectCommand.Parameters.Add("@Job_ID", SqlDbType.Int).Value = objcategory.Job_ID;
        }

        da.Fill(dt);
        co.CloseConnection(conn);
        return(dt);
    }
Пример #3
0
        public async Task <bool> ApplyToJob(JobServiceModel jobServiceModel, string userName)
        {
            if (userName == null || jobServiceModel == null)
            {
                return(false);
            }

            var user = await this.usersRepository.All().SingleOrDefaultAsync(u => u.UserName == userName);

            if (user == null)
            {
                return(false);
            }

            var jobSeeker = (await this.candidatesRepository.All().Include(j => j.UserJobs)
                             .SingleOrDefaultAsync(j => j.User.UserName == userName));

            if (jobSeeker == null)
            {
                return(false);
            }

            var jobCandidate = new JobCandidate
            {
                JobSeekerId = jobSeeker.Id,
                JobId       = jobServiceModel.Id,
            };

            await this.jobCandidatesRepository.AddAsync(jobCandidate);

            await this.jobCandidatesRepository.SaveChangesAsync();

            return(true);
        }
        /// <summary>
        /// Deep load all JobCandidate children.
        /// </summary>
        private void Step_03_DeepLoad_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                int count = -1;
                mock           = CreateMockInstance(tm);
                mockCollection = DataRepository.JobCandidateProvider.GetPaged(tm, 0, 10, out count);

                DataRepository.JobCandidateProvider.DeepLoading += new EntityProviderBaseCore <JobCandidate, JobCandidateKey> .DeepLoadingEventHandler(
                    delegate(object sender, DeepSessionEventArgs e)
                {
                    if (e.DeepSession.Count > 3)
                    {
                        e.Cancel = true;
                    }
                }
                    );

                if (mockCollection.Count > 0)
                {
                    DataRepository.JobCandidateProvider.DeepLoad(tm, mockCollection[0]);
                    System.Console.WriteLine("JobCandidate instance correctly deep loaded at 1 level.");

                    mockCollection.Add(mock);
                    // DataRepository.JobCandidateProvider.DeepSave(tm, mockCollection);
                }

                //normally one would commit here
                //tm.Commit();
                //IDisposable will Rollback Transaction since it's left uncommitted
            }
        }
Пример #5
0
 public ViewJobCandidate(JobCandidate job)
 {
     this.JobCandidateID = job.JobCandidateID;
     this.BusinessEntityID = job.BusinessEntityID;
     this.Resume = job.Resume;
     this.ModifiedDate = job.ModifiedDate;
 }
Пример #6
0
        public async Task <ActionResult <JobCandidate> > PostJobCandidates(JobCandidate JobCandidates)
        {
            _context.JobCandidate.Add(JobCandidates);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetJobCandidates", new { id = JobCandidates.Id }, JobCandidates));
        }
Пример #7
0
        public JobCandidate PickCandidateForJob(Job job, IEnumerable <CandidateSkillWeight> allCandidates)
        {
            var jvm = new JobCandidate
            {
                Job = job
            };

            foreach (var candidate in allCandidates)
            {
                var candidatejobScore = CalculateCandidateScore(candidate.Candidate, job);
                if (candidatejobScore.Score > 0)
                {
                    jvm.GoodCandidates.Add(candidatejobScore);
                }
            }

            jvm.GoodCandidates.Sort((x, y) =>
            {
                if (x.Score > y.Score)
                {
                    return(-1);
                }
                if (x.Score < y.Score)
                {
                    return(1);
                }
                return(0);
            });
            return(jvm);
        }
Пример #8
0
        public EquinityExerciseDbContext(DbContextOptions options) : base(options)
        {
            // Just add some sample data

            if (Interviews.ToList().Count != 0)
            {
                return;
            }

            var candidate1 = new JobCandidate()
            {
                Name = "Patryk Nguyen"
            };
            var candidate2 = new JobCandidate()
            {
                Name = "Somebody else"
            };

            JobCandidates.Add(candidate1);
            JobCandidates.Add(candidate2);

            Interviews.Add(new Interview()
            {
                JobCandidateId = 1, IsInterviewResultPositive = true
            });
            Interviews.Add(new Interview()
            {
                JobCandidateId = 2, IsInterviewResultPositive = false
            });

            this.SaveChanges();
        }
        public async Task <ActionResult <JobCandidate> > Candidates(int id, JobCandidate Candidate)
        {
            if (id != Candidate.Id)
            {
                return(BadRequest());
            }
            _context.Entry(Candidate).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!JobCandidateExists(id))
                {
                    return(Ok(new { StatusCode = StatusCodes.Status200OK, Message = "No Record Found." }));
                }
                else
                {
                    throw;
                }
            }

            return(Ok(new { StatusCode = StatusCodes.Status200OK, result = Candidate }));
        }
Пример #10
0
        ///<summary>
        ///  Update the Typed JobCandidate Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, JobCandidate mock)
        {
            JobCandidateTest.UpdateMockInstance_Generated(tm, mock);

            // make any alterations necessary
            // (i.e. for DB check constraints, special test cases, etc.)
            SetSpecialTestData(mock);
        }
        /// <summary>
        /// Check the foreign key dal methods.
        /// </summary>
        private void Step_10_FK_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                JobCandidate entity = CreateMockInstance(tm);
                bool         result = DataRepository.JobCandidateProvider.Insert(tm, entity);

                Assert.IsTrue(result, "Could Not Test FK, Insert Failed");
            }
        }
        ///<summary>
        ///  Update the Typed JobCandidate Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance_Generated(TransactionManager tm, JobCandidate mock)
        {
            mock.Resume       = "<test></test>";
            mock.ModifiedDate = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            Employee mockEmployeeByEmployeeId = EmployeeTest.CreateMockInstance(tm);

            DataRepository.EmployeeProvider.Insert(tm, mockEmployeeByEmployeeId);
            mock.EmployeeId = mockEmployeeByEmployeeId.EmployeeId;
        }
        /// <summary>
        /// Test methods exposed by the EntityHelper class.
        /// </summary>
        private void Step_20_TestEntityHelper_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                mock = CreateMockInstance(tm);

                JobCandidate entity = mock.Copy() as JobCandidate;
                entity = (JobCandidate)mock.Clone();
                Assert.IsTrue(JobCandidate.ValueEquals(entity, mock), "Clone is not working");
            }
        }
Пример #14
0
        public void Test3(string value)
        {
            JobCandidate candidate = new JobCandidate();

            candidate.Resume = value;

            List <DynamicProperty <JobCandidate> > list = new List <DynamicProperty <JobCandidate> >(candidate.GetUpdatedProperties());

            Assert.AreEqual(1, list.Count);
            Assert.AreEqual(value, list[0].InvokeGetterOn(candidate));
        }
Пример #15
0
        public void Test(int?value)
        {
            JobCandidate candidate = new JobCandidate();

            candidate.BusinessEntityId = value;

            List <DynamicProperty <JobCandidate> > list = new List <DynamicProperty <JobCandidate> >(candidate.GetUpdatedProperties());

            Assert.AreEqual(1, list.Count);
            Assert.AreEqual(value, list[0].InvokeGetterOn(candidate));
        }
Пример #16
0
 public ActionResult Edit([Bind(Include = "JobCandidateID,BusinessEntityID,Resume,ModifiedDate,isDeleted")] JobCandidate jobCandidate)
 {
     if (ModelState.IsValid)
     {
         db.Entry(jobCandidate).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BusinessEntityID = new SelectList(db.Employees, "BusinessEntityID", "NationalIDNumber", jobCandidate.BusinessEntityID);
     return(View(jobCandidate));
 }
 public void SetUpJobCandidate()
 {
     _jobCandidate = new JobCandidate
     {
         FirstName             = "John",
         LastName              = "Smith",
         JobTitle              = "Developer",
         ComapnyName           = "Equiniti",
         IsApplicationAccepted = true
     };
 }
 public bool UpdateJobCandidate(JobCandidate jobCandidate)
 {
     if (_jobCandidates.ContainsKey(jobCandidate.Id))
     {
         _jobCandidates[jobCandidate.Id] = jobCandidate;
         return(true);
     }
     else
     {
         return(false);
     }
 }
        // PUT api/awbuildversion/5
        public void Put(JobCandidate value)
        {
            var GetActionType = Request.Headers.Where(x => x.Key.Equals("ActionType")).FirstOrDefault();

            if (GetActionType.Key != null)
            {
                if (GetActionType.Value.ToList()[0].Equals("DELETE"))
                    adventureWorks_BC.JobCandidateDelete(value);
                if (GetActionType.Value.ToList()[0].Equals("UPDATE"))
                    adventureWorks_BC.JobCandidateUpdate(value);
            }
        }
        public virtual JobCandidate MapBOToEF(
            BOJobCandidate bo)
        {
            JobCandidate efJobCandidate = new JobCandidate();

            efJobCandidate.SetProperties(
                bo.BusinessEntityID,
                bo.JobCandidateID,
                bo.ModifiedDate,
                bo.Resume);
            return(efJobCandidate);
        }
        public virtual BOJobCandidate MapEFToBO(
            JobCandidate ef)
        {
            var bo = new BOJobCandidate();

            bo.SetProperties(
                ef.JobCandidateID,
                ef.BusinessEntityID,
                ef.ModifiedDate,
                ef.Resume);
            return(bo);
        }
Пример #22
0
        ///<summary>
        ///  Returns a Typed JobCandidate Entity with mock values.
        ///</summary>
        static public JobCandidate CreateMockInstance(TransactionManager tm)
        {
            // get the default mock instance
            JobCandidate mock = JobCandidateTest.CreateMockInstance_Generated(tm);

            // make any alterations necessary
            // (i.e. for DB check constraints, special test cases, etc.)
            SetSpecialTestData(mock);

            // return the modified object
            return(mock);
        }
Пример #23
0
        protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
        {
            bool isHuman = SampleCaptcha.Validate(CaptchaCodeTextBox.Text);

            CaptchaCodeTextBox.Text = null;


            if (isHuman)
            {
                try
                {
                    JobCandidate can = new JobCandidate();
                    can.JobId     = new Guid(Request.Params["Id"]);
                    can.FirstName = txtFirstName.Value;
                    can.LastName  = txtLastName.Value;
                    can.Phone     = txtPhone.Value;
                    can.Email     = txtEmail.Value;
                    can.Comments  = txtPropertyDetails.Value;
                    can.CV        = resumeUpload.HasFile ? resumeUpload.FileBytes : null;
                    can.CVName    = resumeUpload.HasFile ? resumeUpload.FileName : "";
                    can.AddJobCandidate();
                    StringBuilder builder = new StringBuilder(EmailTemplates.SendCVSubmittedNotificationEmail);
                    builder = builder.Replace("#FirstName#", txtFirstName.Value);
                    builder = builder.Replace("#SurName#", txtLastName.Value);
                    builder = builder.Replace("#Phone#", txtPhone.Value);
                    builder = builder.Replace("#Email#", txtEmail.Value);
                    builder = builder.Replace("#Comments#", txtPropertyDetails.Value);
                    if (resumeUpload.HasFile)
                    {
                        BAL.Common.SendEmail(new string[] { BAL.MiscActivity.GetSettings("EmailFrom").ToString() }, null, String.Concat("Apply For Job Form Submitted By '", txtFirstName.Value, " ", txtLastName.Value, "'"), builder.ToString(), resumeUpload.FileName, resumeUpload.FileContent);
                    }
                    else
                    {
                        BAL.Common.SendEmail(new string[] { BAL.MiscActivity.GetSettings("EmailFrom").ToString() }, null, String.Concat("Apply For Job Form Submitted By '", txtFirstName.Value, " ", txtLastName.Value, "'"), builder.ToString());
                    }

                    divMain.Visible      = false;
                    divSecondary.Visible = true;
                    litMessage.Text      = this.GetLocalResourceObject("Text.EmailSubmitted").ToString();
                }
                catch (Exception ex)
                {
                    divMain.Visible      = false;
                    divSecondary.Visible = true;
                    litMessage.Text      = this.GetLocalResourceObject("Text.ErrorOccurred").ToString() + Environment.NewLine + ex.ToString();
                }
            }
            else
            {
                litMessage.Text = "Invalid Captcha!";
            }
        }
        /// <summary>
        /// Serialize the mock JobCandidate entity into a temporary file.
        /// </summary>
        private void Step_06_SerializeEntity_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                mock = CreateMockInstance(tm);
                string fileName = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "temp_JobCandidate.xml");

                EntityHelper.SerializeXml(mock, fileName);
                Assert.IsTrue(System.IO.File.Exists(fileName), "Serialized mock not found");

                System.Console.WriteLine("mock correctly serialized to a temporary file.");
            }
        }
Пример #25
0
 public static JobCandidateViewModel ToViewModel(this JobCandidate jobCandidate)
 {
     if (jobCandidate == null)
     {
         return(null);
     }
     return(new JobCandidateViewModel()
     {
         JobId = jobCandidate.Job.JobId,
         Name = jobCandidate.Job.Name,
         Company = jobCandidate.Job.Company,
         GoodCandidates = jobCandidate.GoodCandidates.Select(x => x.ToViewModel()).ToList()
     });
 }
Пример #26
0
        public void MapEFToBOList()
        {
            var          mapper = new DALJobCandidateMapper();
            JobCandidate entity = new JobCandidate();

            entity.SetProperties(1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A");

            List <BOJobCandidate> response = mapper.MapEFToBO(new List <JobCandidate>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
Пример #27
0
        public void MapBOToEF()
        {
            var mapper = new DALJobCandidateMapper();
            var bo     = new BOJobCandidate();

            bo.SetProperties(1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A");

            JobCandidate response = mapper.MapBOToEF(bo);

            response.BusinessEntityID.Should().Be(1);
            response.JobCandidateID.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Resume.Should().Be("A");
        }
Пример #28
0
 public bool JobCandidateDelete(JobCandidate jobcandidate)
 {
     return(Execute <bool>(dal =>
     {
         JobCandidate jobcandidateDelete = dal.JobCandidate.Where(x => x.JobCandidateID == jobcandidate.JobCandidateID).FirstOrDefault();
         if (jobcandidateDelete != null)
         {
             dal.JobCandidate.DeleteOnSubmit(jobcandidateDelete);
             dal.SubmitChanges();
             return true;
         }
         return false;
     }));
 }
Пример #29
0
        public void MapEFToBO()
        {
            var          mapper = new DALJobCandidateMapper();
            JobCandidate entity = new JobCandidate();

            entity.SetProperties(1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A");

            BOJobCandidate response = mapper.MapEFToBO(entity);

            response.BusinessEntityID.Should().Be(1);
            response.JobCandidateID.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Resume.Should().Be("A");
        }
        /// <summary>
        /// Check the indexes dal methods.
        /// </summary>
        private void Step_11_IX_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                JobCandidate entity = CreateMockInstance(tm);
                bool         result = DataRepository.JobCandidateProvider.Insert(tm, entity);

                Assert.IsTrue(result, "Could Not Test IX, Insert Failed");


                TList <JobCandidate> t0 = DataRepository.JobCandidateProvider.GetByEmployeeId(tm, entity.EmployeeId);
                JobCandidate         t1 = DataRepository.JobCandidateProvider.GetByJobCandidateId(tm, entity.JobCandidateId);
            }
        }
Пример #31
0
        // GET: JobCandidates/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            JobCandidate jobCandidate = db.JobCandidates.Find(id);

            if (jobCandidate == null)
            {
                return(HttpNotFound());
            }
            return(View(jobCandidate));
        }
 /// <summary>
 /// Create a new JobCandidate object.
 /// </summary>
 /// <param name="jobCandidateID">Initial value of JobCandidateID.</param>
 /// <param name="modifiedDate">Initial value of ModifiedDate.</param>
 public static JobCandidate CreateJobCandidate(int jobCandidateID, global::System.DateTime modifiedDate)
 {
     JobCandidate jobCandidate = new JobCandidate();
     jobCandidate.JobCandidateID = jobCandidateID;
     jobCandidate.ModifiedDate = modifiedDate;
     return jobCandidate;
 }
 /// <summary>
 /// There are no comments for JobCandidate in the schema.
 /// </summary>
 public void AddToJobCandidate(JobCandidate jobCandidate)
 {
     base.AddObject("JobCandidate", jobCandidate);
 }
 // POST api/awbuildversion
 public void Post(JobCandidate value)
 {
     adventureWorks_BC.JobCandidateAdd(value);
 }