Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
 public void UpdateAdminUserRoleAssignments(AdminUserRoleCollection roles)
 {
     using (SqlDataReaderWrapper dataReaderWrapper = new SqlDataReaderWrapper(this.Registry.ConnectionStringDefault))
     {
         dataReaderWrapper.ProcedureName = "AdminUser_UpdateAdminUserRolesByXmlGuidList";
         dataReaderWrapper.AddGuid("AdminUserId", this.Id);
         dataReaderWrapper.AddNVarChar("AdminUserRoleXmlGuidList", roles.ToXmlGuidList());
         dataReaderWrapper.ExecuteNonQuery();
     }
 }
Exemplo n.º 3
0
 public override SqlTransaction Save(SqlConnection connection, SqlTransaction transaction)
 {
     transaction = base.Save(connection, transaction);
     if (this.IsObjectDirty)
     {
         transaction = this.EnsureDatabasePrepared(connection, transaction);
         using (SqlDataReaderWrapper dataReaderWrapper = new SqlDataReaderWrapper(connection, false))
         {
             if (this.IsObjectCreated)
             {
                 dataReaderWrapper.ProcedureName = "AdminUser_Create";
                 this.CreatedDateTimeUTC         = DateTime.UtcNow;
                 this.UpdatedDateTimeUTC         = this.CreatedDateTimeUTC;
             }
             else
             {
                 dataReaderWrapper.ProcedureName = "AdminUser_Save";
             }
             dataReaderWrapper.AddGuid("AdminUserId", this.Id);
             dataReaderWrapper.AddNVarChar("FirstName", this.FirstName);
             dataReaderWrapper.AddNVarChar("LastName", this.LastName);
             dataReaderWrapper.AddNVarChar("EmailAddress", this.EmailAddress);
             dataReaderWrapper.AddNVarChar("PhoneNumber", InnovaFormatting.CleanPhoneNumber(this.PhoneNumber));
             dataReaderWrapper.AddNVarChar("Password", this.Password);
             dataReaderWrapper.AddNVarChar("Address1", this.Address1);
             dataReaderWrapper.AddNVarChar("Address2", this.Address2);
             dataReaderWrapper.AddNVarChar("City", this.City);
             dataReaderWrapper.AddNVarChar("State", this.State);
             dataReaderWrapper.AddNVarChar("PostalCode", this.PostalCode);
             dataReaderWrapper.AddNVarChar("ShippingAddress1", this.ShippingAddress1);
             dataReaderWrapper.AddNVarChar("ShippingAddress2", this.ShippingAddress2);
             dataReaderWrapper.AddNVarChar("ShippingCity", this.ShippingCity);
             dataReaderWrapper.AddNVarChar("ShippingState", this.ShippingState);
             dataReaderWrapper.AddNVarChar("ShippingPostalCode", this.ShippingPostalCode);
             dataReaderWrapper.AddNVarChar("AreasOfExpertise", this.AreasOfExpertise);
             dataReaderWrapper.AddInt32("AdminUserType", (int)this.AdminUserType);
             dataReaderWrapper.AddBoolean("IsSystemAdministrator", this.IsSystemAdministrator);
             dataReaderWrapper.AddBoolean("IsReceivesPastDueNoFixNotifications", this.IsReceivesPastDueNoFixNotifications);
             dataReaderWrapper.AddInt32("Market", (int)this.Market);
             dataReaderWrapper.AddNVarChar("Permissions", this.Permissions);
             dataReaderWrapper.AddDecimal("ValidationPayRateDollarsPerHour", this.ValidationPayRateDollarsPerHour);
             dataReaderWrapper.AddBoolean("IsActive", this.IsActive);
             dataReaderWrapper.AddBoolean("IsDeleted", this.IsDeleted);
             dataReaderWrapper.AddDateTime("UpdatedDateTimeUTC", this.UpdatedDateTimeUTC);
             dataReaderWrapper.AddDateTime("CreatedDateTimeUTC", this.CreatedDateTimeUTC);
             dataReaderWrapper.AddDateTime("LastLoginDateTimeUTC", this.LastLoginDateTimeUTC);
             dataReaderWrapper.AddBusinessObject("PropertyDefinitionDataSetId", (BusinessObjectBase)this.PropertyDefinitionDataSet);
             dataReaderWrapper.AddBoolean("EnablePropertyDefinitionEditingOnForms", this.EnablePropertyDefinitionEditingOnForms);
             dataReaderWrapper.Execute(transaction);
         }
         this.IsObjectDirty = false;
     }
     transaction = this.SaveCollections(connection, transaction);
     return(transaction);
 }
Exemplo n.º 4
0
 public override SqlTransaction Delete(SqlConnection connection, SqlTransaction transaction)
 {
     this.EnsureValidId();
     transaction = this.EnsureDatabasePrepared(connection, transaction);
     using (SqlDataReaderWrapper dataReaderWrapper = new SqlDataReaderWrapper(connection, false))
     {
         dataReaderWrapper.ProcedureName = "AdminUser_Delete";
         dataReaderWrapper.AddGuid("AdminUserId", this.Id);
         dataReaderWrapper.ExecuteNonQuery(transaction);
     }
     transaction = base.Delete(connection, transaction);
     return(transaction);
 }
Exemplo n.º 5
0
 protected new void SetLoadProcedureCall(SqlDataReaderWrapper dr)
 {
     dr.ProcedureName = "AdminUser_Load";
     dr.AddGuid("AdminUserId", this.Id);
 }