Example #1
0
        public ActionResult DeleteReservation(RezervTable table)
        {
            string message = "";

            _service.DeleteTable(table, out message);
            return(RedirectToAction("ReservationList"));
        }
Example #2
0
        public ActionResult _ReservationPartial(RezervTable table)
        {
            string message = "";

            _service.CreateTable(table, out message);
            _notificationService.Notify();
            return(RedirectToAction("Index", "Home", new { message }));
        }
Example #3
0
 public bool EditTable(RezervTable table, out string message)
 {
     using (ModelEntity db = new ModelEntity())
     {
         try
         {
             db.Entry(table).State = EntityState.Modified;
             db.SaveChanges();
             message = "Резервация изменена успешно";
             return(true);
         }
         catch (Exception ex)
         {
             message = ex.Message;
             return(false);
         }
     }
 }
Example #4
0
 public bool CreateTable(RezervTable table, out string message)
 {
     using (ModelEntity db = new ModelEntity())
     {
         try
         {
             db.RezervTables.Add(table);
             db.SaveChanges();
             message = "Резервация прошла успешно";
             return(true);
         }
         catch (Exception ex)
         {
             message = ex.Message;
             return(false);
         }
     }
 }
Example #5
0
 public bool DeleteTable(RezervTable table, out string message)
 {
     using (ModelEntity db = new ModelEntity())
     {
         try
         {
             RezervTable t = db.RezervTables.FirstOrDefault(p => p.TableId == table.TableId);
             db.RezervTables.Remove(t);
             db.SaveChanges();
             message = "Резервация удалена успешно";
             return(true);
         }
         catch (Exception ex)
         {
             message = ex.Message;
             return(false);
         }
     }
 }
Example #6
0
        public ActionResult DetailsReservation(int id)
        {
            RezervTable t = _service.GetRezervTables().FirstOrDefault(p => p.TableId == id);

            return(View(t));
        }