예제 #1
0
        public static void UpdateNotification(string ToUser, int CompanyID, int number)
        {
            UserOnline             us      = new UserOnline();
            List <UserOnlineModel> list    = us.GetUserOnline();
            IHubContext            context = GlobalHost.ConnectionManager.GetHubContext <UserNoti>();

            foreach (UserOnlineModel item in list)
            {
                if (item.UserName.Trim().ToLower() == ToUser.Trim().ToLower() && item.Company == CompanyID)
                {
                    context.Clients.Client(item.ClientID).updateUsersNotification(number);
                    break;
                }
            }
        }
예제 #2
0
        public static void SendMessage(MessageNotification model)
        {
            UserOnline             us      = new UserOnline();
            List <UserOnlineModel> list    = us.GetUserOnline();
            IHubContext            context = GlobalHost.ConnectionManager.GetHubContext <UserNoti>();

            foreach (UserOnlineModel item in list)
            {
                if (item.UserName.Trim().ToLower() == model.ToUser.Trim().ToLower() && item.Company == model.CompanyID)
                {
                    context.Clients.Client(item.ClientID).showUsersNotification(model);
                    break;
                }
            }
        }