public ActionResult DeleteConfirmed(int roomID, string username, string cpText) { FeedBack feedBack = db.FeedBacks.Find(username, cpText, roomID); db.FeedBacks.Remove(feedBack); db.SaveChanges(); return(RedirectToAction("Index")); }
public void SaveFeedBack(string username, int roomID, string cpText, int stars) { FeedBack fb = null; using (DemoModal db = new DemoModal()) { fb = db.FeedBacks.Find(username, cpText, roomID); if (fb == null) { fb = new FeedBack(); fb.username = username; fb.roomID = roomID; fb.cpText = cpText; db.FeedBacks.Add(fb); } fb.timeStamp = DateTime.Now; fb.stars = stars; db.SaveChanges(); } Clients.Caller.feedBackSaved(fb); }