コード例 #1
0
    /// <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);
    }
コード例 #2
0
    /// <summary>
    /// 创建新的巡逻方案
    /// </summary>
    public void AddVideoPatrolPlan()
    {
        Logger.Instance.WriteLog("创建新的巡逻方案");
        VideoPatrolPlanInfo info = new VideoPatrolPlanInfo();
        int i = 1;

        while (PlanNameList.Contains("新建方案" + i))
        {
            i++;
        }
        info.Name         = "新建方案" + i;
        info.MonitorList  = "";
        info.PlayTimeList = "";
        VideoPatrolPlanDao vppDao = new VideoPatrolPlanDao();

        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];
        VideoPatrolPlanInfos.Add(info);
        PlanNameList.Add(info.Name);
        PlanName.GetComponentInChildren <UIInput> ().value = info.Name;
        ShowDetailList(PlanName.GetComponentInChildren <UIInput> ().value);

        VideoPatrolPlanViewPanel.SendMessage("ReloadRecord");
    }