예제 #1
0
        private IList<VAlarmInfo> CreateVAlarmInfo(IList<EAlarmInfo> list, Dictionary<Guid, string> dic)
        {
            IList<VAlarmInfo> ltVAlarmInfo = new List<VAlarmInfo>();
            foreach (var item in list)
            {
                // var smsAndUser = ltSMSAndUser.SingleOrDefault(s => s.SMSInfoID == item.WebSMSInfoID);

                VAlarmInfo vAlarmInfo = new VAlarmInfo();
                vAlarmInfo.RecordID = item.RecordID;
                vAlarmInfo.ACCState = item.ACCState;
                vAlarmInfo.AlarmGrade = item.AlarmGrade;
                vAlarmInfo.DriverName = item.DriverName;
                vAlarmInfo.DriverPhone = item.DriverPhone;
                vAlarmInfo.GPSTime = item.GPSTime;
                vAlarmInfo.IsLock = item.IsLock;
                if (dic.ContainsKey(item.VehicleCode))
                {
                    vAlarmInfo.LicensePlate = dic[item.VehicleCode];
                }
                vAlarmInfo.LockUser = item.LockUser;
                vAlarmInfo.ProcessState = item.ProcessState;
                if (item.ProcessTime.HasValue)
                {
                    vAlarmInfo.ProcessTime = item.ProcessTime.Value;
                }
                vAlarmInfo.Position = item.Position;
                vAlarmInfo.ProcessUser = item.ProcessUser;
                vAlarmInfo.Remark = item.Remark;
                vAlarmInfo.SMSInfoType = item.SMSInfoType;
                vAlarmInfo.Speed = item.Speed;
                vAlarmInfo.StarkMileage = item.StarkMileage;
                vAlarmInfo.VehicleCode = item.VehicleCode;
                if (item.WebSMSInfoID.HasValue)
                {
                    vAlarmInfo.WebSMSInfoID = item.WebSMSInfoID.Value;
                }
                //if (smsAndUser != null)
                //{
                //    vAlarmInfo.WebSMSAndUserID = smsAndUser.RecordID;
                //    vAlarmInfo.IsRead = Convert.ToInt32(smsAndUser.IsRead);

                //}
                vAlarmInfo.IsEffective = item.IsEffective;
                ltVAlarmInfo.Add(vAlarmInfo);
            }
            return ltVAlarmInfo;
        }
예제 #2
0
 private VAlarmInfo CreateVAlarmInfo(EAlarmInfo eAlarmInfo,  string licensePlate)
 {
     VAlarmInfo vAlarmInfo = new VAlarmInfo();
     vAlarmInfo.RecordID = eAlarmInfo.RecordID;
     vAlarmInfo.ACCState = eAlarmInfo.ACCState;
     vAlarmInfo.AlarmGrade = eAlarmInfo.AlarmGrade;
     vAlarmInfo.DriverName = eAlarmInfo.DriverName;
     vAlarmInfo.DriverPhone = eAlarmInfo.DriverPhone;
     vAlarmInfo.GPSTime = eAlarmInfo.GPSTime;
     vAlarmInfo.IsLock = eAlarmInfo.IsLock;
     vAlarmInfo.LicensePlate = licensePlate;          
     vAlarmInfo.LockUser = eAlarmInfo.LockUser;
     vAlarmInfo.ProcessState = eAlarmInfo.ProcessState;
     if (eAlarmInfo.ProcessTime.HasValue)
     {
         vAlarmInfo.ProcessTime = eAlarmInfo.ProcessTime.Value;
     }
     vAlarmInfo.ProcessUser = eAlarmInfo.ProcessUser;
     vAlarmInfo.Position = eAlarmInfo.Position;
     vAlarmInfo.Remark = eAlarmInfo.Remark;
     vAlarmInfo.SMSInfoType = eAlarmInfo.SMSInfoType;
     vAlarmInfo.Speed = eAlarmInfo.Speed;
     vAlarmInfo.StarkMileage = eAlarmInfo.StarkMileage;
     vAlarmInfo.VehicleCode = eAlarmInfo.VehicleCode; 
     if (eAlarmInfo.WebSMSInfoID.HasValue)
     {
         vAlarmInfo.WebSMSInfoID = eAlarmInfo.WebSMSInfoID.Value;
     }
     
     vAlarmInfo.IsEffective = eAlarmInfo.IsEffective;
     return vAlarmInfo;
 }