Esempio n. 1
0
        public ActionResult Index()
        {
            var service = ExampleHelper.GetServiceModel(RouteData);

            ViewData["CanAdd"] = ExampleHelper.CanAdd(RouteData) ? "1" : "0";
            ViewData["Exists"] = null == service ? "0" : "1";

            if (null != service)
            {
                ViewData["FirstName"] = service.FirstName ?? "No name";
                ViewData["LastName"]  = service.LastName ?? "No name";
                ViewData["Number"]    = service.Number ?? "0";
            }

            return(View());
        }