// GET: Customers
        public ActionResult Index()
        {
            var customers = new IndexCustomersViewModel()
            {
                Customers = customersList
            };

            return(View(customers));
        }
Example #2
0
        // GET: Customers
        public ActionResult Index()
        {
            var customers = GetCustomers();
            var viewModel = new IndexCustomersViewModel()
            {
                Customers = customers
            };

            return(View(viewModel));
        }
        public ActionResult Detail(int idCustomer)
        {
            var customer = _context.Customers.Include(c => c.MembershipType).SingleOrDefault(c => c.id == idCustomer);

            if (customer == null)
            {
                return(HttpNotFound());
            }

            var view = new IndexCustomersViewModel {
            };

            view.CustomersList.Add(customer);

            return(View(view));
        }
Example #4
0
        // GET: Customers
        public ActionResult Index()
        {
            var customers = new List <Customer>
            {
                new Customer {
                    Id = 1, Name = "John Smit"
                },
                new Customer {
                    Id = 2, Name = "Mary Williams"
                },
            };
            var viewModel = new IndexCustomersViewModel
            {
                Customers = customers
            };

            return(View(viewModel));
        }