static void InsertPersonContactInfoAndMailAddress(Model.Person candidateRecord, int personId, int candidateId)
        {
            //Insert the Person's email:
            if (!string.IsNullOrEmpty(candidateRecord.Email))
            {
                var personEmail = _db.InsertPersonContactInformation(personId, 2, candidateRecord.Email, null, true, 0).ToList();
            }

            //Insert Candidate Information
            //Returns the PersonContactInformation.Id
            var personContactInformationId = -1;
            var mailingAddressId           = -1;

            //0:
            personContactInformationId = InsertContactInformation(personId, candidateRecord.handle0text, candidateRecord.handle0type);

            //1:
            personContactInformationId = InsertContactInformation(personId, candidateRecord.handle1text, candidateRecord.handle1type);

            //2:
            personContactInformationId = InsertContactInformation(personId, candidateRecord.handle2text, candidateRecord.handle2type);

            //3:
            personContactInformationId = InsertContactInformation(personId, candidateRecord.handle3text, candidateRecord.handle3type);

            //Insert Mailing Address & PersonMailAddress
            //Inserts into the MailAddress table and the PersonMailAddress table
            if (!string.IsNullOrEmpty(candidateRecord.Address) && !string.IsNullOrEmpty(candidateRecord.City) && !string.IsNullOrEmpty(candidateRecord.State) && !string.IsNullOrEmpty(candidateRecord.Zip))
            {
                //Returns the PersonMailAddress.Id
                var personMailAddressResult = _db.InsertPersonMailingAddress(personId, candidateRecord.Address, candidateRecord.City, candidateRecord.State, candidateRecord.Zip, 0).ToList();
                mailingAddressId = Convert.ToInt32(personMailAddressResult[0]);
            }

            //Insert Candidate Notes
            //Inserts into the CandidateNote table
            if (!string.IsNullOrEmpty(candidateRecord.Notes))
            {
                //Returns the CustomerNote.Id
                var customerNoteResult = _db.InsertCandidateNote(candidateId, candidateRecord.Notes, candidateRecord.Created, 0).ToList();
            }
        }
        public static void InsertCandidate(Model.Person candidateRecord, int personId)
        {
            //Get the source type for the candidate:
            var sourceTypeIdForCandidate = ImportHelperMethods.GetSourceTypeId(candidateRecord.Source);

            //Get the candidate type id:
            var candidateStatusTypeId = GetCandidateStatusTypeId(candidateRecord.IdStatus);

            Candidate candidateData = new Candidate();

            if (!string.IsNullOrEmpty(candidateRecord.xdata))
            {
                candidateData = LookupValue.ParseXML(candidateRecord.xdata, candidateData);
            }

            //Get the org id:
            var orgId = ImportHelperMethods.GetIdOrganization(candidateRecord.IdOrganization);

            var candidateId = -1;

            //Insert as a Candidate
            //Returns the Candidate record
            var candidateResult = _db.InsertCandidate(personId, candidateStatusTypeId, null, null, null, sourceTypeIdForCandidate, candidateData.MaxTravelTypeId, null, null, candidateData.CurrentSalary, candidateData.DesiredSalary, candidateData.CurrentRate, candidateData.DesiredRate, null, candidateData.IsOpenToRelocation, 0, candidateRecord.Created, orgId).ToList();

            foreach (var item in candidateResult)
            {
                candidateId = item.Id;
            }


            //Insert the Candidate's Mailing Address and Contact Information and Notes:
            InsertPersonContactInfoAndMailAddress(candidateRecord, personId, candidateId);



            Debug.WriteLine("\n" + "Person imported: " + personId + " " + candidateRecord.FirstName + " " + candidateRecord.LastName + " Customer Id: " + candidateId);
        }