예제 #1
0
        private void GetAll()
        {
            BindingSource bindingSource = new BindingSource();

            bindingSource.DataSource = personServices.GetAll();
            dgv.DataSource           = bindingSource;
            dgv.ClearSelection();
        }
예제 #2
0
        static void List()
        {
            // View
            Console.Clear();

            // Controller
            // IDataMapper<Person> dalPerson = new PersonFileDataMapper();
            // List<Person> persons = dalPerson.GetAll();
            IPersonServices personServices = new PersonServices();
            List <Person>   persons        = personServices.GetAll();

            // View
            foreach (Person person in persons)
            {
                //Console.WriteLine("Id: {0}, Name: {1}", person.Id, person.Name);
                Console.WriteLine(person);
            }

            // View
            Console.WriteLine("Press any kay to go back");
            Console.ReadLine();
        }
예제 #3
0
        public IEnumerable <Person> GetAll()
        {
            IEnumerable <Person> operationResult = _PersonServices.GetAll();

            return(operationResult);
        }
        public ActionResult Index()
        {
            var ps = new PersonServices();

            return(View(ps.GetAll()));
        }