Exemplo n.º 1
0
        public override JsonResult DeleteFlow()
        {
            string id = GetQueryString("ID");

            PostingFO.ResetStatus(id);
            return(base.DeleteFlow());
        }
Exemplo n.º 2
0
        public JsonResult SaveTaskExecList()
        {
            List <Dictionary <string, object> > rows = PostingFO.GetTaskExec(Request.Form["ListData"]);

            UpdateList <S_WF_InsTaskExec>(rows);
            entities.SaveChanges();
            return(Json(string.Empty));
        }
Exemplo n.º 3
0
        public JsonResult GetSWFFile(string docID)
        {
            var rtn = new
            {
                File = PostingFO.GetSWFFile(docID)
            };

            return(Json(rtn));
        }
Exemplo n.º 4
0
        public override void UnExecTaskExec(string taskExecID)
        {
            string           id           = GetQueryString("ID");
            WorkflowEntities flowEntities = FormulaHelper.GetEntities <WorkflowEntities>();
            S_WF_InsTaskExec taskExec     = flowEntities.Set <S_WF_InsTaskExec>().SingleOrDefault(c => c.ID == taskExecID);
            string           stepCode     = taskExec.S_WF_InsTask.S_WF_InsDefStep.Code;

            PostingFO.ChangeStatus(id, stepCode);
            base.UnExecTaskExec(taskExecID);
        }
Exemplo n.º 5
0
        public override JsonResult GetModel(string id)
        {
            S_D_Posting model = GetEntity <S_D_Posting>(id);

            if (string.IsNullOrEmpty(id))
            {
                UserInfo user = Formula.FormulaHelper.GetUserInfo();
                model.Drafter     = user.UserName;
                model.DrafterID   = user.UserID;
                model.DraftDate   = DateTime.Now.Date;
                model.DraftDept   = user.UserOrgName;
                model.DraftDeptID = user.UserOrgID;
                model.Status      = PostingStatus.Draft.ToString();
                model.DocID       = PostingFO.CreateEmptyWord();
            }
            return(Json(model));
        }
Exemplo n.º 6
0
        public override bool ExecTaskExec(Workflow.Logic.Domain.S_WF_InsTaskExec taskExec, Workflow.Logic.Domain.S_WF_InsDefRouting routing, string nextExecUserIDs, string nextExecUserNames, string nextExecUserIDsGroup, string nextExecRoleIDs, string nextExecOrgIDs, string execComment)
        {
            WorkflowEntities entitiesFlow = FormulaHelper.GetEntities <WorkflowEntities>();
            bool             flowComplete = base.ExecTaskExec(taskExec, routing, nextExecUserIDs, nextExecUserNames, nextExecUserIDsGroup, nextExecRoleIDs, nextExecOrgIDs, execComment);
            S_D_Posting      model        = entities.Set <S_D_Posting>().Find(taskExec.S_WF_InsFlow.FormInstanceID);

            if (taskExec.S_WF_InsTask.Status == FlowTaskStatus.Complete.ToString())
            {
                if (model != null)
                {
                    if (string.IsNullOrEmpty(model.InsFlowID))
                    {
                        model.InsFlowID = taskExec.S_WF_InsTask.InsFlowID;
                    }

                    string[] arr = new string[2] {
                        routing.InsDefStepID, routing.EndID
                    };
                    List <S_WF_InsDefStep> steps = entitiesFlow.Set <S_WF_InsDefStep>().Where(c => arr.Contains(c.ID)).ToList();
                    string endID = routing.EndID;
                    if (steps.Find(c => c.ID == endID) != null)
                    {
                        model.Status = steps.Find(c => c.ID == endID).Code;
                    }
                    string exStatus = string.Empty;
                    string stepID   = routing.InsDefStepID;
                    if (steps.Find(c => c.ID == stepID) != null)
                    {
                        exStatus = steps.Find(c => c.ID == stepID).Code;
                    }
                    if (model.Status == PostingStatus.Draft.ToString())
                    {
                        string[] arrExecSteps = string.IsNullOrEmpty(model.ExecutedSteps) ? new string[1] {
                            exStatus
                        } : (model.ExecutedSteps + "," + exStatus).Split(',');
                        foreach (string str in arrExecSteps)
                        {
                            if (!string.IsNullOrEmpty(str))
                            {
                                string[] arrValTxt = new string[2] {
                                    str, str + "ID"
                                };
                                foreach (string s in arrValTxt)
                                {
                                    PropertyInfo pi = model.GetType().GetProperty(s, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
                                    if (pi != null && pi.CanWrite)
                                    {
                                        pi.SetValue(model, string.Empty, null);
                                    }
                                }
                            }
                        }
                        model.ExecutedSteps = string.Empty;
                    }
                    else
                    {
                        if (exStatus != string.Empty)
                        {
                            if (string.IsNullOrEmpty(model.ExecutedSteps))
                            {
                                model.ExecutedSteps = exStatus;
                            }
                            else
                            {
                                model.ExecutedSteps += "," + exStatus;
                            }
                        }
                    }
                    //转PDF
                    if (steps.Find(c => c.ID == stepID).Code == PostingStatus.TaoHong.ToString())
                    {
                        if (string.IsNullOrEmpty(model.MergeDocID))
                        {
                            model.MergeDocID = model.DocID;
                        }
                        PostingFO.AddPDFTask(model.MergeDocID);
                    }
                    entities.SaveChanges();
                }
            }

            return(flowComplete);
        }