Ejemplo n.º 1
0
        private void SetWfResInst(CParticipant part, Actinst actinst)
        {
            this.wfResinst.Actinst = actinst;
            this.wfResinst.ParticipantId = part.Id;
            this.wfResinst.ParticipantName = part.Name;
            this.wfResinst.IsAssigned = false;
            this.wfResinst.AssignRule = part.AssignRule;
            string type = part.ParticipantEntity.Type;
            this.wfResinst.ParticipantType = type;
            switch (type.ToUpper())
            {
                case "ROLE":
                    this.wfResinst.RoleId = part.ParticipantEntity.IdValue;
                    this.wfResinst.RoleName = part.Name;
                    return;

                case "DEPT":
                    this.wfResinst.DeptId = part.ParticipantEntity.IdValue;
                    this.wfResinst.DeptName = part.Name;
                    return;

                case "STAFF":
                {
                    this.wfResinst.StaffId = part.ParticipantEntity.IdValue;
                    CStaff staff = OGMService.GetStaff(this.wfResinst.StaffId);
                    if (staff != null)
                    {
                        this.wfResinst.StaffName = staff.Name;
                    }
                    return;
                }
                case "ALL":
                case "AUTO":
                    return;
            }
            throw new WfException("Not supported participant type");
        }
Ejemplo n.º 2
0
 private void Init(IWfActivity wfActivity, CParticipant part)
 {
     Actinst instanceObject = wfActivity.GetInstanceObject() as Actinst;
     this.wfActivity = wfActivity;
     this.wfResinst = instanceObject.WfResinst;
     if (this.wfResinst == null)
     {
         this.wfResinst = new WfResinst();
         this.SetWfResInst(part, instanceObject);
     }
     WfLogicalPassContextData passContextData = WfUtil.GetPassContextData();
     if (passContextData != null)
     {
         this.SetWfResInst(passContextData);
     }
 }
Ejemplo n.º 3
0
 public WfResource(IWfActivity wfActivity, CParticipant part)
 {
     this.Init(wfActivity, part);
     this.CreateAssignment();
     this.Store();
 }
Ejemplo n.º 4
0
 public static IList<CStaff> GetStaffsOfParticipant(CParticipant part)
 {
     return OGMService.GetStaffs(part.ParticipantEntity.Type.ToUpper(), part.ParticipantEntity.IdValue);
 }