예제 #1
0
 public JobRepo(IAccountContextProvider accountContextProvider, ILogger logger, INotificationRepo notificationRepo, IPilotRepo pilotRepo)
 {
     _accountContextProvider = accountContextProvider;
     _logger           = logger;
     _notificationRepo = notificationRepo;
     _pilotRepo        = pilotRepo;
 }
예제 #2
0
 public HomeController(IHostingEnvironment environment, UserManager <ApplicationUser> userManager, IConfigurationRoot configuration, INotificationRepo notificationRepo, ITestRepo testRepo)
 {
     this._environment = environment;
     this._userManager = userManager;
     this._location    = configuration.GetSection("Environment")["Storage"];
     this.testRepo     = testRepo;
     this.notifyRepo   = notificationRepo;
 }
예제 #3
0
 public AdminController(UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager,
                        INotificationRepo notificationRepo, ITestRepo testRepo)
 {
     _userManager    = userManager;
     _roleManager    = roleManager;
     this.notifyRepo = notificationRepo;
     this.testRepo   = testRepo;
 }
예제 #4
0
 public UnitOfWork(ApplicationDbContext db)
 {
     _db           = db;
     Gigs          = new GigRepo(_db);
     Attendances   = new AttendanceRepo(_db);
     Genres        = new GenreRepo(_db);
     Followings    = new FollowingRepo(_db);
     Notifications = new NotificationRepo(_db);
 }
예제 #5
0
        public void NotificationRepository_DeleteById_ThrowsExceptionWhenIdNotFound()
        {
            //arrange
            INotificationRepo nr = GetInMemoryNotificationRepository();


            //assert
            Assert.ThrowsAny <ArgumentNullException>(() => nr.DeleteById(0));
        }
        public ActionResult LoadAllAlert()
        {
            notifyRepo   = new NotificationRepo();
            repoResponse = new RepositoryResponse();
            string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString();

            repoResponse = notifyRepo.GetNotificationsByEmployeeNumber(_loggedInUserID);

            return(Json(new { success = repoResponse.success, message = repoResponse.message, Data = repoResponse.Data }));
        }
예제 #7
0
 public NotificationService(
     IUnitWork unitWork,
     INotificationRepo repo,
     IGlobalMessageFactory globalMessageFactory,
     IMessageFactory messageFactory)
 {
     _unitWork             = unitWork;
     _repo                 = repo;
     _globalMessageFactory = globalMessageFactory;
     _messageFactory       = messageFactory;
 }
예제 #8
0
        public void NotificationRepository_DeleteById_DeletesNotification()
        {
            //arrange
            INotificationRepo nr = GetInMemoryNotificationRepository();

            //act
            nr.Add(notification);
            nr.DeleteById(1); //NotificationId should be 1

            //assert
            Assert.ThrowsAny <ArgumentNullException>(() => nr.GetById(1));
        }
        public JsonResult LoadNewAltertForBellICon()
        {
            notifyRepo   = new NotificationRepo();
            repoResponse = new RepositoryResponse();
            string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString();

            repoResponse = notifyRepo.GetNotificationsByEmployeeNumberTOP3(_loggedInUserID);

            var sa = new JsonSerializerSettings();

            return(Json(repoResponse.Data, JsonRequestBehavior.AllowGet));

            //return Json(new { success = repoResponse.success, message = repoResponse.message, Data = repoResponse.Data });
        }
예제 #10
0
        public async Task SendAsync(Notification notification, INotificationRepo notificationRepo)
        {
            await TelegramBot._client.SendTextMessageAsync(notification.Receiver, notification.Content);

            var updateModel = new UpdateNotificationDto
            {
                NotificationId = notification.NotificationId,
                Status         = NotificationStatus.Success,
                SendDateMi     = DateTime.Now,
                SendStatus     = "Success",
                IsLock         = true
            };
            await notificationRepo.UpdateAsync(updateModel);
        }
예제 #11
0
        public void NotificationRepository_Add_AddsNotification()
        {
            //arrange
            INotificationRepo nr = GetInMemoryNotificationRepository();

            //act
            nr.Add(notification);
            var savedNotification = nr.GetById(1);

            //assert
            Assert.Equal(1, savedNotification.ReceiverId);
            Assert.Equal(2, savedNotification.SenderId);
            Assert.Equal("like", savedNotification.Type);
            Assert.Equal(1, savedNotification.ReviewId);
            Assert.True(savedNotification.Status);
        }
