Ejemplo n.º 1
0
        public static DeviceRepairRecordSource BuildDeviceRepairRecordSource(DeviceRepairRecord deviceRepairRecord)
        {
            if (deviceRepairRecord == null)
            {
                return(null);
            }

            var deviceRepairRecordSource = new DeviceRepairRecordSource();

            deviceRepairRecordSource.Content           = deviceRepairRecord.Content;
            deviceRepairRecordSource.Description       = deviceRepairRecordSource.Description;
            deviceRepairRecordSource.DeviceAlarmRecord = DeviceAlarmRecordTransfer.BuildDeviceAlarmRecordSource(deviceRepairRecord.DeviceAlarmRecord);
            deviceRepairRecordSource.DeviceInfo        = DeviceInfoTransfer.BuildDeviceInfoSource(deviceRepairRecord.DeviceInfo);
            deviceRepairRecordSource.FaultTime         = Utility.ConvertDateTime(deviceRepairRecord.FaultTime);
            deviceRepairRecordSource.Id              = deviceRepairRecord.Id;
            deviceRepairRecordSource.Persons         = deviceRepairRecord.Persons;
            deviceRepairRecordSource.Remark          = deviceRepairRecord.Remark;
            deviceRepairRecordSource.RepairBeginTime = Utility.ConvertDateTime(deviceRepairRecord.RepairBeginTime);
            deviceRepairRecordSource.RepairEndTime   = Utility.ConvertDateTime(deviceRepairRecord.RepairEndTime);
            deviceRepairRecordSource.Severity        = typeof(DeviceRepairRecordSeverity).GetValueByEnum(deviceRepairRecord.Severity);
            deviceRepairRecordSource.Source          = typeof(DeviceRepairRecordSourceType).GetValueByEnum(deviceRepairRecord.Source);
            deviceRepairRecordSource.Status          = typeof(DeviceRepairRecordStatus).GetValueByEnum(deviceRepairRecord.Status);

            return(deviceRepairRecordSource);
        }
Ejemplo n.º 2
0
        public static DeviceAlarmRecordSource BuildDeviceAlarmRecordSource(DeviceAlarmRecord deviceAlarmRecord)
        {
            if (deviceAlarmRecord == null)
            {
                return(null);
            }

            var deviceAlarmRecordSource = new DeviceAlarmRecordSource();

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

            return(deviceAlarmRecordSource);
        }
Ejemplo n.º 3
0
        public static DeviceCheckpointSource BuildDeviceCheckpointSource(DeviceCheckpoint deviceCheckpoint)
        {
            if (deviceCheckpoint == null)
            {
                return(null);
            }

            var deviceCheckpointSource = new DeviceCheckpointSource();

            deviceCheckpointSource.Description = deviceCheckpoint.Description;
            deviceCheckpointSource.DeviceInfo  = DeviceInfoTransfer.BuildDeviceInfoSource(deviceCheckpoint.DeviceInfo);
            deviceCheckpointSource.Flag        = typeof(DeviceCheckpointFlag).GetValueByEnum(deviceCheckpoint.Flag);
            deviceCheckpointSource.Id          = deviceCheckpoint.Id;
            deviceCheckpointSource.LowerLimit  = deviceCheckpoint.LowerLimit;
            deviceCheckpointSource.Remark      = deviceCheckpoint.Remark;
            deviceCheckpointSource.UpperLimit  = deviceCheckpoint.UpperLimit;

            return(deviceCheckpointSource);
        }
