protected void btnQuery2_Click(object sender, EventArgs e) { IList<VCommonAlertSeeting> list = new List<VCommonAlertSeeting>(); IAlertSettingService db = new AlertSettingService(); list = db.SearchCommonAlertSeeting(null, EnumVehicleType.Taxi); dgv.DataSource = list; dgv.DataBind(); }
protected void btnQuery_Click(object sender, EventArgs e) { IList<ERobAlertSetting> list = new List<ERobAlertSetting>(); ERobAlertSetting entity = new ERobAlertSetting(); IAlertSettingService db=new AlertSettingService(); list = db.Search<ERobAlertSetting>("粤", EnumVehicleType.Taxi); if(list.Count>0) { //list.Add(entity); dgv.DataSource = list; dgv.DataBind(); } }
private bool IsHaveSetted() { IAlertSettingService alertSettingService = new AlertSettingService(); //查询所有当前有效的绑定关系的车辆的设置列表 _settings = alertSettingService.GetEnableEntity<EOfflineTimeoutAlertSetting>(); _MOVOVehicleDict = alertSettingService.GetMovoVehicleDict(); if (_settings == null || _settings.Count == 0) { return false; } Logger.Info(string.Format("一共读取到数据库有{0}个超时提醒配置.", _settings.Count)); return true; }
protected void btnUpdate_Click(object sender, EventArgs e) { ERobAlertSetting entity = new ERobAlertSetting(); entity.RecordID = Guid.NewGuid(); entity.VehicleCode = new Guid(txtVehicleCode.Text); entity.UserCode = txtUserCode.Text; entity.TenantCode = txtTenantCode.Text; entity.CreateTime = DateTime.Parse(txtCreateDate.Text); entity.MobileReceiveBeginTime = DateTime.Parse(txtMobileReceiveBeginTime.Text).TimeOfDay; entity.MobileReceiveEndTime = DateTime.Parse(txtMobileReceiveEndTime.Text).TimeOfDay; entity.UserReceiveBeginTime = DateTime.Parse(txtUserReceiveBeginTime.Text).TimeOfDay; entity.UserReceiveEndTime = DateTime.Parse(txtUserReceiveEndTime.Text).TimeOfDay; entity.ReceiveMobileList = txtReceiveMobileList.Text; entity.ReceiveUserList = txtReceiveUserList.Text; entity.EnableSMS = Convert.ToBoolean(txtEableSMS.Text); entity.Enable = Convert.ToBoolean(txtEnable.Text); IAlertSettingService db = new AlertSettingService(); db.Update<ERobAlertSetting>(entity); }
/// <summary> /// 定时提醒 /// </summary> /// <param name="vehicleCode"></param> /// <returns></returns> public IList<ETimingAlertSetting> GetTimingAlertSetting(Guid vehicleCode) { IList<Guid> vehicleCodeList = new List<Guid>(); vehicleCodeList.Add(vehicleCode); AlertSettingService serv = new AlertSettingService(); IList<ETimingAlertSetting> timingAlertList = serv.Search<ETimingAlertSetting>(vehicleCodeList, false); return timingAlertList; }
/// <summary> /// 停车未熄火提醒 /// </summary> /// <param name="vehicleCode"></param> /// <returns></returns> public EStopCarAccOnAlertSetting GetStopCarAccOnAlertSetting(Guid vehicleCode) { IList<Guid> vehicleCodeList = new List<Guid>(); vehicleCodeList.Add(vehicleCode); AlertSettingService serv = new AlertSettingService(); IList<EStopCarAccOnAlertSetting> stopCarAccOnAlertList = serv.Search<EStopCarAccOnAlertSetting>(vehicleCodeList, false); if (stopCarAccOnAlertList.Count > 0) { return stopCarAccOnAlertList[0]; } return null; }
/// <summary> /// 超速提醒 /// </summary> /// <param name="vehicleCode"></param> /// <returns></returns> public EOverSpeedAlertSetting GetOverSpeedAlertSetting(Guid vehicleCode) { IList<Guid> vehicleCodeList = new List<Guid>(); vehicleCodeList.Add(vehicleCode); AlertSettingService serv = new AlertSettingService(); IList<EOverSpeedAlertSetting> overSpeedAlertList = serv.Search<EOverSpeedAlertSetting>(vehicleCodeList, false); if (overSpeedAlertList.Count > 0) { return overSpeedAlertList[0]; } return null; }
/// <summary> /// 疲劳驾驶提醒 /// </summary> /// <param name="vehicleCode"></param> /// <returns></returns> public EFatigueDrivingAlertSetting GetFatigueDrivingAlertSetting(Guid vehicleCode) { IList<Guid> vehicleCodeList = new List<Guid>(); vehicleCodeList.Add(vehicleCode); AlertSettingService serv = new AlertSettingService(); IList<EFatigueDrivingAlertSetting> fatAlertList = serv.Search<EFatigueDrivingAlertSetting>(vehicleCodeList, false); if (fatAlertList.Count > 0) { return fatAlertList[0]; } return null; }
/// <summary> /// 断电报警 /// </summary> /// <param name="vehicleCode"></param> /// <returns></returns> public EPowerDownAlertSetting GetPowerDownAlertSetting(Guid vehicleCode) { IList<Guid> vehicleCodeList = new List<Guid>(); vehicleCodeList.Add(vehicleCode); AlertSettingService serv = new AlertSettingService(); IList<EPowerDownAlertSetting> powerDownAlertList = serv.Search<EPowerDownAlertSetting>(vehicleCodeList, false); if (powerDownAlertList.Count > 0) { return powerDownAlertList[0]; } return null; }
/// <summary> /// 劫车报警 /// </summary> /// <param name="vehicleCode"></param> /// <returns></returns> public ERobAlertSetting GetRobAlertSetting(Guid vehicleCode) { IList<Guid> vehicleCodeList = new List<Guid>(); vehicleCodeList.Add(vehicleCode); AlertSettingService serv = new AlertSettingService(); IList<ERobAlertSetting> robAlertList = serv.Search<ERobAlertSetting>(vehicleCodeList, false); if (robAlertList.Count > 0) { return robAlertList[0]; } return null; }
private void Alert(AlarmHandleContext context, EGPSCurrentInfo current,EFortifyAlertsetting setting, bool isAlert) { DateTime dt1 = DateTime.Now; EFortifyAlertReport alertReport = this.CreateAlertReport(context, current, setting); GPSServiceFacade.Report.Fortify.Add<EFortifyAlertReport>(alertReport); Logger.Info(string.Format("Static_FortifyAlertReportService.Add<EFortifyAlertReport>(alertReport)共花销{0}毫秒", (DateTime.Now - dt1).TotalMilliseconds)); if (isAlert) { if (setting.EnableSMS || setting.Enable) { if (setting.EnableSMS && this.IsInMobileReceiveTime(alertReport)) { this.SendSMS(context, alertReport); } if (setting.Enable && this.IsInUserReceiveTime(alertReport)) { this.SendWebSiteSMS(context, alertReport); } try { //撤销设防 IAlertSettingService s = new AlertSettingService(); s.Delete<EFortifyAlertsetting>(setting.RecordID); } catch { } } } }
protected void btnDelete_Click(object sender, EventArgs e) { AlertSettingService db = new AlertSettingService(); db.Delete<ERobAlertSetting>(new Guid("eea2f9c4-7bf3-473d-b427-481b16df9964")); }