public long Create(tbl_Notification notification)
 {
     notification.dNgayTB = DateTime.Now;
     db.tbl_Notification.Add(notification);
     db.SaveChanges();
     return(notification.ID);
 }
Beispiel #2
0
 public ActionResult Create(tbl_Notification model)
 {
     if (ModelState.IsValid)
     {
         new NotificationDAO().Create(model);
         return(RedirectToAction("Index"));
     }
     setViewBag();
     return(View());
 }
Beispiel #3
0
        public ActionResult Edit(tbl_Notification model)
        {
            if (ModelState.IsValid)
            {
                new NotificationDAO().Edit(model);
                SetAlert("Cập nhật thành công", "success");
                return(RedirectToAction("Index"));
            }


            return(View());
        }
        public bool Edit(tbl_Notification notification)
        {
            try
            {
                var addNoti = db.tbl_Notification.Find(notification.ID);
                addNoti.sTittle      = notification.sTittle;
                addNoti.sHinhAnh     = notification.sHinhAnh;
                addNoti.IDkhachhang  = notification.IDkhachhang;
                addNoti.sChiTiet     = notification.sChiTiet;
                addNoti.bApplyForAll = notification.bApplyForAll;
                addNoti.dNgayTB      = DateTime.Now;
                db.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }