//创建流程
        private void StartFlow()
        {
            if (op == "c" || op == "create")
            {
                ent           = this.GetPostedData <UsrDoubleWelfare>();
                ent.ApplyTime = DateTime.Now;
                ent.DoCreate();
                id = ent.Id;
            }
            else
            {
                ent = UsrDoubleWelfare.Find(id);
            }

            //受理人
            string UserId   = ent.ApproveUserId;
            string UserName = ent.ApproveName;

            string FlowKey = "EmpUsrWelfare";   //工作流key

            if (!string.IsNullOrEmpty(FlowKey))
            {
                string formUrl = "/EmpWelfare/UsrDoubleWelfareEdit.aspx?op=r&id=" + id;
                Guid   guid    = Aim.WorkFlow.WorkFlow.StartWorkFlow(id, formUrl, "员工配偶保险申报", FlowKey, UserInfo.UserID, UserInfo.Name);
                ent.WorkFlowState = "Start";
                ent.WorkFlowCode  = guid.ToString(); //InstanceId
                ent.DoUpdate();
                this.PageState.Add("NextInfo", guid.ToString() + "$" + UserId + "|" + UserName);
            }
        }
 /// <summary>
 /// 审批完成
 /// </summary>
 private void SubmitFinish()
 {
     if (!string.IsNullOrEmpty(id))
     {
         UsrDoubleWelfare Ent = UsrDoubleWelfare.Find(id);
         Ent.WorkFlowState = "End";
         Ent.Result        = RequestData.Get <string>("ApproveResult"); //处理结果
         Ent.DoUpdate();
     }
 }
Exemple #3
0
        //创建流程
        private void StartFlow()
        {
            string id = RequestData.Get("Id") + "";

            if (!string.IsNullOrEmpty(id))
            {
                ent = UsrDoubleWelfare.Find(id);
            }
            //受理人
            string UserId   = ent.ApproveUserId;
            string UserName = ent.ApproveName;

            string FlowKey = "EmpUsrWelfare";   //工作流key

            if (!string.IsNullOrEmpty(FlowKey))
            {
                string formUrl = "/EmpWelfare/UsrDoubleWelfareEdit.aspx?op=r&id=" + id;
                Guid   guid    = Aim.WorkFlow.WorkFlow.StartWorkFlow(id, formUrl, "员工配偶保险申报", FlowKey, UserInfo.UserID, UserInfo.Name);
                ent.WorkFlowState = "Start";
                ent.WorkFlowCode  = guid.ToString(); //InstanceId
                ent.DoUpdate();
                this.PageState.Add("NextInfo", guid.ToString() + "$" + UserId + "|" + UserName);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            type = RequestData.Get <string>("type");


            switch (this.RequestAction)
            {
            case RequestActionEnum.Update:
                ent = this.GetMergedData <UsrDoubleWelfare>();
                ent.DoUpdate();
                break;

            case RequestActionEnum.Insert:
            case RequestActionEnum.Create:
                ent           = this.GetPostedData <UsrDoubleWelfare>();
                ent.ApplyTime = DateTime.Now;


                string userid = "";
                if (UserInfo != null)
                {
                    userid = UserInfo.UserID;
                }
                else
                {
                    userid = RequestData.Get <string>("userid");
                }

                ent.NoticeId = RequestData.Get <string>("noticeid");

                ent.CreateId   = userid;
                ent.CreateName = "";
                ent.CreateTime = DateTime.Now;

                ent.DoCreate();
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <UsrDoubleWelfare>();
                ent.DoDelete();
                return;

            default:
                if (RequestActionString == "GetWorkNo")
                {
                    string     UserID = RequestData.Get("UserID") + "";
                    ComUtility Ut     = new ComUtility();
                    this.PageState.Add("WorkNo", Ut.GetWorkNo(UserID));
                }
                else if (RequestActionString == "ckNotice")      //通知检查
                {
                    CKSubmit();
                }
                else if (RequestActionString == "Submit")      //提交流程
                {
                    StartFlow();
                }
                else if (RequestActionString == "AutoExecuteFlow")
                {
                    AutoExecuteFlow();
                }
                else if (RequestActionString == "submitfinish")
                {
                    SubmitFinish();
                }
                else if (RequestActionString == "GetNextUsers")
                {
                    GetNextUsers();
                }
                else
                {
                    DoSelect();
                }
                break;
            }
        }