Exemplo n.º 1
0
        public IActionResult Index()
        {
            IEnumerable <HouseholdProfile>            listOfHousehold = _householdProfile.GetAll();
            IEnumerable <HouseholdProfileDetailModel> householdModels = listOfHousehold
                                                                        .Select(h => new HouseholdProfileDetailModel
            {
                Id        = h.Id,
                ProfileId = h.ProfileId,
                Address   = h.Address,
                Barangay  = h.Barangay.Name,
                Note      = h.Note
            }).ToList();
            var model = new HouseholdProfileIndexModel()
            {
                Households = householdModels
            };

            return(View(model));
        }
        public IActionResult Create()
        {
            List <Person> personList = new List <Person>();

            personList = (from person in _person.Getall() select person).ToList();
            personList.Insert(0, new Person {
                Id = 0, LastName = "Select"
            });
            ViewBag.ListOfPerson = personList;

            List <HouseholdProfile> householdProfileList = new List <HouseholdProfile>();

            householdProfileList = (from household in _householdProfile.GetAll() select household).ToList();
            householdProfileList.Insert(0, new HouseholdProfile {
                Id = 0, ProfileId = "Select Profile"
            });
            ViewBag.ListOfHouseholdProfile = householdProfileList;

            return(View());
        }