Ejemplo n.º 1
0
        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);
        }