Example #1
0
        public ActionResult ViewRelated(int id)
        {
            using (BLLContext ctx = new BLLContext())
            {
                NumberBLL item = ctx.Numbers.FindNumber(id);
                ctx.LoadingItems.LoadRelatedNumbersIntoNumber(item);

                return(View(item));
            }
        }
Example #2
0
        public ActionResult Create(NumberBLL number)
        {
            try
            {
                using (BLLContext ctx = new BLLContext())
                {
                    ctx.Numbers.InsertNewNumber(number.Name, number.Doublestuff, number.Floatstuff);

                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                return(View("exception", ex));
            }
        }
Example #3
0
        public ActionResult Delete(int id, NumberBLL number)
        {
            try
            {
                // TODO: Add delete logic here
                using (BLLContext ctx = new BLLContext())
                {
                    ctx.Numbers.JustDeleteANumber(id);

                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                return(View("exception", ex));
            }
        }