Ejemplo n.º 1
0
        private void OnRecv_TaskInfo(ICD.HEADER obj)
        {
            if (ICD.DEF.ERR_NoError != obj.msgErr)
            {
                LOG.warn();
                return;
            }

            ICD.WorkList task = (ICD.WorkList)obj;
            foreach (var item in task.works)
            {
                if (item.state == "완료")
                {
                    mTasks.Remove(item.recordID);
                }
                else
                {
                    mTasks[item.recordID] = item;
                }
            }
            UpdateTaskList();
        }
Ejemplo n.º 2
0
        private void ProcTaskHistory(HEADER obj)
        {
            ICD.WorkHistoryList msg = (ICD.WorkHistoryList)obj;

            if (msg.workHistory.Length > 0)
            {
                int taskID = msg.workHistory[0].taskID;
                if (!mTracks.ContainsKey(taskID))
                {
                    LOG.warn();
                    return;
                }

                mTracks[taskID].his = msg.workHistory;
            }

            mCount--;
            if (mCount <= 0)
            {
                UpdateTaskTracking();
            }
        }
Ejemplo n.º 3
0
        private HEADER CreateICD_onClient(HEADER head)
        {
            switch (head.msgID)
            {
            case DEF.CMD_TaskIDList:
            case DEF.CMD_TaskLatestInfo:
            case DEF.CMD_TaskBaseList:
                return(new WorkList());

            case DEF.CMD_TaskHistory:
                return(new WorkHistoryList());

            case DEF.CMD_ChatRoomList:
                return(new ChatRoomList(1));

            case DEF.CMD_NewChat:
            case DEF.CMD_ChatMsg:
            case DEF.CMD_AddChatUsers:
            case DEF.CMD_DelChatUsers:
            case DEF.CMD_ShowChat:
            case DEF.CMD_HideChat:
            case DEF.CMD_ChatRoomInfo:
            case DEF.CMD_ChatMsgAll:
                return(new ChatRoomInfo());

            case DEF.CMD_NewUser:
            case DEF.CMD_Logout:
                return(new HEADER());

            case DEF.CMD_UserList:
                return(new Message());

            case DEF.CMD_Login:
                return(new User());
            }
            LOG.warn();
            return(null);
        }
Ejemplo n.º 4
0
        private void ICD_NewTask(int clientID, HEADER obj)
        {
            ICD.WorkList msg = obj as ICD.WorkList;
            if (msg.works == null && msg.works.Length != 1)
            {
                LOG.warn();
                return;
            }
            ICD.Work work = msg.works[0];

            ChatRoom     room     = new ChatRoom();
            ChatRoomInfo roomInfo = new ChatRoomInfo();

            roomInfo.FillHeader(obj);
            roomInfo.body.access   = work.access;
            roomInfo.body.users    = new string[2];
            roomInfo.body.users[0] = work.director;
            roomInfo.body.users[1] = work.worker;
            int chatID = room.CreateNewChat(roomInfo);

            mRooms[chatID]         = room;
            roomInfo.body.recordID = chatID;

            work.chatID = chatID;
            DataRow row    = DatabaseMgr.NewTask(msg);
            int     taskID = (int)row["recordID"];

            roomInfo.body.taskIDs    = new int[1];
            roomInfo.body.taskIDs[0] = taskID;
            room.AddTask(roomInfo);

            ICD.WorkList task = new ICD.WorkList();
            task.FillServerHeader(DEF.CMD_TaskLatestInfo, 0);
            DatabaseMgr.GetTaskLatest(taskID, ref task.works[0]);
            sendMsg(task.works[0].worker, task);
            sendMsg(task.works[0].director, task);
        }
Ejemplo n.º 5
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;
                }
            }
        }