コード例 #1
0
        public static DeviceRepairRecord BuildDeviceRepairRecord(DeviceRepairRecordSource deviceRepairRecordSource)
        {
            if (deviceRepairRecordSource == null)
            {
                return(null);
            }

            var deviceRepairRecord = new DeviceRepairRecord();

            deviceRepairRecord.Content           = deviceRepairRecordSource.Content;
            deviceRepairRecord.CreationDate      = Utility.ConvertDateTime(deviceRepairRecordSource.CreationDate);
            deviceRepairRecord.Description       = deviceRepairRecordSource.Description;
            deviceRepairRecord.DeviceAlarmRecord = DeviceAlarmRecordTransfer.BuildDeviceAlarmRecord(deviceRepairRecordSource.DeviceAlarmRecord);
            deviceRepairRecord.DeviceInfo        = DeviceInfoTransfer.BuildDeviceInfo(deviceRepairRecordSource.DeviceInfo);
            deviceRepairRecord.FaultTime         = Utility.ConvertDateTime(deviceRepairRecordSource.FaultTime);
            deviceRepairRecord.Id              = deviceRepairRecordSource.Id;
            deviceRepairRecord.ModifiedDate    = Utility.ConvertDateTime(deviceRepairRecordSource.ModifiedDate);
            deviceRepairRecord.Persons         = deviceRepairRecordSource.Persons;
            deviceRepairRecord.Remark          = deviceRepairRecordSource.Remark;
            deviceRepairRecord.RepairBeginTime = Utility.ConvertDateTime(deviceRepairRecordSource.RepairBeginTime);
            deviceRepairRecord.RepairEndTime   = Utility.ConvertDateTime(deviceRepairRecordSource.RepairEndTime);
            deviceRepairRecord.Severity        = (DeviceRepairRecordSeverity)typeof(DeviceRepairRecordSeverity).GetEnumByValue(deviceRepairRecordSource.Severity);
            deviceRepairRecord.Source          = (DeviceRepairRecordSourceType)typeof(DeviceRepairRecordSourceType).GetEnumByValue(deviceRepairRecordSource.Source);
            deviceRepairRecord.Status          = (DeviceRepairRecordStatus)typeof(DeviceRepairRecordStatus).GetEnumByValue(deviceRepairRecordSource.Status);

            return(deviceRepairRecord);
        }
コード例 #2
0
        public static DeviceSparePartDeviceInfoMapping BuildDeviceSparePartDeviceInfoMapping(DeviceSparePartDeviceInfoMappingSource deviceSparePartDeviceInfoMappingSource)
        {
            if (deviceSparePartDeviceInfoMappingSource == null)
            {
                return(null);
            }

            var deviceSparePartDeviceInfoMapping = new DeviceSparePartDeviceInfoMapping();

            deviceSparePartDeviceInfoMapping.DeviceInfo      = DeviceInfoTransfer.BuildDeviceInfo(deviceSparePartDeviceInfoMappingSource.DeviceInfo);
            deviceSparePartDeviceInfoMapping.DeviceSparePart = DeviceSparePartTransfer.BuildDeviceSparePart(deviceSparePartDeviceInfoMappingSource.DeviceSparePart);

            return(deviceSparePartDeviceInfoMapping);
        }
コード例 #3
0
        public static DeviceAlarmRecord BuildDeviceAlarmRecord(DeviceAlarmRecordSource deviceAlarmRecordSource)
        {
            if (deviceAlarmRecordSource == null)
            {
                return(null);
            }

            var deviceAlarmRecord = new DeviceAlarmRecord();

            deviceAlarmRecord.AlarmTime  = Utility.ConvertDateTime(deviceAlarmRecordSource.AlarmTime);
            deviceAlarmRecord.DeviceInfo = DeviceInfoTransfer.BuildDeviceInfo(deviceAlarmRecordSource.DeviceInfo);
            deviceAlarmRecord.Id         = deviceAlarmRecordSource.Id;
            deviceAlarmRecord.Remark     = deviceAlarmRecordSource.Remark;
            deviceAlarmRecord.Severity   = (DeviceAlarmRecordSeverity)typeof(DeviceAlarmRecordSeverity).GetEnumByValue(deviceAlarmRecordSource.Severity);

            return(deviceAlarmRecord);
        }
