Ejemplo n.º 1
0
        public IActionResult BoatPage(int id)
        {
            if (id > 0)
            {
                BoatPageVM boat = repository.GetBoatPageVM(id);
                if (boat.VppList.Count() < 1)
                {
                    boat = repository.AddEmptyVPP(boat);
                }

                ViewBag.ActionName  = "UpdateBoat";
                ViewBag.SaveBtnName = "Update Boat";
                return(View(boat));
            }
            else
            {
                ViewBag.SaveBtnName = "Add Boat";
                ViewBag.ActionName  = "AddBoatToDatabase";
                return(View());
            }
        }