コード例 #1
0
        private void Update(List <string> fields, int applicantID)
        {
            using (TechCareerFair.DAL.Applicant2FieldDAL.Applicant2FieldDatabaseDataService ds = new Applicant2FieldDAL.Applicant2FieldDatabaseDataService())
            {
                List <applicant2field> a2fs = ds.Read();

                foreach (string name in fields)
                {
                    applicant2field a2f        = new applicant2field();
                    int             fieldIndex = DatabaseHelper.GetFieldIndex(name);

                    a2f.Applicant = applicantID;
                    a2f.Field     = fieldIndex;

                    ds.Update(a2f);
                }
            }
        }
コード例 #2
0
        private void Insert(List <string> fields, int applicantID)
        {
            //insert field ID and applicant ID into new record of mapping table applicant2field
            using (TechCareerFair.DAL.Applicant2FieldDAL.Applicant2FieldDatabaseDataService ds = new Applicant2FieldDAL.Applicant2FieldDatabaseDataService())
            {
                List <applicant2field> a2fs = ds.Read();

                foreach (string name in fields)
                {
                    applicant2field a2f        = new applicant2field();
                    int             fieldIndex = DatabaseHelper.GetFieldIndex(name);

                    a2f.Applicant = applicantID;
                    a2f.Field     = fieldIndex;
                    if (a2fs.Where(a => a.Field == fieldIndex).Where(a => a.Applicant == applicantID).Count() == 0)
                    {
                        ds.Insert(a2f);
                    }
                }
            }
        }
コード例 #3
0
 private void RemoveAll(int applicantID)
 {
     using (TechCareerFair.DAL.Applicant2FieldDAL.Applicant2FieldDatabaseDataService ds = new Applicant2FieldDAL.Applicant2FieldDatabaseDataService())
     {
         ds.RemoveAll(applicantID);
     }
 }
コード例 #4
0
 public void Dispose()
 {
     _applicant2fields = null;
     _ds = null;
 }