// Code thêm 1 phản hồi.
 public bool Create(PdbFeedback fe)
 {
     fe.ID = Guid.NewGuid();
     this._context.PdbFeedbacks.Add(fe);
     this._context.Entry(fe).State = System.Data.Entity.EntityState.Added;
     return(this._context.SaveChanges() == 1);
 }
Exemplo n.º 2
0
 public ActionResult Feedback(PdbFeedback feed) //Add
 {
     if (feed.NumberStar < 0 || feed.NumberStar > 5)
     {
         ModelState.AddModelError("", "Số sao chỉ nằm trong khoảng từ 1 đến 5");
     }
     else
     {
         if (ModelState.IsValid)
         {
             bool check = _context.Create(feed);
             if (check)
             {
                 ModelState.AddModelError("", "Cảm ơn phản hồi của bạn!");
             }
             else
             {
                 return(RedirectToAction("Create"));
             }
         }
     }
     return(View());
 }
 public bool Edit(PdbFeedback fe)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
        public ActionResult Details(Guid id)
        {
            PdbFeedback mete = this._context.GetOne(id);

            return(View(mete));
        }