Esempio n. 1
0
        public List <Account> GetAllMemberByGroupID(int GroupID)
        {
            List <Account> accounts   = new List <Account>();
            List <int>     accountIDs = _groupMemberRepository.GetMemberAccountIDsByGroupID(GroupID);

            foreach (int i in accountIDs)
            {
                accounts.Add(_accountRepository.GetAccountByID(i));
            }
            return(accounts);
        }
Esempio n. 2
0
        private void SendAlertToGroup(Alert alert, Group group)
        {
            List <int> groupMembers = _groupMemberRepository.GetMemberAccountIDsByGroupID(group.GroupID);

            foreach (int id in groupMembers)
            {
                alert.AlertID   = 0;
                alert.AccountID = id;
                SaveAlert(alert);
                notify.AccountID = alert.AccountID;
                notify.Body      = alert.Message;
                notify.IsRead    = false;
                _notifycationRepository.SaveNotification(notify);
            }
        }