Пример #1
0
 protected new void SetPropertiesFromDataReader(SqlDataReaderWrapper dr)
 {
     this.firstName             = dr.GetString("FirstName");
     this.lastName              = dr.GetString("LastName");
     this.emailAddress          = dr.GetString("EmailAddress");
     this.phoneNumber           = dr.GetString("PhoneNumber");
     this.password              = dr.GetString("Password");
     this.address1              = dr.GetString("Address1");
     this.address2              = dr.GetString("Address2");
     this.city                  = dr.GetString("City");
     this.state                 = dr.GetString("State");
     this.postalCode            = dr.GetString("PostalCode");
     this.shippingAddress1      = dr.GetString("ShippingAddress1");
     this.shippingAddress2      = dr.GetString("ShippingAddress2");
     this.shippingCity          = dr.GetString("ShippingCity");
     this.shippingState         = dr.GetString("ShippingState");
     this.shippingPostalCode    = dr.GetString("ShippingPostalCode");
     this.areasOfExpertise      = dr.GetString("AreasOfExpertise");
     this.adminUserType         = (AdminUserType)dr.GetInt32("AdminUserType");
     this.isSystemAdministrator = dr.GetBoolean("IsSystemAdministrator");
     this.isReceivesPastDueNoFixNotifications = dr.GetBoolean("IsReceivesPastDueNoFixNotifications");
     this.market      = (Market)dr.GetInt32("Market");
     this.permissions = dr.GetString("Permissions");
     this.validationPayRateDollarsPerHour = dr.GetNullableDecimal("ValidationPayRateDollarsPerHour");
     this.isActive                  = dr.GetBoolean("IsActive");
     this.isDeleted                 = dr.GetBoolean("IsDeleted");
     this.updatedDateTimeUTC        = dr.GetDateTime("UpdatedDateTimeUTC");
     this.createdDateTimeUTC        = dr.GetDateTime("CreatedDateTimeUTC");
     this.lastLoginDateTimeUTC      = dr.GetNullableDateTime("LastLoginDateTimeUTC");
     this.propertyDefinitionDataSet = (PropertyDefinitionDataSet)dr.GetBusinessObjectBase(this.Registry, typeof(PropertyDefinitionDataSet), "PropertyDefinitionDataSetId");
     this.enablePropertyDefinitionEditingOnForms = dr.GetBoolean("EnablePropertyDefinitionEditingOnForms");
     if (!dr.IsDBNull("ValidationTestResultsTotalMinutesToComplete"))
     {
         this.validationTestResultsTotalMinutesToComplete = dr.GetInt32("ValidationTestResultsTotalMinutesToComplete");
     }
     this.IsObjectLoaded = true;
 }
Пример #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));
             }
         }
     }
 }
Пример #3
0
        public static List <DiagnosticReportOBDFixAdminUserStatistics> GetOBDFixStats(Registry registry, AdminUserCollection users, DateTime?startDateTimeUTC, DateTime?endDateTimeUTC)
        {
            List <DiagnosticReportOBDFixAdminUserStatistics> adminUserStatisticsList = new List <DiagnosticReportOBDFixAdminUserStatistics>();

            foreach (AdminUser user in (CollectionBase)users)
            {
                using (SqlDataReaderWrapper dataReaderWrapper = new SqlDataReaderWrapper(registry.ConnectionStringDefault))
                {
                    dataReaderWrapper.ProcedureName = "DiagnosticReportFixFeedback_GetAdminUserStats";
                    dataReaderWrapper.AddGuid("AdminUserId", user.Id);
                    if (startDateTimeUTC.HasValue)
                    {
                        dataReaderWrapper.AddDateTime("StartDateTimeUTC", startDateTimeUTC.Value);
                    }
                    if (endDateTimeUTC.HasValue)
                    {
                        dataReaderWrapper.AddDateTime("EndDateTimeUTC", endDateTimeUTC.Value);
                    }
                    dataReaderWrapper.Execute();
                    if (dataReaderWrapper.Read())
                    {
                        DiagnosticReportOBDFixAdminUserStatistics adminUserStatistics = new DiagnosticReportOBDFixAdminUserStatistics(user, dataReaderWrapper.GetInt32("ReportsClosedNewFixAdded"), dataReaderWrapper.GetInt32("ReportsClosedExistingFixSelected"), dataReaderWrapper.GetInt32("ReportsClosedRejected"), dataReaderWrapper.GetInt32("NumOfFixesFromFixReport"), dataReaderWrapper.GetInt32("NumOfDirectFixes"));
                        adminUserStatisticsList.Add(adminUserStatistics);
                    }
                }
            }
            return(adminUserStatisticsList);
        }