protected void Page_Load(object sender, EventArgs e)
        {
            id = RequestData.Get <string>("id");
            if (!string.IsNullOrEmpty(id))
            {
                ent = ReleaseDocument.Find(id);
            }
            switch (RequestActionString)
            {
            case "delete":
                ent = ReleaseDocument.Find(id);
                if (!string.IsNullOrEmpty(ent.ReleaseContent))
                {
                    FileItem fiEnt = FileItem.Find(ent.ReleaseContent.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries)[0]);
                    fiEnt.DoDelete();
                }
                ent.DoDelete();
                break;

            case "submit":
                StartFlow();
                break;

            case "AutoExecuteFlow":
                AutoExecuteFlow();
                break;

            default:
                DoSelect();
                break;
            }
        }
 private void DoSelect()
 {
     if (op != "c" && op != "cs")
     {
         ent = ReleaseDocument.Find(id);
         SetFormData(ent);
     }
 }
        private void DoSelect()
        {
            if (op != "c" && op != "cs")
            {
                ent = ReleaseDocument.Find(id);
                SetFormData(ent);
                sql = @"select * from Task where PatIndex('%{0}%',EFormName)>0  and Status='4' and ApprovalNodeName in('部门领导','相关部门会签','院办主任','归口部门会签','主管院长','院办主任核稿','院长审批') 
                order by FinishTime asc";
                sql = string.Format(sql, id);
                IList <EasyDictionary> taskDics = DataHelper.QueryDictList(sql);
                PageState.Add("Opinion", taskDics);
                sql = @"select  * from BJKY_Portal..FileItem where PatIndex('%'+Id+'%','{0}')>0 ";
                sql = string.Format(sql, ent.ApproveContent);
                PageState.Add("DataList", DataHelper.QueryDictList(sql));
                sql = @"select  * from BJKY_Portal..FileItem where PatIndex('%'+Id+'%','{0}')>0 ";
                sql = string.Format(sql, ent.Attachment);
                PageState.Add("DataList2", DataHelper.QueryDictList(sql));
            }
            else
            {
                sql = @"select top 1 case [Type] when 3 then ParentDeptName when 2 then ChildDeptName end as DeptName,
                case [Type] when 3 then ParentId when 2 then DeptId end as DeptId
                from View_SysUserGroup where UserId='{0}'";
                sql = string.Format(sql, UserInfo.UserID);
                IList <EasyDictionary> deptDics = DataHelper.QueryDictList(sql);
                if (deptDics.Count > 0)
                {
                    var obj = new
                    {
                        CreateDeptId   = deptDics[0].Get <string>("DeptId"),
                        CreateDeptName = deptDics[0].Get <string>("DeptName"),
                        CreateId       = UserInfo.UserID,
                        CreateName     = UserInfo.Name
                    };
                    SetFormData(obj);
                }
            }
            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);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            op       = RequestData.Get <string>("op");
            id       = RequestData.Get <string>("id");
            LinkView = RequestData.Get <string>("LinkView");
            nextName = RequestData.Get <string>("nextName");
            taskName = RequestData.Get <string>("taskName");
            if (!string.IsNullOrEmpty(id))
            {
                ent = ReleaseDocument.Find(id);
            }
            switch (RequestActionString)
            {
            case "UpdateReleaseContent":
                ent.ReleaseContent = RequestData.Get <string>("ReleaseContent");
                ent.DoUpdate();
                break;

            default:
                DoSelect();
                break;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            op         = RequestData.Get <string>("op");
            id         = RequestData.Get <string>("id");
            LinkView   = RequestData.Get <string>("LinkView");
            nextName   = RequestData.Get <string>("nextName");
            taskName   = RequestData.Get <string>("taskName");
            JsonString = RequestData.Get <string>("JsonString");
            if (!string.IsNullOrEmpty(id))
            {
                ent = ReleaseDocument.Find(id);
            }
            switch (RequestActionString)
            {
            case "update":
                if (!string.IsNullOrEmpty(JsonString))
                {
                    ReleaseDocument rdTemp = JsonHelper.GetObject <ReleaseDocument>(JsonString);
                    ent = DataHelper.MergeData <ReleaseDocument>(ent, rdTemp);
                }
                else
                {
                    ent = GetMergedData <ReleaseDocument>();
                }
                ent.DoUpdate();
                PageState.Add("Id", ent.Id);
                break;

            case "UpdateZiHao":
                ent.DocumentZiHao = RequestData.Get <string>("DocumentZiHao");
                ent.DoUpdate();
                break;

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

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

            case "submit":
                StartFlow();
                break;

            case "AutoExecuteFlow":
                AutoExecuteFlow();
                break;

            case "submitfinish":
                ent = ReleaseDocument.Find(id);
                ent.ApproveResult = RequestData.Get <string>("ApprovalState");
                ent.WorkFlowState = RequestData.Get <string>("state");
                ent.State         = "已归档";
                ent.DoUpdate();
                break;

            default:
                DoSelect();
                break;
            }
        }