Esempio n. 1
0
        public ActionResult Save(ParkingSpaceViewModel model)
        {
            var space = model.ToParkingSpace();

            space.Parking = GetParkingFromCurrentLocalAdmin();
            BusinessManager.Instance.ParkingsSpaces.Update(space);

            var spaces = GetParkingFromCurrentLocalAdmin().Spaces;

            return(View("Manage", spaces));
        }
Esempio n. 2
0
        public ActionResult Save(ParkingSpaceViewModel model)
        {
            var space = model.ToParkingSpace();

            space.Parking = GetParkingFromCurrentLocalAdmin();
            BusinessManager.Instance.ParkingsSpaces.Update(space);

            var spaces = GetParkingFromCurrentLocalAdmin().Spaces;

            return View("Manage", spaces);
        }
Esempio n. 3
0
        public ActionResult Add(ParkingSpaceViewModel model)
        {
            var parking = GetParkingFromCurrentLocalAdmin();
            var space   = model.ToParkingSpace();

            space.Parking = parking;

            try
            {
                BusinessManager.Instance.ParkingsSpaces.Add(space);
            }
            catch (UniqueKeyViolationException)
            {
                ModelState.AddModelError("", "Já uma vaga nesse estacionamento com o mesmo número.");
                return(View(model));
            }

            var spaces = GetParkingFromCurrentLocalAdmin().Spaces;

            return(View("Manage", spaces));
        }
Esempio n. 4
0
        public ActionResult Add(ParkingSpaceViewModel model)
        {
            var parking = GetParkingFromCurrentLocalAdmin();
            var space = model.ToParkingSpace();

            space.Parking = parking;

            try
            {
                BusinessManager.Instance.ParkingsSpaces.Add(space);
            }
            catch (UniqueKeyViolationException)
            {
                ModelState.AddModelError("", "Já uma vaga nesse estacionamento com o mesmo número.");
                return View(model);
            }

            var spaces = GetParkingFromCurrentLocalAdmin().Spaces;

            return View("Manage", spaces);
        }