Пример #1
0
        // 用户手动调整时间后,数据更新
        public void saveDate(string strPlanId, string strNodeName, string strStartTime, string strFinishTime, string strStartMofified)
        {
            TMisMonitorProcessMgmLogic objLogic = new TMisMonitorProcessMgmLogic();
            TMisMonitorProcessMgmVo    objVo    = new TMisMonitorProcessMgmVo();

            int i = 0;

            for (; i < arrTaskName.Length; i++)
            {
                if (strNodeName == arrTaskName[i])
                {
                    break;
                }
            }

            if (i == arrTaskName.Length)
            {
                // 没有找到该节点的配置信息,应该是前台传过来的参数不对
                return;
            }

            // 任务开始时间更新,结束时间自动更新
            if ("true" == strStartMofified)
            {
                strFinishTime = GetNextNDate(strStartTime, arrTaskValue[i]);
            }


            // 更新本节点信息
            objVo.TASK_ID             = strPlanId;
            objVo.MONITOR_TYPE        = strNodeName;
            objVo.MONITOR_TIME_START  = strStartTime;
            objVo.MONITOR_TIME_FINISH = strFinishTime;

            objLogic.Edit(objVo);

            // 更新后续节点的信息
            string strFlowingNodeStart = strFinishTime;

            if (0 == i)
            {
                //任务总体时间更新,各节点不自动更新
                return;
            }

            ++i;
            for (; i < arrTaskName.Length; i++)
            {
                objVo.Init();

                objVo.TASK_ID             = strPlanId;
                objVo.MONITOR_TYPE        = arrTaskName[i];
                objVo.MONITOR_TIME_START  = strFlowingNodeStart;
                objVo.MONITOR_TIME_FINISH = GetNextNDate(strFlowingNodeStart, arrTaskValue[i]);

                objLogic.Edit(objVo);

                strFlowingNodeStart = objVo.MONITOR_TIME_FINISH;
            }
        }
Пример #2
0
        // 首次调用此表单需要创建数据
        public void createDate(string strPlanId)
        {
            TMisMonitorProcessMgmLogic objLogic = new TMisMonitorProcessMgmLogic();
            TMisMonitorProcessMgmVo    objVo    = new TMisMonitorProcessMgmVo();

            objVo.TASK_ID = strPlanId;

            DataTable dt = objLogic.SelectByTable(objVo);

            // 第2+次加载此页面时,不用重复创建信息
            if (0 != dt.Rows.Count)
            {
                return;
            }


            for (int i = 0; i < arrTaskName.Length; i++)
            {
                objVo.Init();

                objVo.TASK_ID = strPlanId;

                objVo.ID = i3.View.PageBase.GetSerialNumber("t_mis_process_mgm_id");

                string strNodeName   = arrTaskName[i];
                string strStartTime  = "";
                string strFinishTime = "";

                GetNodeDate(strNodeName, ref strStartTime, ref strFinishTime);

                objVo.MONITOR_TIME_START  = strStartTime;
                objVo.MONITOR_TIME_FINISH = strFinishTime;
                objVo.MONITOR_TYPE        = strNodeName;

                objLogic.Create(objVo);
            }

            return;
        }