Ejemplo n.º 4
0
        public static InspectionPlanSource BuildInspectionPlanSource(InspectionPlan inspectionPlan)
        {
            if (inspectionPlan == null)
            {
                return(null);
            }

            var inspectionPlanSource = new InspectionPlanSource();

            inspectionPlanSource.Content       = inspectionPlan.Content;
            inspectionPlanSource.DeviceInfo    = DeviceInfoTransfer.BuildDeviceInfoSource(inspectionPlan.DeviceInfo);
            inspectionPlanSource.Id            = inspectionPlanSource.Id;
            inspectionPlanSource.PeriodFrom    = Utility.ConvertDateTime(inspectionPlan.PeriodFrom);
            inspectionPlanSource.PeriodTo      = Utility.ConvertDateTime(inspectionPlan.PeriodTo);
            inspectionPlanSource.Remark        = inspectionPlan.Remark;
            inspectionPlanSource.ScheduleType  = typeof(InspectionPlanScheduleType).GetValueByEnum(inspectionPlan.ScheduleType);
            inspectionPlanSource.ScheduleValue = inspectionPlan.ScheduleValue;
            inspectionPlanSource.Status        = typeof(InspectionRecordStatus).GetValueByEnum(inspectionPlan.Status);

            return(inspectionPlanSource);
        }
Ejemplo n.º 5
0
        public static MaintenancePlanSource BuildMaintenancePlanSource(MaintenancePlan maintenancePlan)
        {
            if (maintenancePlan == null)
            {
                return(null);
            }

            var maintenancePlanSource = new MaintenancePlanSource();

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

            return(maintenancePlanSource);
        }
Ejemplo n.º 6
0
        public static InspectionRecordSource BuildInspectionRecordSource(InspectionRecord inspectionRecord)
        {
            if (inspectionRecord == null)
            {
                return(null);
            }

            var inspectionRecordSource = new InspectionRecordSource();

            inspectionRecordSource.Content           = inspectionRecord.Content;
            inspectionRecordSource.DeviceInfo        = DeviceInfoTransfer.BuildDeviceInfoSource(inspectionRecord.DeviceInfo);
            inspectionRecordSource.Id                = inspectionRecord.Id;
            inspectionRecordSource.InspectionPlan    = InspectionPlanTransfer.BuildInspectionPlanSource(inspectionRecord.InspectionPlan);
            inspectionRecordSource.MaintainBeginTime = Utility.ConvertDateTime(inspectionRecord.MaintainBeginTime);
            inspectionRecordSource.MaintainEndTime   = Utility.ConvertDateTime(inspectionRecord.MaintainEndTime);
            inspectionRecordSource.Persons           = inspectionRecord.Persons;
            inspectionRecordSource.Remark            = inspectionRecord.Remark;
            inspectionRecordSource.ScheduleTime      = Utility.ConvertDateTime(inspectionRecord.ScheduleTime);
            inspectionRecordSource.Status            = typeof(InspectionRecordStatus).GetValueByEnum(inspectionRecord.Status);

            return(inspectionRecordSource);
        }
Ejemplo n.º 7
0
        public static MaintenanceRecordSource BuildMaintenanceRecordSource(MaintenanceRecord maintenanceRecord)
        {
            if (maintenanceRecord == null)
            {
                return(null);
            }

            var maintenanceRecordSource = new MaintenanceRecordSource();

            maintenanceRecordSource.Content           = maintenanceRecord.Content;
            maintenanceRecordSource.DeviceInfo        = DeviceInfoTransfer.BuildDeviceInfoSource(maintenanceRecord.DeviceInfo);
            maintenanceRecordSource.Id                = maintenanceRecord.Id;
            maintenanceRecordSource.MaintainBeginTime = Utility.ConvertDateTime(maintenanceRecord.MaintainBeginTime);
            maintenanceRecordSource.MaintainEndTime   = Utility.ConvertDateTime(maintenanceRecord.MaintainEndTime);
            maintenanceRecordSource.MaintenancePlan   = MaintenancePlanTransfer.BuildMaintenancePlanSource(maintenanceRecord.MaintenancePlan);
            maintenanceRecordSource.Persons           = maintenanceRecord.Persons;
            maintenanceRecordSource.Remark            = maintenanceRecord.Remark;
            maintenanceRecordSource.ScheduleTime      = Utility.ConvertDateTime(maintenanceRecord.ScheduleTime);
            maintenanceRecordSource.Status            = typeof(MaintenanceRecordStatus).GetValueByEnum(maintenanceRecord.Status);

            return(maintenanceRecordSource);
        }