protected void Page_Load(object sender, EventArgs e)
        {
            id = RequestData.Get <string>("id");
            if (!string.IsNullOrEmpty(id))
            {
                ent = ReceiveDocument.Find(id);
            }
            switch (RequestActionString)
            {
            case "delete":
                ent = ReceiveDocument.Find(id);
                sql = "delete from FileItem where PatIndex('%'+Id+'%','{0}')>0";
                sql = string.Format(sql, ent.Attachment);
                DataHelper.ExecSql(sql);
                ent.DoDelete();
                break;

            case "submit":
                StartFlow();
                break;

            case "AutoExecuteFlow":
                AutoExecuteFlow();
                break;

            default:
                DoSelect();
                break;
            }
        }
        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;
            }
        }
        string id = String.Empty; // 对象id
        protected void Page_Load(object sender, EventArgs e)
        {
            op = RequestData.Get <string>("op");
            id = RequestData.Get <string>("id");
            ReceiveDocument ent = null;

            if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = ReceiveDocument.Find(id);
                    lbComeWord.InnerHtml      = ent.ComeWord + "字第" + ent.ComeWordSize + "号";
                    lbReceiveDate.InnerHtml   = ent.ReceiveDate.Value.ToShortDateString();
                    lbBringUnit.InnerHtml     = ent.BringUnitName;
                    lbReceiveWord.InnerHtml   = ent.ReceiveWord + "字第" + ent.ReceiveWordSize + "号";
                    lbReceiveReason.InnerHtml = ent.ReceiveReason;
                    lbNiBanOpinion.InnerHtml  = ent.NiBanOpinion;
                    string sql = @"select * from Task where PatIndex('%{0}%',EFormName)>0  and  Status='4'  order by FinishTime asc";
                    sql = string.Format(sql, ent.Id);
                    PageState.Add("Opinion", DataHelper.QueryDictList(sql));
                }
            }
        }
        private void DoSelect()
        {
            if (op != "c" && op != "cs")
            {
                ent = ReceiveDocument.Find(id);
                sql = @"select * from FileItem where PatIndex('%'+Id+'%','{0}')>0 order by CreateTime desc";
                sql = string.Format(sql, ent.MainFile);
                PageState.Add("DataList", DataHelper.QueryDictList(sql));
                sql = @"select * from FileItem where PatIndex('%'+Id+'%','{0}')>0 order by CreateTime desc";
                sql = string.Format(sql, ent.Attachment);
                PageState.Add("DataList2", DataHelper.QueryDictList(sql));
                sql = @"select * from Task where PatIndex('%{0}%',EFormName)>0  and Status='4' and Ext1 is null order by FinishTime asc";
                sql = string.Format(sql, id);
                IList <EasyDictionary> taskDics = DataHelper.QueryDictList(sql);
                PageState.Add("Opinion", taskDics);
            }
            else
            {
                ent             = new ReceiveDocument();
                ent.ReceiveDate = System.DateTime.Now.Date;
            }
            SetFormData(ent);
            string taskId = RequestData.Get <string>("TaskId");

            if (!string.IsNullOrEmpty(taskId))
            {
                Task tEnt = Task.Find(taskId);
                if (tEnt.Status != 4 && !string.IsNullOrEmpty(tEnt.Description))
                {
                    PageState.Add("UnSubmitOpinion", tEnt.Description);
                }
            }
            PageState.Add("ReceiveType", SysEnumeration.GetEnumDict("ReceiveType"));
            PageState.Add("SecrecyDegree", SysEnumeration.GetEnumDict("SecrecyDegree"));
            sql = "select * from BJKY_IntegratedManage..BringUnit";
            PageState.Add("ImportanceDegree", SysEnumeration.GetEnumDict("ImportanceDegree"));
        }