public PatientAppointment FindPatientAppointment(PatientAppointment patientAppt) { PatientAppointmentInformation patientApptRecord = null;; PatientAppointment patientAppt1 = new PatientAppointment(); var appointmentquery = from patients in patientApptDataContext.PatientAppointmentInformations where patients.ApptId == patientAppt.ApptId select patients; patientApptRecord = appointmentquery.First(); patientAppt1.AppointmentDate = patientApptRecord.ApptDate; patientAppt1.ApptId = patientApptRecord.ApptId; patientAppt1.ImageAfterTherapy = dataEncryptionAlgorithm.DecryptData(patientApptRecord.ImageAfterTherapy); patientAppt1.ImageBeforeTherapy = dataEncryptionAlgorithm.DecryptData(patientApptRecord.ImageBeforeTherapy); patientAppt1.OilsAndTherapy = dataEncryptionAlgorithm.DecryptData(patientApptRecord.TherapyPerformed); patientAppt1.SessionGoals = dataEncryptionAlgorithm.DecryptData(patientApptRecord.SessionGoals); patientAppt1.PulseKD1 = dataEncryptionAlgorithm.DecryptData(patientApptRecord.KD1); patientAppt1.PulseKD2 = dataEncryptionAlgorithm.DecryptData(patientApptRecord.KD2); patientAppt1.PulseLHT = dataEncryptionAlgorithm.DecryptData(patientApptRecord.LHT); patientAppt1.PulseLV = dataEncryptionAlgorithm.DecryptData(patientApptRecord.LV); patientAppt1.PulseRLU = dataEncryptionAlgorithm.DecryptData(patientApptRecord.RLU); patientAppt1.PulseSP = dataEncryptionAlgorithm.DecryptData(patientApptRecord.SP); return(patientAppt1); }
public MassageTherapists FindTherapist(MassageTherapists person) { MassageTherapists massageTherapist = null; Therapist therapistRecord = null; if (person.Id != Guid.Empty) { try { var query = from therapist in therapistDatabaseContext.Therapists where therapist.Id == person.Id select therapist; therapistRecord = query.First <Therapist>(); massageTherapist = new MassageTherapists(therapistRecord.Id); MyTherapistEncryption.SecurityController dataEncryptionAlgo = new MyTherapistEncryption.SecurityController(); massageTherapist.Name = dataEncryptionAlgo.DecryptData(therapistRecord.Name); massageTherapist.Password = dataEncryptionAlgo.DecryptData(therapistRecord.Password); } catch (Exception ex) { ex.GetHashCode(); } } else { try { MyTherapistEncryption.SecurityController dataEnryptionAlgo = new SecurityController(); string encryptedName = dataEnryptionAlgo.EncryptData(person.Name); string encryptedPassword = dataEnryptionAlgo.EncryptData(person.Password); var query = from therapist in therapistDatabaseContext.Therapists where (therapist.Name == encryptedName && therapist.Password == encryptedPassword) select therapist; therapistRecord = query.First <Therapist>(); massageTherapist = new MassageTherapists(therapistRecord.Id); MyTherapistEncryption.SecurityController dataEncryptionAlgo = new MyTherapistEncryption.SecurityController(); massageTherapist.Name = dataEncryptionAlgo.DecryptData(therapistRecord.Name); massageTherapist.Password = dataEncryptionAlgo.DecryptData(therapistRecord.Password); } catch (Exception ex) { } } return(massageTherapist); }
public Patient FindPatient(Patient patient) { IQueryable <PatientInformation> apatient = from patients in patientDC.PatientInformations where (patients.Id == patient.Id) select patients; try { pi = apatient.Single <PatientInformation>(); patient.FirstName = pi.FirstName; patient.LastName = pi.LastName; patient.Birthday = dataEncryptionAlgorithm.DecryptData(pi.BirthDate); patient.PhoneNumber = dataEncryptionAlgorithm.DecryptData(pi.TelephoneNumber); patient.Email = dataEncryptionAlgorithm.DecryptData(pi.EmailAddress); } catch (Exception ex) { ex.GetHashCode(); } return(patient); }