Beispiel #1
0
        public ActionResult Edit(ReservationExclusionDateModel setting)
        {
            ReservationExclusionDateModel oldSetting = GetOneExclDate(setting.Id);

            if (ModelState.IsValid)
            {
                oldSetting.DateTimeUpdated       = DateTime.UtcNow;
                oldSetting.ExlusionDateName      = setting.ExlusionDateName;
                oldSetting.DateFrom              = setting.DateFrom;
                oldSetting.DateTo                = setting.DateTo;
                _context.Entry(oldSetting).State = System.Data.Entity.EntityState.Modified;
                _context.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Create(ReservationExclusionDateModel setting)
        {
            OutletModel outlet = GetOutletUserAssociated();

            if (ModelState.IsValid)
            {
                setting.DateTimeCreated = DateTime.UtcNow;
                setting.DateTimeUpdated = DateTime.UtcNow;
                setting.OutletId        = outlet.Id;
                setting.Outlet          = outlet;
                outlet.ReservationExclusionDates.Add(setting);

                _context.ReservationExclusionDate.Add(setting);
                _context.Entry(outlet).State = System.Data.Entity.EntityState.Modified;
                _context.SaveChanges();

                return(RedirectToAction("Index"));
            }

            return(View());
        }
Beispiel #3
0
        public ActionResult Edit(int id)
        {
            ReservationExclusionDateModel setting = GetOneExclDate(id);

            return(View(setting));
        }