Пример #1
0
        public void Should_UpdateNotificationOperationCode()
        {
            NotificationOperationCode notificationOperationCode = new NotificationOperationCode(OpCode, arName, enName, panelAr, panelEn, emailAr, emailEn, smsAr, smsEn, catId, roleId);

            notificationOperationCode.UpdateNotificationOperationCode(OpCode, arName, enName, panelAr, panelEn, emailAr, emailEn, smsAr, smsEn, catId, roleId);
            notificationOperationCode.ShouldNotBeNull();
        }
Пример #2
0
        public NotificationOperationCode GetNotificationOperationCodeData()
        {
            NotificationOperationCode notificationOperation = new NotificationOperationCode("OpCode", "arName", "enName", "panelAr", "panelEn", "emailAr", "emailEn", "smsAr", "smsEn", 1, 1);

            notificationOperation.setNotificationOperationCodeIdForTest();
            return(notificationOperation);
        }
Пример #3
0
        public async Task <NotificationOperationCode> AddNotificationOperationCode(NotificationOperationCode notificationOperationCode)
        {
            Check.ArgumentNotNull(nameof(notificationOperationCode), notificationOperationCode);

            _context.NotificationOperationCodes.Add(notificationOperationCode);

            await _context.SaveChangesAsync();

            return(notificationOperationCode);
        }
Пример #4
0
        public List <NotificationOperationCode> GetNotificationOperationCode()
        {
            List <NotificationOperationCode> notificationOperationCodes = new List <NotificationOperationCode>();

            NotificationOperationCode notificationOperation = new NotificationOperationCode("OpCode", "arName", "enName", "panelAr", "panelEn", "emailAr", "emailEn", "smsAr", "smsEn", 1, 1);

            notificationOperation.setNotificationOperationCodeIdForTest();
            notificationOperationCodes.Add(notificationOperation);

            return(notificationOperationCodes);
        }
Пример #5
0
        public void Should_Construct_NotificationOperationCode()
        {
            NotificationOperationCode notificationOperationCode = new NotificationOperationCode(OpCode, arName, enName, panelAr, panelEn, emailAr, emailEn, smsAr, smsEn, catId, roleId);

            _ = new NotificationOperationCode();
            _ = notificationOperationCode.NotificationOperationCodeId;
            _ = notificationOperationCode.UserRole;
            _ = notificationOperationCode.EmailSubjectTemplateAr;
            _ = notificationOperationCode.EmailSubjectTemplateEn;
            _ = notificationOperationCode.NotificationCategory;

            notificationOperationCode.ShouldNotBeNull();
        }
Пример #6
0
        public async Task SaveOperationCode(OperationCodeViewModel operationCode)
        {
            int Id = string.IsNullOrEmpty(operationCode.IdString) ? 0 : Util.Decrypt(operationCode.IdString);

            if (Id == 0)
            {
                var op = new NotificationOperationCode(operationCode.OperationCode, operationCode.ArabicName, operationCode.EnglishName, operationCode.PanelTemplateAr, operationCode.PanelTemplateEn, operationCode.EmailBodyTemplateAr, operationCode.EmailBodyTemplateEn, operationCode.SmsTemplateAr, operationCode.SmsTemplateEn, operationCode.NotificationCategoryId, operationCode.UserRoleId);
                await _notifayCommands.AddNotificationOperationCode(op);
            }
            else
            {
                var opCode = await _iNotificationQuerie.FindNotificationOperationCode(Util.Decrypt(operationCode.IdString));

                opCode.UpdateNotificationOperationCode(operationCode.OperationCode, operationCode.ArabicName, operationCode.EnglishName, operationCode.PanelTemplateAr, operationCode.PanelTemplateEn, operationCode.EmailBodyTemplateAr, operationCode.EmailBodyTemplateEn, operationCode.SmsTemplateAr, operationCode.SmsTemplateEn, operationCode.NotificationCategoryId, operationCode.UserRoleId);
                await _notifayCommands.UpdateNotificationOperationCode(opCode);
            }
            await _notifayCommands.SaveChangesAsync();
        }