Example #1
0
 private bool Display(IClientAccountAssignment x)
 {
     return(x.ClientManagerActive &&
            x.ManagerClientActive &&
            x.ManagerClientOrgActive &&
            x.ManagerClientAccountActive &&
            x.EmployeeClientActive &&
            x.EmployeeClientOrgActive &&
            x.AccountActive &&
            x.Manager);
 }
Example #2
0
        public void RefreshHeaderAndFilter()
        {
            _Headers = new List <MatrixUserHeader>();

            FilterHtml = new StringBuilder();
            FilterHtml.AppendLine("<select>");

            //Use the first item's account to get each user name. Each account
            //should have the same list of users becuase of the way the view works.
            IClientAccountAssignment first = source.FirstOrDefault();

            if (first != null)
            {
                int    index       = 0;
                int    groupNumber = 0;
                string key         = string.Empty;
                List <IClientAccountAssignment> items = source.Where(x => x.AccountID == first.AccountID).ToList();
                foreach (IClientAccountAssignment caa in items)
                {
                    if (index % GroupSize == 0)
                    {
                        key = "opt-group-" + groupNumber.ToString();
                        string lname1 = caa.EmployeeLastName;
                        string lname2 = items[Math.Min(index + (GroupSize - 1), items.Count - 1)].EmployeeLastName;
                        string text   = string.Format("{0} - {1}", lname1, lname2);
                        FilterHtml.AppendFormat("<option value=\"{0}\">{1}</option>", key, text);
                        groupNumber++;
                    }

                    MatrixUserHeader uh = new MatrixUserHeader
                    {
                        ClientOrgID = caa.ClientOrgID,
                        DisplayName = GetEmployeeDisplayName(caa),
                        Key         = key
                    };

                    _Headers.Add(uh);

                    index++;
                }
            }

            FilterHtml.AppendLine("</select>");
        }
Example #3
0
        public bool IncludeOnMatrix(IClientAccountAssignment x)
        {
            bool res = Display(x) && PrivUtility.HasPriv(x.EmployeePrivs, PrivFilter);

            return(res);
        }
Example #4
0
 private string GetAccountProject(IClientAccountAssignment x) => Accounts.GetProject(x.AccountNumber);
Example #5
0
 private bool IsAssigned(IClientAccountAssignment x)
 {
     return(x.EmployeeClientAccountID > 0);
 }
Example #6
0
 private string GetManagerDisplayName(IClientAccountAssignment x) => Clients.GetDisplayName(x.ManagerLastName, x.ManagerFirstName);
Example #7
0
 private string GetEmployeeDisplayName(IClientAccountAssignment x) => Clients.GetDisplayName(x.EmployeeLastName, x.EmployeeFirstName);