public void Add(EAlarmInfo entity) { using (IRepository repository = SessionManager.CreateRepository(typeof(EAlarmInfo))) { repository.Save(entity); } }
protected EAlarmInfo CreateAlarmEntity(AlarmHandleContext context, EBaseAlertReport report, EWebSMSInfo webSMS) { EAlarmInfo eAlarmInfo = new EAlarmInfo(); eAlarmInfo.ACCState = report.ACCState; eAlarmInfo.AlarmGrade = (int)report.EnumAlarmGrade; eAlarmInfo.GPSTime = report.GPSReportTime; eAlarmInfo.IsLock = false; eAlarmInfo.ProcessState = (int)EnumProcessState.UnProcess; eAlarmInfo.Position = this.GetPlaceName(context, report.Latitude, report.Longitude); eAlarmInfo.SMSInfoType = (int)report.EnumSMSInfoType; eAlarmInfo.Speed = report.Speed; eAlarmInfo.StarkMileage = report.VStarkMileage; eAlarmInfo.VehicleCode = report.VehicleCode; eAlarmInfo.WebSMSInfoID = webSMS.RecordID; return eAlarmInfo; }
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; }