コード例 #1
0
        public string ConverMessageJsonForITSupporterOfflineFirebaseViewModel(ITSupporterOfflineFirebaseViewModel data, Notification noti)
        {
            Dictionary <string, object> androidMessageDic = new Dictionary <string, object>();

            androidMessageDic.Add("to", $"/topics/{data.ITSupporterId}");
            androidMessageDic.Add("data", data);
            androidMessageDic.Add("notification", noti);

            return(JsonConvert.SerializeObject(androidMessageDic));
        }
コード例 #2
0
        public ITSupporterOfflineFirebaseViewModel RenderDataForITSupporterOffline(int itSupporterId)
        {
            var accountService     = new AccountService();
            var itSupporterService = new ITSupporterService();
            var itSupporter        = itSupporterService.GetAll().SingleOrDefault(p => p.ITSupporterId == itSupporterId);
            var account            = accountService.GetAll().SingleOrDefault(a => a.AccountId == itSupporter.AccountId);

            var itSupporterOfflineFirebaseViewModel = new ITSupporterOfflineFirebaseViewModel()
            {
                ITSupporterName = itSupporter.ITSupporterName,
                ITSupporterId   = itSupporter.ITSupporterId,
                isOnline        = itSupporter.IsOnline ?? false,
                AccountId       = itSupporter.AccountId,
                Username        = account.Username
            };


            return(itSupporterOfflineFirebaseViewModel);
        }