Пример #1
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));
             }
         }
     }
 }
Пример #2
0
        public static AdminUser GetUserByEmailAddress(Registry registry, string emailAddress)
        {
            AdminUser adminUser = (AdminUser)null;

            using (SqlDataReaderWrapper dr = new SqlDataReaderWrapper(registry.ConnectionStringDefault))
            {
                dr.ProcedureName = "AdminUser_LoadByEmailAddress";
                dr.AddNVarChar("EmailAddress", emailAddress);
                dr.Execute();
                if (dr.Read())
                {
                    adminUser = (AdminUser)registry.CreateInstance(typeof(AdminUser), dr.GetGuid("AdminUserId"));
                    adminUser.SetPropertiesFromDataReader(dr);
                }
            }
            return(adminUser);
        }