protected void Page_Load(object sender, EventArgs e)
        {
            op = RequestData.Get <string>("op");
            id = RequestData.Get <string>("id");
            if (!string.IsNullOrEmpty(id))
            {
                ent = ReceiveDocument.Find(id);
            }
            nextName = RequestData.Get <string>("nextName");
            switch (RequestActionString)
            {
            case "update":
                ent = GetMergedData <ReceiveDocument>();
                ent.DoUpdate();
                PageState.Add("Id", ent.Id);
                break;

            case "ConfirmYuanZhang":
                ent.YuanZhangId   = RequestData.Get <string>("YuanZhangId");
                ent.YuanZhangName = RequestData.Get <string>("YuanZhangName");
                ent.DoUpdate();
                break;

            case "GetNextUsers":
                PageState.Add("NextUsers", GetNextUser(nextName));
                break;

            case "create":
                ent = GetPostedData <ReceiveDocument>();
                ent.DoCreate();
                PageState.Add("Id", ent.Id);
                break;

            case "submit":
                StartFlow();
                break;

            case "AutoExecuteFlow":
                AutoExecuteFlow();
                break;

            case "submitfinish":
                //院办文书结束后设置文档为归档状态
                ent               = ReceiveDocument.Find(id);
                ent.State         = "已归档";
                ent.ApproveResult = RequestData.Get <string>("ApprovalState");
                ent.WorkFlowState = RequestData.Get <string>("state");
                ent.DoUpdate();
                break;

            default:
                DoSelect();
                break;
            }
        }
        private void StartFlow()
        {
            ArrayList array   = new ArrayList();
            string    state   = RequestData.Get <string>("state");
            string    formUrl = "/DocumentManage/ReceiveDocumentEdit.aspx?op=v&&id=" + id;
            Guid      guid    = new Guid();

            if (ent.ApprovalNodeName == "院办主任")
            {
                guid = WorkFlow.StartWorkFlow(id, formUrl, "收文审批", "ReceiveDocumentI", UserInfo.UserID, UserInfo.Name);
                IList <IntegratedConfig> icEnts = IntegratedConfig.FindAll();
                array.Add(guid + "#" + icEnts[0].YuanBanZhuRenId + "$" + icEnts[0].YuanBanZhuRenName);
            }
            else
            {
                guid = WorkFlow.StartWorkFlow(id, formUrl, "收文审批", "ReceiveDocumentII", UserInfo.UserID, UserInfo.Name);
                array.Add(guid + "#" + ent.YuanZhangId + "$" + ent.YuanZhangName);
            }
            PageState.Add("WorkFlowInfo", array);
            ent.WorkFlowState = state;
            ent.DoUpdate();
        }