public ActionResult Comments(int id, feedBackComment feed) { string role = null; ViewData["Role"] = ""; IEnumerable <string> roles = new List <string>(); roles = ((ClaimsIdentity)User.Identity).Claims .Where(c => c.Type == ClaimTypes.Role) .Select(c => c.Value); foreach (var x in roles) { role = x; } if (role != null) { ViewData["Role"] = role; } feedBackComment cmnt = new feedBackComment(); ServiceFeedBack sF = new ServiceFeedBack(); feedback f = new feedback(); f = feed.feedback; f.idUser = User.Identity.GetUserId(); f.description = feed.feedback.description; f.idService = id; sF.Add(f); sF.Commit(); return(RedirectToAction("Index")); }
public ActionResult Comments(int id) { string role = null; ViewData["Role"] = ""; IEnumerable <string> roles = new List <string>(); roles = ((ClaimsIdentity)User.Identity).Claims .Where(c => c.Type == ClaimTypes.Role) .Select(c => c.Value); foreach (var x in roles) { role = x; } if (role != null) { ViewData["Role"] = role; } feedBackComment cmnt = new feedBackComment(); cmnt.feedbacks = se.getFeedBackbyId(id); return(View(cmnt)); }