Exemple #1
0
 public DatabaseRowParser(DataGridObjects.DatabaseRowObject databaseRowObj, MyTherapistEncryption.SecurityController dataEncryptionAlgorithm)
 {
     //
     // TODO: Add constructor logic here
     //
     this.sqlReader               = sqlReader;
     this.databaseRowObj          = databaseRowObj;
     this.dataEncryptionAlgorithm = dataEncryptionAlgorithm;
 }
 public PatientAppointmentInformationTableManager()
 {
     //
     // TODO: Add constructor logic here
     //
     patientApptDataContext        = new PatientAppointmentInfomationDataContext(WebConfigurationManager.ConnectionStrings["MyTherapistDatabaseConnectionString"].ConnectionString);
     patientAppointmentInformation = new PatientAppointmentInformation();
     dataEncryptionAlgorithm       = new MyTherapistEncryption.SecurityController();
 }
        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);
        }