コード例 #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 itSupporterRepo = DependencyUtils.Resolve <IITSupporterRepository>();
            var itSupporter     = itSupporterRepo.GetActive().SingleOrDefault(p => p.ITSupporterId == itSupporterId);


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


            return(itSupporterOfflineFirebaseViewModel);
        }