/// <summary> /// 临时添加新的计划任务 /// </summary> /// <param name="taskName">计划任务名称(来自数据库)</param> public void addPlan(string taskName) { if (!planTaskDic.ContainsKey(taskName)) { DataRow row = db.getRow("planTask", "planName", taskName); PlanTask planTask = new PlanTask(row); planTask.doit += methodDic[taskName]; planTaskDic.Add(taskName, planTask); } }
/// <summary> /// 从数据库中读取计划 /// </summary> private void readPlan() { this.taskArr = db.getCol <string>("planTask", "planName"); foreach (string taskName in taskArr) { DataRow row = db.getRow("planTask", "planName", taskName); PlanTask planTask = new PlanTask(row); if (!planTaskDic.ContainsKey(taskName)) { planTask.doit += methodDic[taskName]; planTaskDic.Add(taskName, planTask); } } }