コード例 #1
0
        public TreaterModel()
        {
            ICandyRepository candyRepo = new CandyDBRepository();

            CandyList = new List <Candy>(candyRepo.GetList());

            ICostumeRepository costumeRepo = new CostumeDBRepository();

            CostumeList = new List <Costume>(costumeRepo.GetList());

            ITreaterRepository treaterRepo = new TreaterDBRepository();

            TreaterList = new List <Treater>(treaterRepo.GetList());
        }
コード例 #2
0
        public IActionResult Delete(CostumeModel model)
        {
            int id   = -1;
            var repo = new CostumeDBRepository();

            foreach (var costume in repo.GetList())
            {
                if (costume.Name == model.Name)
                {
                    id = costume.Id;
                    break;
                }
            }
            if (id != -1)
            {
                repo.Delete(id);
            }

            return(RedirectToAction("Index"));
        }
コード例 #3
0
        public CostumeModel()
        {
            ICostumeRepository costumeRepo = new CostumeDBRepository();

            CostumeList = new List <Costume>(costumeRepo.GetList());
        }