コード例 #4
0
        public static DeviceCheckpoint BuildDeviceCheckpoint(DeviceCheckpointSource deviceCheckpointSource)
        {
            if (deviceCheckpointSource == null)
            {
                return(null);
            }

            var deviceCheckpoint = new DeviceCheckpoint();

            deviceCheckpoint.CreationDate = Utility.ConvertDateTime(deviceCheckpointSource.CreationDate);
            deviceCheckpoint.Description  = deviceCheckpointSource.Description;
            deviceCheckpoint.DeviceInfo   = DeviceInfoTransfer.BuildDeviceInfo(deviceCheckpointSource.DeviceInfo);
            deviceCheckpoint.Flag         = (DeviceCheckpointFlag)typeof(DeviceCheckpointFlag).GetEnumByValue(deviceCheckpointSource.Flag);
            deviceCheckpoint.Id           = deviceCheckpointSource.Id;
            deviceCheckpoint.LowerLimit   = deviceCheckpointSource.LowerLimit;
            deviceCheckpoint.Remark       = deviceCheckpointSource.Remark;
            deviceCheckpoint.UpperLimit   = deviceCheckpointSource.UpperLimit;
            deviceCheckpoint.ModifiedDate = Utility.ConvertDateTime(deviceCheckpointSource.ModifiedDate);

            return(deviceCheckpoint);
        }
コード例 #5
0
        public static MaintenancePlan BuildMaintenancePlan(MaintenancePlanSource maintenancePlanSource)
        {
            if (maintenancePlanSource == null)
            {
                return(null);
            }

            var maintenancePlan = new MaintenancePlan();

            maintenancePlan.Content       = maintenancePlanSource.Content;
            maintenancePlan.CreationDate  = Utility.ConvertDateTime(maintenancePlanSource.CreationDate);
            maintenancePlan.DeviceInfo    = DeviceInfoTransfer.BuildDeviceInfo(maintenancePlanSource.DeviceInfo);
            maintenancePlan.Id            = maintenancePlanSource.Id;
            maintenancePlan.ModifiedDate  = Utility.ConvertDateTime(maintenancePlanSource.ModifiedDate);
            maintenancePlan.Remark        = maintenancePlanSource.Remark;
            maintenancePlan.ScheduleType  = (MaintenancePlanScheduleType)typeof(MaintenancePlanScheduleType).GetEnumByValue(maintenancePlanSource.ScheduleType);
            maintenancePlan.ScheduleValue = maintenancePlanSource.ScheduleValue;
            maintenancePlan.Status        = (MaintenancePlanStatus)typeof(MaintenancePlanStatus).GetEnumByValue(maintenancePlanSource.Status);

            return(maintenancePlan);
        }
コード例 #6
0
        public static InspectionPlan BuildInspectionPlan(InspectionPlanSource inspectionPlanSource)
        {
            if (inspectionPlanSource == null)
            {
                return(null);
            }

            var inspectionPlan = new InspectionPlan();

            inspectionPlan.Content       = inspectionPlanSource.Content;
            inspectionPlan.CreationDate  = Utility.ConvertDateTime(inspectionPlanSource.CreationDate);
            inspectionPlan.DeviceInfo    = DeviceInfoTransfer.BuildDeviceInfo(inspectionPlanSource.DeviceInfo);
            inspectionPlan.Id            = inspectionPlanSource.Id;
            inspectionPlan.ModifiedDate  = Utility.ConvertDateTime(inspectionPlanSource.ModifiedDate);
            inspectionPlan.PeriodFrom    = Utility.ConvertDateTime(inspectionPlanSource.PeriodFrom);
            inspectionPlan.PeriodTo      = Utility.ConvertDateTime(inspectionPlanSource.PeriodTo);
            inspectionPlan.Remark        = inspectionPlanSource.Remark;
            inspectionPlan.ScheduleType  = (InspectionPlanScheduleType)typeof(InspectionPlanScheduleType).GetEnumByValue(inspectionPlanSource.ScheduleType);
            inspectionPlan.ScheduleValue = inspectionPlanSource.ScheduleValue;
            inspectionPlan.Status        = (InspectionRecordStatus)typeof(InspectionRecordStatus).GetEnumByValue(inspectionPlanSource.Status);

            return(inspectionPlan);
        }
