Exemplo n.º 1
0
        public bool Approval(string workflowid, string userid, Approval approval)
        {
            WorkflowModel workflow = WorkflowModel.Load(workflowid);

            //var userids = Common.GetDataAuthorityUserIDList();
            //if (userids != null && userids.Exists(t => t.Equals(workflow.Value.Creator))) throw new Exception("该单据不是你用户组的人员创建,你没有权限审批!");
            if (!workflow.CanUserProcess(userid))
            {
                return(true);
            }
            workflow.ProcessActivity(approval, userid, new WorkflowAuthority());
            return(true);
        }
Exemplo n.º 2
0
        public bool UpdateFinance(string workflowid, Project project, string userid)
        {
            ISqlMapper mapper = Common.GetMapperFromSession();

            this.UpdateFinance(project);
            UserBLL userbll = new UserBLL();

            if (string.IsNullOrEmpty(workflowid))
            {
                return(true);
            }
            WorkflowModel model = WorkflowModel.Load(workflowid);

            if (!model.CanUserProcess(userid))
            {
                return(true);
            }
            model.ProcessActivity(new Approval {
                Status = (int)ApprovalStatus.None
            }, userid, new WorkflowAuthority());
            return(true);
        }
Exemplo n.º 3
0
        public bool UpdateTracking(UpdateTrackingServiceForm project, string workflowid, string userid)
        {
            if (project == null || string.IsNullOrEmpty(project.ID))
            {
                throw new Exception("上传数据有误,缺少ID或者Form");
            }
            ISqlMapper             mapper = Common.GetMapperFromSession();
            ProjectDao             dao    = new ProjectDao(mapper);
            TrackingMortgageDao    tmdao  = new TrackingMortgageDao(mapper);
            TrackingChangeOwnerDao tcodao = new TrackingChangeOwnerDao(mapper);

            dao.Update(new ProjectUpdateForm
            {
                Entity = new Project
                {
                    LogoutAssetTime      = project.LogoutAssetTime,
                    PickNewAssetCodeTime = project.PickNewAssetCodeTime,
                    MortgageRemark       = project.MortgageRemark,
                },
                ProjectQueryForm = new ProjectQueryForm {
                    ID = project.ID
                },
            });

            //过户信息处理
            TrackingChangeOwner tco = new TrackingChangeOwner
            {
                ProjectID = project.ID,
                ChangeOwnerProfileCode = project.ChangeOwnerProfileCode,
                ChangeOwnerRemark      = project.ChangeOwnerRemark,
                ChangeOwnerProfileTime = project.ChangeOwnerProfileTime,
                NewAssetCode           = project.NewAssetCode,
                NewAssetDate           = project.NewAssetDate,
            };
            TrackingChangeOwner tcoowner = tcodao.Query(new TrackingChangeOwnerQueryForm {
                ProjectID = project.ID
            }).FirstOrDefault();

            if (tcoowner == null)
            {
                tco.Creator = project.LastUpdator;
                tcodao.Add(tco);
            }
            else
            {
                tco.LastUpdator = project.LastUpdator;
                tcodao.Update(new TrackingChangeOwnerUpdateForm
                {
                    Entity = tco,
                    TrackingChangeOwnerQueryForm = new TrackingChangeOwnerQueryForm {
                        ID = tcoowner.ID
                    },
                });
            }
            TrackingMortgage tm = new TrackingMortgage
            {
                MortgageFeedbackCode = project.MortgageFeedbackCode,
                ProjectID            = project.ID,
                MortgageOverTime     = project.MortgageOverTime,
                MortgagePredictTime  = project.MortgagePredictTime,
            };
            //借贷信息处理
            var tmmodel = tmdao.Query(new TrackingMortgageQueryForm {
                ProjectID = project.ID
            }).FirstOrDefault();

            if (tmmodel == null)
            {
                tm.Creator = project.LastUpdator;
                tmdao.Add(tm);
            }
            else
            {
                tm.LastUpdator = project.LastUpdator;
                tmdao.Update(new TrackingMortgageUpdateForm
                {
                    Entity = tm,
                    TrackingMortgageQueryForm = new TrackingMortgageQueryForm {
                        ID = tmmodel.ID
                    },
                });
            }
            WorkflowModel model = WorkflowModel.Load(workflowid);

            if (!model.CanUserProcess(userid))
            {
                return(true);
            }
            model.ProcessActivity(new Approval {
                Status = (int)ApprovalStatus.None
            }, userid, new WorkflowAuthority());
            return(true);
        }