Ejemplo n.º 1
0
        // GET: Cultures
        public ActionResult Index()
        {
            IDbRepoInstantiator         factory  = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;
            IList <LocalizationCulture> Cultures = factory.GetCultureRepo(Program.AppLogger).GetSupportedCultures();

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

            ViewBag.Excuses = factory.GetExcuseRepo().GetExcuseTitles();
            return(View(factory.GetLetterTemplateRepo().GetLetterTemplates()));
        }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
0
        // GET: Excuse
        public ActionResult Index()
        {
            IDbRepoInstantiator factory      = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;
            IList <Excuse>      givenExcuses = factory.GetExcuseRepo().GetExcuses();

            return(View(givenExcuses));
        }
        public ActionResult MakeLetter(int id, string excuseName)
        {
            IDbRepoInstantiator factory  = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;
            LetterTemplate      template = factory.GetLetterTemplateRepo().GetLetterTemplateInHtmlForm(id);

            ViewBag.Excuse = excuseName;
            return(View(nameof(Details), template));
        }
        // GET: LetterTemplate/Details/5
        public ActionResult Details(int id)
        {
            IDbRepoInstantiator factory  = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;
            LetterTemplate      template = factory.GetLetterTemplateRepo().GetLetterTemplateInHtmlForm(id);

            ViewBag.Excuse = "Flu";
            return(View(template));
        }
Ejemplo n.º 7
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));
        }
Ejemplo n.º 8
0
        public IActionResult AlternateTitle(string title)
        {
            IDbRepoInstantiator factory = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;

            return(Json(factory.GetAlternateExcuseRepo().GetExcuseAlteration(title)));
        }
Ejemplo n.º 9
0
        public IActionResult GetRandomExcuse()
        {
            IDbRepoInstantiator factory = HttpContext.RequestServices.GetService(typeof(IDbRepoInstantiator)) as IDbRepoInstantiator;

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