コード例 #1
0
 public JobRepo(IAccountContextProvider accountContextProvider, ILogger logger, INotificationRepo notificationRepo, IPilotRepo pilotRepo)
 {
     _accountContextProvider = accountContextProvider;
     _logger           = logger;
     _notificationRepo = notificationRepo;
     _pilotRepo        = pilotRepo;
 }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: M3talen/Melkor
 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
ファイル: AdminController.cs プロジェクト: M3talen/Melkor
 public AdminController(UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager,
                        INotificationRepo notificationRepo, ITestRepo testRepo)
 {
     _userManager    = userManager;
     _roleManager    = roleManager;
     this.notifyRepo = notificationRepo;
     this.testRepo   = testRepo;
 }
コード例 #4
0
ファイル: UnitOfWork.cs プロジェクト: tchimev/GigHubMvc
 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));
        }
コード例 #6
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));
        }
コード例 #9
0
        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;
 }
コード例 #20
0
 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;
 }