//
 // GET: /Notification/Details/5
 public ViewResult Details(int id)
 {
     //Notification notification = db.Notifications.Find(id);
     //return View(notification);
     NotificationDAL dal = new NotificationDAL();
     Notification notification = dal.NotificationFindById(id);
     return View(notification);
 }
        public ActionResult DeleteConfirmed(int id)
        {
            // Notification notification = db.Notifications.Find(id);
            // db.Notifications.Remove(notification);
            // db.SaveChanges();
            // return RedirectToAction("Index");

            NotificationDAL dal = new NotificationDAL();
            Notification notification = dal.DeleteNotificationById(id);
            return RedirectToAction("Index");
        }
 public ActionResult Create(Notification notification)
 {
     if (ModelState.IsValid)
     {
         // db.Notifications.Add(notification);
         // db.SaveChanges();
         // return RedirectToAction("Index");
         NotificationDAL dal = new NotificationDAL();
         dal.CreateNotification(notification);
         return RedirectToAction("Index");
     }
     return View(notification);
 }
        //
        // GET: /Notification/Edit/5
        public ActionResult Edit(int id)
        {
            //Notification notification = db.Notifications.Find(id);
            //return View(notification);

            NotificationDAL dal = new NotificationDAL();
            Notification notification = dal.NotificationFindById(id);
            return View(notification);
        }
        //
        // GET: /Notification/
        public ViewResult Index()
        {
            //return View(db.Notifications.ToList());

            NotificationDAL dal = new NotificationDAL();
            List<Notification> notification = dal.ListOfNotifications();
            return View(notification);
        }
        public ActionResult Edit(Notification notification)
        {
            if (ModelState.IsValid)
            {
                db.Entry(notification).State = EntityState.Modified;
                //db.SaveChanges();
                //return RedirectToAction("Index");

                NotificationDAL dal = new NotificationDAL();
                dal.EditNotification(notification);
                return RedirectToAction("Index");
            }
            return View(notification);
        }