Esempio n. 1
0
        public ActionResult Edit(PhaseDetail model)
        {
            ViewBag.Success = false;
            ViewBag.Error = true;

            if (ModelState.IsValid)
            {
                bool success = Context.Phases.Update(model.Phase);

                if (success)
                {
                    ViewBag.Success = true;
                    ViewBag.Error = false;
                }
            }

            // get parcel information
            model.Phase.Parcels = Context.Parcels.GetParcelsByPhaseID(model.Phase.PhaseID) ?? new List<Parcel>();

            // get spot information
            model.SpotInfo = Context.Spots.GetSpotsInfoByPhase(model.Phase.PhaseID);

            // get sponsor information
            model.SponsorInfo = Context.SponsorSpots.GetSpotsInfoByPhase(model.Phase.PhaseID);

            return View(model);
        }
Esempio n. 2
0
        public ActionResult Edit(ObjectId id)
        {
            var model = new PhaseDetail();
            model.Phase = Context.Phases.GetPhase(id);

            // get parcel information
            model.Phase.Parcels = Context.Parcels.GetParcelsByPhaseID(id) ?? new List<Parcel>();

            // get spot information
            model.SpotInfo = Context.Spots.GetSpotsInfoByPhase(id);

            // get sponsor information
            model.SponsorInfo = Context.SponsorSpots.GetSpotsInfoByPhase(id);

            ViewBag.Success = false;
            ViewBag.Error = false;

            return View(model);
        }