Esempio n. 1
0
        public IActionResult Chore(HouseModel model)
        {
            ChoreServiceRefence.Chore[] chores = choreService.GetChoresForHouseAsync(model.Id).Result;
            List <ChoreModel>           chore  = new List <ChoreModel>();

            foreach (var item in chores)
            {
                string username;
                if (item.Person == null)
                {
                    username = null;
                }
                else
                {
                    username = item.Person.UserName;
                }
                chore.Add(new ChoreModel {
                    Id = item.Id, EndDate = item.DueDate, HouseId = model.Id, Name = item.Description, Person = username, Status = (ChoreModel.StatusEnum)item.Status
                });
            }
            ViewBag.houseid = model.Id;
            ViewBag.list    = chore;
            return(View("ChoreView"));
        }