/// <summary> /// 手动复制到指定的对象中,出发通知事件 /// </summary> /// <param name="objectDevInfo"></param> public void ValueCloneToObject(DeviveInfo objectDevInfo) { objectDevInfo.CollectProgress = this.deviceState == DeviceState.PauseCollect || object.Equals(this.CollectProgress, null) ? objectDevInfo.CollectProgress : this.CollectProgress; objectDevInfo.Description = object.Equals(this.Description, null) ? objectDevInfo.Description : this.Description; objectDevInfo.DeviceAlias = object.Equals(this.DeviceAlias, null) ? objectDevInfo.DeviceAlias : this.DeviceAlias; objectDevInfo.PortCode = object.Equals(this.PortCode, null) ? objectDevInfo.PortCode : this.PortCode; objectDevInfo.deviceCode = object.Equals(this.deviceCode, null) ? objectDevInfo.deviceCode : this.deviceCode; objectDevInfo.DeviceIconID = object.Equals(this.DeviceIconID, null) ? objectDevInfo.DeviceIconID : this.DeviceIconID; objectDevInfo.Electricity = object.Equals(this.Electricity, null) || this.Electricity.Equals("-1") ? objectDevInfo.Electricity : this.Electricity; objectDevInfo.LastUpdateTime = object.Equals(this.LastUpdateTime, null) ? objectDevInfo.LastUpdateTime : this.LastUpdateTime; objectDevInfo.MatchOrgID = object.Equals(this.MatchOrgID, null) ? objectDevInfo.MatchOrgID : this.MatchOrgID; objectDevInfo.MatchOrgName = object.Equals(this.MatchOrgName, null) ? objectDevInfo.MatchOrgName : this.MatchOrgName; objectDevInfo.MatchTime = object.Equals(this.MatchTime, null) ? objectDevInfo.MatchTime : this.MatchTime; objectDevInfo.MatchUserCode = object.Equals(this.MatchUserCode, null) ? objectDevInfo.MatchUserCode : this.MatchUserCode; objectDevInfo.MatchUserID = object.Equals(this.MatchUserID, null) ? objectDevInfo.MatchUserID : this.MatchUserID; objectDevInfo.MatchUserName = object.Equals(this.MatchUserName, null) ? objectDevInfo.MatchUserName : this.MatchUserName; objectDevInfo.RegisterIp = object.Equals(this.RegisterIp, null) ? objectDevInfo.RegisterIp : this.RegisterIp; objectDevInfo.RegisterStationID = object.Equals(this.RegisterStationID, null) ? objectDevInfo.RegisterStationID : this.RegisterStationID; objectDevInfo.RegisterTime = object.Equals(this.RegisterTime, null) ? objectDevInfo.RegisterTime : this.RegisterTime; objectDevInfo.RegisterUser = object.Equals(this.RegisterUser, null) ? objectDevInfo.RegisterUser : this.RegisterUser; objectDevInfo.VenderID = object.Equals(this.VenderID, null) ? objectDevInfo.VenderID : this.VenderID; objectDevInfo.VenderName = object.Equals(this.VenderName, null) ? objectDevInfo.VenderName : this.VenderName; objectDevInfo.Volume = object.Equals(this.Volume, null) ? objectDevInfo.Volume : this.Volume; objectDevInfo.DeviceState = this.DeviceState != Model.DeviceState.UnDefine ? this.DeviceState : objectDevInfo.DeviceState; objectDevInfo.IsMatchOrRegist = this.IsMatchOrRegist != IsMatchOrRegist.UnDefine ? this.IsMatchOrRegist : objectDevInfo.IsMatchOrRegist; }
/// <summary> /// 除空值不复制 /// </summary> /// <param name="objectDevInfo"></param> public void ValueCloneToObjectExceptNull(DeviveInfo objectDevInfo) { // 暂停时不更新采集进度 objectDevInfo.CollectProgress = this.deviceState == DeviceState.PauseCollect || object.Equals(this.CollectProgress, null) ? objectDevInfo.CollectProgress : this.CollectProgress; objectDevInfo.Description = object.Equals(this.Description, null) ? objectDevInfo.Description : this.Description; objectDevInfo.DeviceAlias = object.Equals(this.DeviceAlias, null) ? objectDevInfo.DeviceAlias : this.DeviceAlias; objectDevInfo.PortCode = object.Equals(this.PortCode, null) ? objectDevInfo.PortCode : this.PortCode; objectDevInfo.DeviceCode = object.Equals(this.DeviceCode, null) ? objectDevInfo.DeviceCode : this.DeviceCode; objectDevInfo.DeviceIconID = object.Equals(this.DeviceIconID, null) ? objectDevInfo.DeviceIconID : this.DeviceIconID; objectDevInfo.Electricity = object.Equals(this.Electricity, null) || this.Electricity.Equals("-1") ? objectDevInfo.Electricity : this.Electricity; objectDevInfo.LastUpdateTime = object.Equals(this.LastUpdateTime, null) ? objectDevInfo.LastUpdateTime : this.LastUpdateTime; objectDevInfo.MatchOrgID = object.Equals(this.MatchOrgID, null) ? objectDevInfo.MatchOrgID : this.MatchOrgID; objectDevInfo.MatchOrgName = object.Equals(this.MatchOrgName, null) ? objectDevInfo.MatchOrgName : this.MatchOrgName; objectDevInfo.MatchTime = object.Equals(this.MatchTime, null) ? objectDevInfo.MatchTime : this.MatchTime; objectDevInfo.MatchUserCode = object.Equals(this.MatchUserCode, null) ? objectDevInfo.MatchUserCode : this.MatchUserCode; objectDevInfo.MatchUserID = object.Equals(this.MatchUserID, null) ? objectDevInfo.MatchUserID : this.MatchUserID; objectDevInfo.MatchUserName = object.Equals(this.MatchUserName, null) ? objectDevInfo.MatchUserName : this.MatchUserName; objectDevInfo.RegisterIp = object.Equals(this.RegisterIp, null) ? objectDevInfo.RegisterIp : this.RegisterIp; objectDevInfo.RegisterStationID = object.Equals(this.RegisterStationID, null) ? objectDevInfo.RegisterStationID : this.RegisterStationID; objectDevInfo.RegisterTime = object.Equals(this.RegisterTime, null) ? objectDevInfo.RegisterTime : this.RegisterTime; objectDevInfo.RegisterUser = object.Equals(this.RegisterUser, null) ? objectDevInfo.RegisterUser : this.RegisterUser; objectDevInfo.VenderID = object.Equals(this.VenderID, null) ? objectDevInfo.VenderID : this.VenderID; objectDevInfo.VenderName = object.Equals(this.VenderName, null) ? objectDevInfo.VenderName : this.VenderName; objectDevInfo.Volume = object.Equals(this.Volume, null) ? objectDevInfo.Volume : this.Volume; objectDevInfo.TotalVolume = object.Equals(this.TotalVolume, null) ? objectDevInfo.TotalVolume : this.TotalVolume; objectDevInfo.DeviceState = this.DeviceState != Model.DeviceState.UnDefine ? this.DeviceState : objectDevInfo.DeviceState; objectDevInfo.IsMatchOrRegist = this.IsMatchOrRegist != IsMatchOrRegist.UnDefine ? this.IsMatchOrRegist : objectDevInfo.IsMatchOrRegist; if (!string.IsNullOrEmpty(objectDevInfo.Volume) && !string.IsNullOrEmpty(objectDevInfo.TotalVolume)) { objectDevInfo.UseVolume = (Convert.ToDouble(objectDevInfo.TotalVolume) - Convert.ToDouble(objectDevInfo.Volume)).ToString(); } else { objectDevInfo.Volume = "0"; objectDevInfo.TotalVolume = "0"; objectDevInfo.UseVolume = "0"; } }