// GET: LetterTemplate
        public ActionResult Index()
        {
            IDbRepoInstantiator factory = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;

            ViewBag.Excuses = factory.GetExcuseRepo().GetExcuseTitles();
            return(View(factory.GetLetterTemplateRepo().GetLetterTemplates()));
        }
Пример #2
0
        public ActionResult Category(string category)
        {
            IDbRepoInstantiator factory      = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;
            IList <Excuse>      givenExcuses = factory.GetExcuseRepo().GetExcuses(category);

            return(View(nameof(Index), givenExcuses));
        }
Пример #3
0
        // GET: Excuse
        public ActionResult Index()
        {
            IDbRepoInstantiator factory      = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;
            IList <Excuse>      givenExcuses = factory.GetExcuseRepo().GetExcuses();

            return(View(givenExcuses));
        }
Пример #4
0
        public IActionResult GetExcuse()
        {
            IDbRepoInstantiator factory = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;
            Excuse givenExcuse          = new Excuse();

            try
            {
                givenExcuse = factory.GetExcuseRepo(Program.AppLogger).GetAnExcuse();
            }
            catch (Exception) {
            }
            return(Json(givenExcuse));
        }
Пример #5
0
        public IActionResult GetRandomExcuse()
        {
            IDbRepoInstantiator factory = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;

            return(Content(factory.GetExcuseRepo().GetRandomExcuse()));
        }