예제 #12
0
        public Task Create(NotificationDto notifyDto, INotificationRepo notificationRepo, int applicationId)
        {
            var notification = new Notification {
                TryCount = 0,
                Type     = NotificationType.Sms,
                Status   = NotificationStatus.Insert,

                ApplicationId = applicationId,
                ExtraData     = notifyDto.UserId.ToString(),
                Content       = notifyDto.Content,
                FullName      = notifyDto.FullName,
                Receiver      = notifyDto.MobileNumber.ToString()
            };

            notificationRepo.AddAsync(notification);

            return(Task.CompletedTask);
        }
예제 #13
0
        public void NotificationRepository_GetByUserId_ReturnsIEnumerable()
        {
            //arrange
            INotificationRepo nr            = GetInMemoryNotificationRepository();
            Notification      notification2 = new Notification
            {
                Type       = "like",
                ReceiverId = 1,
                SenderId   = 3,
                Status     = true,
                ReviewId   = 2
            };

            //act
            nr.Add(notification);
            nr.Add(notification2);

            //assert
            Assert.IsAssignableFrom <IEnumerable <Notification> >(nr.GetByReceiverId(1));
        }
예제 #14
0
 public EvaluationService(
     IUnitWork unitWork,
     INotificationRepo repo,
     IGlobalMessageFactory globalMessageFactory,
     IMessageFactory messageFactory,
     IEvaluationRepo repo1,
     MedicalRepEvaluationsHandlers medicalRepHandlers,
     VisitAssertion visitAssertion,
     IVisitInteracting interacting,
     IMapper mapper,
     INotificationTypeRepo notificationTypeRepo
     ) : base(unitWork, repo, globalMessageFactory, messageFactory)
 {
     _unitWork             = unitWork;
     _repo                 = repo1;
     _medicalRepHandlers   = medicalRepHandlers;
     _visitAssertion       = visitAssertion;
     _interacting          = interacting;
     _mapper               = mapper;
     _notificationTypeRepo = notificationTypeRepo;
     _eventBuilder         = new EvaluationEventBuilder(_notificationTypeRepo);
 }
예제 #15
0
        public void NotificationRepository_DeleteByUserId_DeletesNotifications()
        {
            //arrange
            INotificationRepo nr            = GetInMemoryNotificationRepository();
            Notification      notification2 = new Notification
            {
                Type       = "like",
                ReceiverId = 1,
                SenderId   = 3,
                Status     = true,
                ReviewId   = 2
            };

            //act
            nr.Add(notification);
            nr.Add(notification2);

            nr.DeleteByUserId(1); //both notifications have same receiver id

            //assert
            Assert.ThrowsAny <ArgumentNullException>(() => nr.GetById(1));
            Assert.ThrowsAny <ArgumentNullException>(() => nr.GetById(2));
        }
예제 #16
0
        public async Task SendAsync(Notification notification, INotificationRepo notificationRepo)
        {
            var sendResult = await LinePayamakProvider.SendSmsAsync(notification.Receiver, notification.Content);

            var updateModel = new UpdateNotificationDto
            {
                NotificationId = notification.NotificationId,
                SendDateMi     = DateTime.Now,
                SendStatus     = sendResult
            };

            if (sendResult.Split(':')[1] == "1")
            {
                updateModel.Status = NotificationStatus.Success;
                updateModel.IsLock = true;
            }
            else
            {
                updateModel.Status = NotificationStatus.Failed;
                updateModel.IsLock = false;
            }

            await notificationRepo.UpdateAsync(updateModel);
        }
예제 #17
0
 public Task SendAsync(Notification notification, INotificationRepo notifierUnitOfWork)
 {
     throw new NotImplementedException();
 }
예제 #18
0
 public NotificationService(INotificationRepo repo) : base(repo)
 {
     this.repo = repo;
 }
예제 #19
0
 public NotificationService(INotificationRepo notificationRepo, IUserRepo userRepo, INotificationHub notificationHub)
 {
     this.notificationRepo = notificationRepo;
     this.userRepo         = userRepo;
     this.notificationHub  = notificationHub;
 }
 public GlobalMessageReadingHandler(INotificationRepo notificationRepo, int repId)
 {
     _notificationRepo = notificationRepo;
     _repId            = repId;
 }
예제 #21
0
 public SkillRepo(IAccountContextProvider accountContextProvider, ILogger logger, INotificationRepo notificationRepo)
 {
     _logger = logger;
     _accountContextProvider = accountContextProvider;
     _notificationRepo       = notificationRepo;
 }
예제 #22
0
 public NotificationService()
 {
     this.Repository = new NotificationRepo();
 }
예제 #23
0
 public GlobalMessageRead(GlobalMessage globalMessage, INotificationRepo notificationRepo, int repId)
 {
     _globalMessage    = globalMessage;
     _notificationRepo = notificationRepo;
     _repId            = repId;
 }