Example #1
0
        /// <summary>
        /// 转签
        /// </summary>
        /// <param name="vallist"></param>
        /// <param name="befortodoID"></param>
        /// <param name="operationUserCode"></param>
        /// <param name="operationType"></param>
        /// <param name="common"></param>
        /// <param name="flowcontent"></param>
        /// <param name="node"></param>
        /// <param name="toNodeKey"></param>
        private void Redirect(Dictionary <string, string> vallist, int befortodoID, string operationUserCode, Operation operationType, string common, FlowContent flowcontent, FlowNode node, string todoUserCode)
        {
            ToDoHandle.DealTodo((int)operationType, operationUserCode, befortodoID);
            FlowVar var = new FlowVar(flowcontent.TmpKey, flowcontent.CurrentInstanceID);

            var.UpdateVal(vallist, this.CurrenUserCode);
            //获取当前待办人的编号
            List <string> newtodis   = new List <string>();
            List <string> newnodekey = new List <string>();
            int           todoid     = ToDoHandle.InsertTodo(todoUserCode.Trim(), flowcontent.CurrentInstanceID, (int)TodoIsShow.Show, befortodoID, flowcontent.TaskName, (int)TodoType.Redirect, node, node.NodeKey, CurrenUserCode);

            newtodis.Add(todoid.ToString());
            flowcontent.CurrentTodoID  = string.Join(", ", newtodis);
            flowcontent.CurrentNodeKey = node.NodeKey;
            operationbll.Insert(flowcontent.CurrentInstanceID, befortodoID, CurrenUserCode, (int)operationType, common);
            //插入转签历史记录
            WF_Transfer trans = new WF_Transfer();

            trans.AfterToDoID       = todoid;
            trans.beforeToDoID      = befortodoID;
            trans.IsDelete          = (int)IsDelete.UnDelete;
            trans.State             = (int)State.Enable;
            trans.OperationTime     = DateTime.Now;
            trans.OperationUserCode = operationUserCode;
            Employee emp = empbll.getbyUserCode(operationUserCode);

            if (emp != null)
            {
                trans.OperationUserName = emp.UserName;
            }
            tranbll.save(trans);
        }
Example #2
0
        public int Insert(int instanceID, int todoID, string operationUserCode, int operationType, string comments)
        {
            WF_OperationHistory history = new WF_OperationHistory();
            Employee            emp     = empbll.getbyUserCode(operationUserCode);

            history.InstanceID    = instanceID;
            history.Comments      = comments;
            history.IsDelete      = (int)IsDelete.UnDelete;
            history.OperationTime = DateTime.Now;
            history.OperationType = operationType;
            WF_ToDo todo = todobll.getByID(todoID);

            history.State = (int)State.Enable;
            if (todo != null)
            {
                history.TodoID = todoID;
                if (todo.ResponseUserCode == operationUserCode)
                {
                    history.OperationUserCode = operationUserCode;
                    history.OperationUserName = emp.UserName;
                }
                else
                {
                    history.AgentUserCode = operationUserCode;
                    history.AgentUserName = emp.UserName;
                }
            }
            else
            {
                history.OperationUserCode = operationUserCode;
                history.OperationUserName = emp.UserName;
                history.TodoID            = -1;
            }
            return(operbll.save(history));
        }