Пример #1
0
        private void GetApplicant()
        {
            appID = GetAppIDFromRequest();

            if (appID == -1)
            {
                string s = GetRedirectString("HRMessage.aspx?MsgID=ErrInvalidAppID");
                Response.Redirect(s, true);
            }
            else
            {
                using (HRApplicationDataEntities ctx = new HRApplicationDataEntities())
                {
                    var query = from a in ctx.Applicants
                                where a.ApplicationID == appID
                                select a;

                    applicant = query.FirstOrDefault();

                    if (applicant == null)
                        Response.Redirect(GetRedirectString("HRMessage.aspx?MsgID=ErrUnknownAppID"), true);
                    else
                    {
                        this.LabelAppID.Text = appID.ToString();
                        this.LabelName.Text = applicant.ApplicantName;
                        this.LabelEducation.Text = applicant.Education;
                        this.LabelReferences.Text = applicant.NumberOfReferences.ToString();
                        this.LabelRequestID.Text = applicant.RequestID.ToString();
                    }
                }
            }
        }
Пример #2
0
        protected override void Execute(CodeActivityContext context)
        {
            using (HRApplicationDataEntities ctx = new HRApplicationDataEntities())
            {
                bool result = HireApproved.Get(context);
                int appID = ApplicantID.Get(context);

                var query = from a in ctx.Applicants
                            where a.ApplicationID == appID
                            select a;

                Applicant applicant = query.FirstOrDefault();
                applicant.HireApproved = result;

                ctx.SaveChanges();
            }
        }
Пример #3
0
        private void GetApplicant()
        {
            _appId = GetAppIdFromRequest();

            if (_appId == -1)
            {
                var s = GetRedirectString("HRMessage.aspx?MsgID=ErrInvalidAppID");
                Response.Redirect(s, true);
            }
            else
            {
                using (var ctx = new HRApplicationDataEntities())
                {
                    var query = from a in ctx.Applicants
                                where a.ApplicationID == _appId
                                select a;

                    _applicant = query.FirstOrDefault();

                    if (_applicant == null)
                        Response.Redirect(GetRedirectString("HRMessage.aspx?MsgID=ErrUnknownAppID"), true);
                    else
                    {
                        LabelAppID.Text = _appId.ToString();
                        LabelName.Text = _applicant.ApplicantName;
                        LabelEducation.Text = _applicant.Education;
                    }
                }
            }
        }