public virtual string GetNameFromApprovals(string orderStatusCodeId) { var apprv = Approvals.Where(a => a.StatusCode.Id == orderStatusCodeId && a.User != null).FirstOrDefault(); if (apprv == null) { return("[Workgroup]"); } if (apprv.User.IsActive && !apprv.User.IsAway) //User is not away show them { return(apprv.User.FullName); } if (apprv.SecondaryUser != null && apprv.SecondaryUser.IsActive && !apprv.SecondaryUser.IsAway) //Primary user is away, show Secondary if active and not away { return(apprv.SecondaryUser.FullName); } return(string.Empty); }
public IEnumerable <ApprovalModel> GetPreApprovals() { return(Approvals.Where(a => a.Type == (int)ApprovalModel.ApprovalType.LessonsLearnedPreApproval)); }