コード例 #7
0
        public static InspectionRecord BuildInspectionRecord(InspectionRecordSource inspectionRecordSource)
        {
            if (inspectionRecordSource == null)
            {
                return(null);
            }

            var inspectionRecord = new InspectionRecord();

            inspectionRecord.Content           = inspectionRecordSource.Content;
            inspectionRecord.CreationDate      = Utility.ConvertDateTime(inspectionRecordSource.CreationDate);
            inspectionRecord.DeviceInfo        = DeviceInfoTransfer.BuildDeviceInfo(inspectionRecordSource.DeviceInfo);
            inspectionRecord.Id                = inspectionRecordSource.Id;
            inspectionRecord.InspectionPlan    = InspectionPlanTransfer.BuildInspectionPlan(inspectionRecordSource.InspectionPlan);
            inspectionRecord.MaintainBeginTime = Utility.ConvertDateTime(inspectionRecordSource.MaintainBeginTime);
            inspectionRecord.MaintainEndTime   = Utility.ConvertDateTime(inspectionRecordSource.MaintainEndTime);
            inspectionRecord.ModifiedDate      = Utility.ConvertDateTime(inspectionRecordSource.ModifiedDate);
            inspectionRecord.Persons           = inspectionRecordSource.Persons;
            inspectionRecord.Remark            = inspectionRecordSource.Remark;
            inspectionRecord.ScheduleTime      = Utility.ConvertDateTime(inspectionRecordSource.ScheduleTime);
            inspectionRecord.Status            = (InspectionRecordStatus)typeof(InspectionRecordStatus).GetEnumByValue(inspectionRecordSource.Status);

            return(inspectionRecord);
        }
コード例 #8
0
        public static MaintenanceRecord BuildMaintenanceRecord(MaintenanceRecordSource maintenanceRecordSource)
        {
            if (maintenanceRecordSource == null)
            {
                return(null);
            }

            var maintenanceRecord = new MaintenanceRecord();

            maintenanceRecord.Content           = maintenanceRecordSource.Content;
            maintenanceRecord.CreationDate      = Utility.ConvertDateTime(maintenanceRecordSource.CreationDate);
            maintenanceRecord.DeviceInfo        = DeviceInfoTransfer.BuildDeviceInfo(maintenanceRecordSource.DeviceInfo);
            maintenanceRecord.Id                = maintenanceRecordSource.Id;
            maintenanceRecord.MaintainBeginTime = Utility.ConvertDateTime(maintenanceRecordSource.MaintainBeginTime);
            maintenanceRecord.MaintainEndTime   = Utility.ConvertDateTime(maintenanceRecordSource.MaintainEndTime);
            maintenanceRecord.MaintenancePlan   = MaintenancePlanTransfer.BuildMaintenancePlan(maintenanceRecordSource.MaintenancePlan);
            maintenanceRecord.ModifiedDate      = Utility.ConvertDateTime(maintenanceRecordSource.ModifiedDate);
            maintenanceRecord.Persons           = maintenanceRecordSource.Persons;
            maintenanceRecord.Remark            = maintenanceRecordSource.Remark;
            maintenanceRecord.ScheduleTime      = Utility.ConvertDateTime(maintenanceRecordSource.ScheduleTime);
            maintenanceRecord.Status            = (MaintenanceRecordStatus)typeof(MaintenanceRecordStatus).GetEnumByValue(maintenanceRecordSource.Status);

            return(maintenanceRecord);
        }