Example #1
0
        private void UpdateIsRead(int feedbackId)
        {
            CredentialManage credential = JsonConvert.DeserializeObject <CredentialManage>(HttpContext.Session.GetString(Constants.VM_MANAGE));
            Feedback         feedback   = GetApiFeedbacks.GetFeedbacks(credential.JwToken).SingleOrDefault(p => p.FeedbackId == feedbackId);

            // update
            feedback.IsRead = !feedback.IsRead;
            GetApiFeedbacks.Update(feedback, credential.JwToken);
        }
Example #2
0
        public IActionResult UpdateAllIsRead()
        {
            CredentialManage credential = JsonConvert.DeserializeObject <CredentialManage>(HttpContext.Session.GetString(Constants.VM_MANAGE));
            List <Feedback>  feedbacks  = GetApiFeedbacks.GetFeedbacks(credential.JwToken).ToList();

            foreach (var feedback in feedbacks)
            {
                feedback.IsRead = true;
                GetApiFeedbacks.Update(feedback, credential.JwToken);
            }

            return(RedirectToAction("Index"));
        }