Exemplo n.º 1
0
 /// <summary>
 /// 清楚数据为空的项
 /// </summary>
 /// <param name="devModels"></param>
 /// <param name="modelBll"></param>
 /// <param name="devTypes"></param>
 /// <param name="typeBll"></param>
 private void ClearModelTypeNullData(List <DevModel> devModels, DevModelBll modelBll, List <DevType> devTypes, DevTypeBll typeBll)
 {
     try
     {
         List <DevModel> emptyModels = new List <DevModel>();
         List <DevType>  emptyTypes  = new List <DevType>();
         foreach (var model in devModels)
         {
             if (string.IsNullOrEmpty(model.Name))
             {
                 emptyModels.Add(model);
             }
         }
         foreach (var type in devTypes)
         {
             if (string.IsNullOrEmpty(type.TypeName))
             {
                 emptyTypes.Add(type);
             }
         }
         if (emptyModels.Count != 0)
         {
             modelBll.RemoveList(emptyModels);
         }
         if (emptyTypes.Count != 0)
         {
             typeBll.RemoveList(emptyTypes);
         }
         Log.Info(string.Format("EmpeyModel Count:{0} EmptyType Count:{1}", emptyModels.Count, emptyTypes.Count));
     }catch (Exception e)
     {
         Log.Info("Dbinitializer.ClearModelTypeNullData.Error");
     }
 }
Exemplo n.º 2
0
        public Bll(bool autoDetectChangesEnabled, bool lazyLoadingEnabled, bool isCreateDb, bool useProxy = true)
        {
            Db = new LocationDb(isCreateDb);
            Db.Configuration.AutoDetectChangesEnabled = autoDetectChangesEnabled;
            Db.Configuration.LazyLoadingEnabled       = lazyLoadingEnabled; //关闭延迟加载
            Db.Configuration.ProxyCreationEnabled     = useProxy;

            if (ShowLog)
            {
                Db.Database.Log = Log.Debug;
            }


            Archors                        = new ArchorBll(Db);
            Areas                          = new AreaBll(Db);
            Bounds                         = new BoundBll(Db);
            ConfigArgs                     = new ConfigArgBll(Db);
            Departments                    = new DepartmentBll(Db);
            DevAlarms                      = new DevAlarmBll(Db);
            DevInfos                       = new DevInfoBll(Db);
            Dev_DoorAccess                 = new Dev_DoorAccessBll(Db);
            Dev_CameraInfos                = new Dev_CameraInfoBll(Db);
            DevInstantDatas                = new DevInstantDataBll(Db);
            DevModels                      = new DevModelBll(Db);
            DevTypes                       = new DevTypeBll(Db);
            EntranceGuardCards             = new EntranceGuardCardBll(Db);
            EntranceGuardCardToPersonnels  = new EntranceGuardCardToPersonnelBll(Db);
            AreaAuthorizations             = new AreaAuthorizationBll(Db);
            AreaAuthorizationRecords       = new AreaAuthorizationRecordBll(Db);
            KKSCodes                       = new KKSCodeBll(Db);
            LocationAlarms                 = new LocationAlarmBll(Db);
            LocationCards                  = new LocationCardBll(Db);
            LocationCardPositions          = new LocationCardPositionBll(Db);
            LocationCardToPersonnels       = new LocationCardToPersonnelBll(Db);
            MobileInspections              = new MobileInspectionBll(Db);
            MobileInspectionContents       = new MobileInspectionContentBll(Db);
            MobileInspectionDevs           = new MobileInspectionDevBll(Db);
            MobileInspectionItems          = new MobileInspectionItemBll(Db);
            NodeKKSs                       = new NodeKKSBll(Db);
            OperationItems                 = new OperationItemBll(Db);
            OperationTickets               = new OperationTicketBll(Db);
            Personnels                     = new PersonnelBll(Db);
            PersonnelMobileInspections     = new PersonnelMobileInspectionBll(Db);
            PersonnelMobileInspectionItems = new PersonnelMobileInspectionItemBll(Db);
            Points                         = new PointBll(Db);
            Posts                          = new PostBll(Db);
            Roles                          = new RoleBll(Db);
            SafetyMeasuress                = new SafetyMeasuresBll(Db);
            WorkTickets                    = new WorkTicketBll(Db);
            Pictures                       = new PictureBll(Db);
            ArchorSettings                 = new ArchorSettingBll(Db);
            CardRoles                      = new CardRoleBll(Db);
            DevMonitorNodes                = new DevMonitorNodeBll(Db);
            //Shapes = new ShapeBll(Db);
            //ShapePoints = new ShapePointBll();

            DevAlarmHistorys                      = new DevAlarmHistoryBll(DbHistory);
            DevEntranceGuardCardActions           = new DevEntranceGuardCardActionBll(DbHistory);
            DevInfoHistorys                       = new DevInfoHistoryBll(DbHistory);
            DevInstantDataHistorys                = new DevInstantDataHistoryBll(DbHistory);
            EntranceGuardCardHistorys             = new EntranceGuardCardHistoryBll(DbHistory);
            EntranceGuardCardToPersonnelHistorys  = new EntranceGuardCardToPersonnelHistoryBll(DbHistory);
            LocationAlarmHistorys                 = new LocationAlarmHistoryBll(DbHistory);
            LocationCardHistorys                  = new LocationCardHistoryBll(DbHistory);
            LocationCardToPersonnelHistorys       = new LocationCardToPersonnelHistoryBll(DbHistory);
            OperationItemHistorys                 = new OperationItemHistoryBll(DbHistory);
            OperationTicketHistorys               = new OperationTicketHistoryBll(DbHistory);
            PersonnelHistorys                     = new PersonnelHistoryBll(DbHistory);
            PersonnelMobileInspectionHistorys     = new PersonnelMobileInspectionHistoryBll(DbHistory);
            PersonnelMobileInspectionItemHistorys = new PersonnelMobileInspectionItemHistoryBll(DbHistory);
            Positions = new PositionBll(DbHistory);
            SafetyMeasuresHistorys = new SafetyMeasuresHistoryBll(DbHistory);
            U3DPositions           = new U3DPositionBll(DbHistory);
            WorkTicketHistorys     = new WorkTicketHistoryBll(DbHistory);


            bus_anchors            = new bus_anchorBll(DbE);
            bus_tags               = new bus_tagBll(DbE);
            bus_anchor_config      = new bus_anchor_configBll(DbE);
            bus_anchor_switch_area = new bus_anchor_switch_areaBll(DbE);

            //LocationCards.ToList();
            //DevEntranceGuardCardActions.ToList();
            //bus_archors.ToList();

            Z.EntityFramework.Extensions.LicenseManager.AddLicense("34;100-LLHSWWHA", "384799A60700037CBFC0EB5E03A62474");
        }