Exemplo n.º 1
0
        public ActionResult WpDetail(WpModel model)
        {
            if (ModelState.IsValid)
            {
                model.Available = !model.Available;

                // Set the work point
                WpRepo.SetWpAvailability(model.Id, model.Available);
                UpdateWpModelProperty(ref model);
            }

            return(View("Confirmation", model));
        }
Exemplo n.º 2
0
        public ActionResult WpDetail(int id)
        {
            // Get the work point
            var model = new WpModel()
            {
                Id = id,
            };

            UpdateWpModelProperty(ref model);

            // See if the work point is on the available list
            model.Available = WpRepo.SearchFor(wp => wp.Id == id).Any();

            return(View(model));
        }
Exemplo n.º 3
0
        //public ActionResult Confirmation(WpModel model)
        //{
        //    return View(model);
        //}

        private void UpdateWpModelProperty(ref WpModel model)
        {
            model.Level = model.Id / 1000;
            model.Num   = model.Id % 1000;
        }