示例#1
0
        public void AddRecipientToGroup(int identity)
        {
            _logger.Info($"Adding new recipient to current group. Recipient ID: {identity}.");

            //check if this item is already added
            if (GroupRecipientsList.Where(x => x.Identity == identity).Count() == 0)
            {
                SMSrecipientDefinition item = AvailableSMSrecipientsList.Where(x => x.Identity == identity).ToList().First();
                GroupRecipientsList.Add(item);
            }
        }
示例#2
0
        public void RemoveRecipientFromGroup(int identity)
        {
            _logger.Info($"Removing recipient from current group. Recipient ID: {identity}.");

            if (GroupRecipientsList.Count >= 2)
            {
                SMSrecipientDefinition item = GroupRecipientsList.Where(x => x.Identity == identity).ToList().First();
                GroupRecipientsList.Remove(item);
            }
            else
            {
                _logger.Info($"The last recipient from recipients group cannot be deleted.");
                MessageBox.Show($"You cannot delete last recipient from the group. The SMS recipients group has to consists of at least one recipient.",
                                "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
示例#3
0
        private void ChangeHeadingProperties()
        {
            _logger.Info($"Populating heading data with information of specific  recipients group.");

            if (SelectedShortGroup != null)
            {
                SMSrecipientsGroupDefinition definition = _originalRecipientsGroups.Single(x => x.Identity == SelectedShortGroup.Identity);

                CreatedBy         = definition.CreatedBy;
                ModifiedBy        = definition.ModifiedBy;
                AmountOfreceivers = definition.AmountOfRecipients;

                PopulateSMSRecipipentsOnSingleGroupListView(definition.Identity);
            }
            else
            {
                CreatedBy         = "-----";
                ModifiedBy        = "-----";
                AmountOfreceivers = 0;

                GroupRecipientsList.Clear();
            }
        }