コード例 #1
0
        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"));
        }
コード例 #2
0
ファイル: DemoHub.cs プロジェクト: rfire01/SAGLET
        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);
        }