Beispiel #1
0
        public static AdminUser GetUserByEmailAddressAndPassword(Registry registry, string emailAddress, string password)
        {
            AdminUser adminUser = (AdminUser)null;

            using (SqlDataReaderWrapper dr = new SqlDataReaderWrapper(registry.ConnectionStringDefault))
            {
                dr.ProcedureName = "AdminUser_LoadByEmailAddressAndPassword";
                dr.AddNVarChar("EmailAddress", emailAddress);
                dr.AddNVarChar("Password", password);
                dr.Execute();
                if (dr.Read())
                {
                    adminUser = (AdminUser)registry.CreateInstance(typeof(AdminUser), dr.GetGuid("AdminUserId"));
                    adminUser.SetPropertiesFromDataReader(dr);
                }
            }
            return(adminUser);
        }
Beispiel #2
0
 public static void SetValidationTestResultPaymentAmounts(AdminUserCollection usersToUpdate, NullableDateTime submittedStartDateUTC, NullableDateTime submittedEndDateUTC)
 {
     using (SqlDataReaderWrapper dataReaderWrapper = new SqlDataReaderWrapper(usersToUpdate.Registry.ConnectionStringDefault))
     {
         dataReaderWrapper.ProcedureName = "AdminUser_GetValidationTestResultPaymentAmounts";
         dataReaderWrapper.AddNVarChar("AdminUserXmlGuidList", usersToUpdate.ToXmlGuidList());
         dataReaderWrapper.AddDateTime("SubmittedStartDateUTC", submittedStartDateUTC);
         dataReaderWrapper.AddDateTime("SubmittedEndDateUTC", submittedEndDateUTC);
         dataReaderWrapper.Execute();
         while (dataReaderWrapper.Read())
         {
             AdminUser byProperty = (AdminUser)usersToUpdate.FindByProperty("Id", (object)dataReaderWrapper.GetGuid("AdminUserId"));
             if (byProperty != null)
             {
                 byProperty.ValidationTestResultsTotalMinutesToComplete = dataReaderWrapper.GetInt32("ValidationTestResultsTotalMinutesToComplete");
                 byProperty.ValidationTestResultsPaymentAmount          = byProperty.ValidationPayRateDollarsPerHour * (NullableDecimal)((Decimal)byProperty.ValidationTestResultsTotalMinutesToComplete / new Decimal(60));
             }
         }
     }
 }