public static void addCache(Tb_taskLifecycle life)
 {
     try
     {
         BaseAdapter.save(life);
         list.Add(life);
     }
     catch (Exception ex)
     {
         MessageBoxEx.Show("保存任务过程时出现异常:" + ex);
     }
 }
        public static void addCache(Tb_indicatorTemplateMap templateMap)
        {
            var foundTemplate = list.FirstOrDefault(c => c.id == templateMap.id);

            if (foundTemplate == null)
            {
                BaseAdapter.save(templateMap);
                list.Add(templateMap);
            }
            else
            {
                BaseAdapter.edit(templateMap);
                foundTemplate = templateMap;
            }
        }
Esempio n. 3
0
 public static void addCache(Tb_indicator indicator)
 {
     try
     {
         var foundIndicator = list.FirstOrDefault(i => i.id == indicator.id);
         if (foundIndicator == null)
         {
             BaseAdapter.save(indicator);
             list.Add(indicator);
         }
         else
         {
             BaseAdapter.edit(indicator);
             //IndicatorAdapter.edit(indicator);
             foundIndicator = indicator;
         }
     }
     catch (Exception ex)
     {
         MessageBoxEx.Show(ex.Message);
     }
 }
        /// <summary>
        /// 保存一次任务处理结果
        /// </summary>
        /// <param name="task"></param>
        //public static void saveTask(Tb_taskInfo task, List<Tb_taskResult> resultList)
        //{
        //    TaskAdapter.saveTask(task,resultList);
        //}

        /// <summary>
        /// 添加任务生命周期,同时更新任务信息中的任务最新状态
        /// </summary>
        /// <param name="taskLifecycle"></param>
        //public static void updateTaskLifecycle(Tb_taskLifecycle taskLifecycle)
        //{
        //    TaskAdapter.updateTaskLifecycle(taskLifecycle);
        //}

        public static void addCache(Tb_taskInfo taskInfo)
        {
            try
            {
                var foundTaskInfo = list.FirstOrDefault(i => i.id == taskInfo.id);
                if (foundTaskInfo == null)
                {
                    BaseAdapter.save(taskInfo);
                    list.Add(taskInfo);
                }
                else
                {
                    BaseAdapter.edit(taskInfo);
                    //IndicatorAdapter.edit(indicator);
                    foundTaskInfo = taskInfo;
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message);
            }
        }