Esempio n. 1
0
        public ActionResult GetNotificationById(string notificationId)
        {
            var result   = _client.GetAsync($"/notifications/{notificationId}");
            var response = new NotificationDm();

            if (result.Result.IsSuccessStatusCode)
            {
                response = result.Result.Content.ReadAsAsync <NotificationDm>().Result;
            }
            return(PartialView("_GetNotificationById", response));
        }
Esempio n. 2
0
        public async Task <ActionResult> AddNotification(NotificationDm notification)
        {
            var user     = (LoginDetailDm)Session["SessionData"];
            var response = new NotificationDm();

            notification.Id = Guid.NewGuid().ToString();
            notification.NotificationFrom = user.Id;
            var result = await _client.PostAsJsonAsync("/notifications", notification);

            if (result.IsSuccessStatusCode)
            {
                response = result.Content.ReadAsAsync <NotificationDm>().Result;
                var message = new Message
                {
                    RecipientName  = "swati",
                    MessageContent = "hello"
                };
                // var clientAdapter = new ClientAdapter();
                var state = ClientAdapter.Instance.EmployeeSendMessage(message);
            }

            return(View("ManagerNotification"));
        }