コード例 #1
0
        public ActionResult EditReserva(int id)
        {
            var var = this.context.buscarReserva(id);
            IEnumerable <SelectListItem> item = context.listMesas().Select(rol => new SelectListItem
            {
                Text  = rol.NUM_MESA.ToString(),
                Value = rol.NUM_MESA.ToString()
            });

            ViewBag.items = item;
            if (var != null)
            {
                return(View(var));
            }
            else
            {
                return(this.RedirectToAction("Reservas"));
            }
        }