Exemple #1
0
        private void CheckFaxNumber()
        {
            //Make sure that the fax is changed and is new fax is not Blacklisted
            if (_faxChanged.Not())
            {
                return;
            }

            var newFaxNumberIsValid = NewFaxNumber.NotNull() && NewFaxNumber.Number.IsNotEmpty() && !NewFaxNumber.IsBlacklisted;

            if (CurrentAssistant.NotNull() && CurrentAssistant.UserId.IsNotEmpty())
            {
                if (CurrentFaxNumber.NotNull() && CurrentFaxNumber.Number.IsNotEmpty())
                {
                    AddActionSnycItem(ActionSyncType.DeAssignUser, ActionSyncReason.FaxNumberChange, CurrentAssistant.UserId, CurrentFaxNumber.Number);
                }

                if (newFaxNumberIsValid)
                {
                    if (_assistantChanged.Not())
                    {
                        AddActionSnycItem(ActionSyncType.AssignUser, ActionSyncReason.FaxNumberChange, CurrentAssistant.UserId, NewFaxNumber.Number);
                    }
                }
            }

            if (_assistantChanged && NewAssistant.NotNull() && NewAssistant.UserId.IsNotEmpty())
            {
                if (newFaxNumberIsValid)
                {
                    AddActionSnycItem(ActionSyncType.AssignUser, ActionSyncReason.FaxAndAssistantChange, NewAssistant.UserId, NewFaxNumber.Number);
                }
            }
        }
Exemple #2
0
        private void CheckAssistant()
        {
            if (_assistantChanged.Not())
            {
                return;
            }

            if (_faxChanged.Not() && CurrentFaxNumber.NotNull() && CurrentFaxNumber.Number.IsNotEmpty() && CurrentFaxNumber.IsBlacklisted.Not())
            {
                if (CurrentAssistant.NotNull() && CurrentAssistant.UserId.IsNotEmpty())
                {
                    AddActionSnycItem(ActionSyncType.DeAssignUser, ActionSyncReason.AssistantChange, CurrentAssistant.UserId, CurrentFaxNumber.Number);
                }

                if (NewAssistant.NotNull() && NewAssistant.UserId.IsNotEmpty())
                {
                    AddActionSnycItem(ActionSyncType.AssignUser, ActionSyncReason.AssistantChange, NewAssistant.UserId, CurrentFaxNumber.Number);
                }
            }
        }