Exemplo n.º 1
0
        public static ApplicantList GetList()
        {
            ApplicantList applicants = new ApplicantList();
            using (OracleConnection localDbConn =
                    new OracleConnection(
                        ConnStringFactory.getConnString(
                            ConnStringFactory.ConnStringType.Oracle))) {
                localDbConn.Open();

                using (OracleCommand getAllApplicantCommand = new OracleCommand()) {
                    getAllApplicantCommand.CommandType = CommandType.StoredProcedure;
                    getAllApplicantCommand.CommandText = "ApplicantsPKG.getAllApplicants";
                    getAllApplicantCommand.Connection = localDbConn;

                    OracleParameter outputCursor = new OracleParameter("IO_CURSOR", OracleType.Cursor);
                    outputCursor.Direction = ParameterDirection.Output;
                    getAllApplicantCommand.Parameters.Add(outputCursor);

                    using (OracleDataReader applicantListReader =
                        getAllApplicantCommand.ExecuteReader()) {
                        if (applicantListReader.HasRows) {
                            while (applicantListReader.Read()) {
                                applicants.Add(FillDataRecord(applicantListReader));
                            }
                        }
                    }
                }
            }
            return applicants;
        }
 /// <summary>
 /// It inserts the applicant, if it's not already in the list.
 /// </summary>
 /// <param name="applicant">The applicant to be inserted.</param>
 public void InsertRecord(Applicant applicant)
 {
     if (ApplicantList.IndexOf(applicant) == -1)
     {
         ApplicantList.Add(applicant);
     }
     SaveToFile();
 }
Exemplo n.º 3
0
 /// <summary>
 /// It inserts the applicant, if it's not already in the list.
 /// </summary>
 /// <param name="applicant">The applicant to be inserted.</param>
 public void InsertRecord(Applicant applicant)
 {
     Debug.Assert(applicant != null);
     Debug.Assert(ApplicantList.IndexOf(applicant) == -1);
     if (ApplicantList.IndexOf(applicant) == -1)
     {
         ApplicantList.Add(applicant);
     }
     SaveToFile();
 }
Exemplo n.º 4
0
        public async Task Init()
        {
            if (UniversityList.Count == 0)
            {
                var universityList = await _serviceUniversity.Get <List <University> >(null);

                foreach (var k in universityList)
                {
                    UniversityList.Add(k);
                }
            }

            if (SelectedUniversity != null)
            {
                var listApplicants = await _serviceApplicant.Get <List <Applicant> >(_search);

                ApplicantList.Clear();

                foreach (var m in listApplicants)
                {
                    if (m.UniversityId == SelectedUniversity.UniversityId)
                    {
                        ApplicantList.Add(m);
                    }
                }
            }
            else
            {
                var listApplicants = await _serviceApplicant.Get <List <Applicant> >(_search);

                ApplicantList.Clear();
                foreach (var x in listApplicants)
                {
                    ApplicantList.Add(x);
                }
            }
        }