/// <summary> /// 创建新的巡逻方案 /// </summary> public void AddVideoPatrolPlan() { Logger.Instance.WriteLog("创建新的巡逻方案"); VideoPatrolPlanInfo info = new VideoPatrolPlanInfo(); int i = 1; VideoPatrolPlanDao vppDao = new VideoPatrolPlanDao(); while (true) { vppDao.Select004("新建方案" + i); if (vppDao.Result.Count <= 0) { break; } i++; } info.Name = "新建方案" + i; info.MonitorList = ""; info.PlayTimeList = ""; Logger.Instance.WriteLog("保存新建巡逻方案"); vppDao.Insert001(info.Name, info.MonitorList, info.PlayTimeList, DataStore.UserInfo.UserName); Logger.Instance.WriteLog("加载新建巡逻方案"); vppDao.Select002(); if (vppDao.Result.Count <= 0 || vppDao.Result[0].Name != info.Name) { Logger.Instance.WriteLog("新建巡逻方案失败"); return; } info = vppDao.Result [0]; AddItemToVideoPatrolPlanGrid(info); ShowPlanDetail(VideoPatrolPlanGrid.GetChild(VideoPatrolPlanGrid.transform.childCount - 1).gameObject); }
public void Init(string _PlanName, DelVideoPatrolPlanNameChanged _VideoPatrolPlanNameChanged) { Logger.Instance.WriteLog("加载巡逻方案的数据"); VideoPatrolPlanDao vppDao = new VideoPatrolPlanDao(); vppDao.Select004(_PlanName); if (vppDao.Result.Count > 0) { VPPlaninfo = vppDao.Result[0]; } PlanName.value = VPPlaninfo.Name; VideoPatrolPlanNameChanged = _VideoPatrolPlanNameChanged; if (DicMornitorInfos == null) { LoadDeviceInfoRecord(); } ShowDetailList(); }
/// <summary> /// 当项目名称改变时调用 /// </summary> public void PlanNameChanged() { Logger.Instance.WriteLog("视频巡航方案名称被改变"); PlanNameInputBox.enabled = false; if (PlanName.value.Trim() == "") { PlanName.value = VPPlaninfo.Name; Logger.Instance.WriteLog("更新视频巡航方案名称失败,名称为空"); return; } if (PlanName.value == VPPlaninfo.Name) { return; } VideoPatrolPlanDao vppDao = new VideoPatrolPlanDao(); vppDao.Select004(PlanName.value); if (vppDao.Result.Count > 0) { PlanName.value = VPPlaninfo.Name; Logger.Instance.WriteLog("更新视频巡航方案名称失败,名称已存在"); return; } Logger.Instance.WriteLog("更新视频巡航方案名称"); int ret = vppDao.Update002(VPPlaninfo.Id, PlanName.value); if (ret > 0) { VPPlaninfo.Name = PlanName.value; if (VideoPatrolPlanNameChanged != null) { VideoPatrolPlanNameChanged.Invoke(VPPlaninfo.Name); } Logger.Instance.WriteLog("更新视频巡航方案名称成功"); } else { PlanName.value = VPPlaninfo.Name; Logger.Instance.WriteLog("更新视频巡航方案名称失败,数据库更新失败"); } }