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(); } } } }
/// <summary> /// Deprecated Method for adding a new object to the Applicants EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToApplicants(Applicant applicant) { base.AddObject("Applicants", applicant); }
/// <summary> /// Create a new Applicant object. /// </summary> /// <param name="applicationID">Initial value of the ApplicationID property.</param> /// <param name="applicantName">Initial value of the ApplicantName property.</param> /// <param name="numberOfReferences">Initial value of the NumberOfReferences property.</param> /// <param name="requestID">Initial value of the RequestID property.</param> /// <param name="education">Initial value of the Education property.</param> public static Applicant CreateApplicant(global::System.Int32 applicationID, global::System.String applicantName, global::System.Int32 numberOfReferences, global::System.Guid requestID, global::System.String education) { Applicant applicant = new Applicant(); applicant.ApplicationID = applicationID; applicant.ApplicantName = applicantName; applicant.NumberOfReferences = numberOfReferences; applicant.RequestID = requestID; applicant.Education = education; return applicant; }
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; } } } }