Exemple #1
0
        public static void GetTaskLatest(int taskID, ref ICD.Work task)
        {
            DataRow taskRoot = GetTaskRoot(taskID);

            if (taskRoot == null)
            {
                return;
            }

            task.recordID  = (int)taskRoot["recordID"];
            task.type      = taskRoot["type"].ToString();
            task.time      = taskRoot["time"].ToString();
            task.creator   = taskRoot["creator"].ToString();
            task.access    = taskRoot["access"].ToString();
            task.mainCate  = taskRoot["mainCate"].ToString();
            task.subCate   = taskRoot["subCate"].ToString();
            task.title     = taskRoot["title"].ToString();
            task.comment   = taskRoot["comment"].ToString();
            task.director  = taskRoot["director"].ToString();
            task.worker    = taskRoot["worker"].ToString();
            task.launch    = taskRoot["launch"].ToString();
            task.due       = taskRoot["due"].ToString();
            task.term      = taskRoot["term"].ToString();
            task.state     = taskRoot["state"].ToString();
            task.priority  = taskRoot["priority"].ToString();
            task.progress  = (int)taskRoot["progress"];
            task.chatID    = (int)taskRoot["chatID"];
            task.timeFirst = taskRoot["timeFirst"].ToString();
            task.timeDone  = taskRoot["timeDone"].ToString();

            DataTable taskHis = GetTaskHistory(taskID);

            if (taskHis == null)
            {
                return;
            }

            foreach (DataRow item in taskHis.Rows)
            {
                string name = item["columnName"].ToString();
                switch (name)
                {
                case "access":      task.access = item["toInfo"].ToString(); break;

                case "mainCate":    task.mainCate = item["toInfo"].ToString(); break;

                case "subCate":     task.subCate = item["toInfo"].ToString(); break;

                case "title":       task.title = item["toInfo"].ToString(); break;

                case "comment":     task.comment = item["toInfo"].ToString(); break;

                case "director":    task.director = item["toInfo"].ToString(); break;

                case "worker":      task.worker = item["toInfo"].ToString(); break;

                case "launch":      task.launch = item["toInfo"].ToString(); break;

                case "due":         task.due = item["toInfo"].ToString(); break;

                case "term":        task.term = item["toInfo"].ToString(); break;

                case "state":       task.state = item["toInfo"].ToString(); break;

                case "priority":    task.priority = item["toInfo"].ToString(); break;

                case "progress":    task.progress = (int)item["toInfo"]; break;

                case "chatID":      task.chatID = (int)item["toInfo"]; break;

                case "reportMid":      task.state = "진행"; break;

                case "reportDone":      task.state = "완료대기"; break;

                case "confirmOK":      task.state = "완료"; break;

                case "confirmNO":      task.state = "진행"; break;

                default:            LOG.warn(); break;
                }
            }
        }