示例#1
0
        public async Task <IActionResult> OnPost()
        {
            if (UpdatedNews != null)
            {
                if (UpdatedNews.Body != null)
                {
                    NewsHandler newsHandler = new NewsHandler();
                    newsHandler.SaveNews(UpdatedNews);
                }
            }

            if (openHours != null && (openHours.Days != null || openHours.Houres != null))
            {
                OpenHoursHandler openHoursHandler = new OpenHoursHandler();
                openHoursHandler.Save(openHours);
            }

            await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);


            return(Redirect("/Index"));
        }
示例#2
0
        public void OnGet()
        {
            NewsHandler newsHandler = new NewsHandler();

            LastNews = newsHandler.GetNews();
        }