Example #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());
        }
Example #2
0
        public IActionResult Delete(CandyModel model)
        {
            int id   = -1;
            var repo = new CandyDBRepository();

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

            return(RedirectToAction("Index"));
        }
Example #3
0
        public CandyModel()
        {
            ICandyRepository candyRepo = new CandyDBRepository();

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