Exemplo n.º 1
0
        public async Task <ActionResult> Index()
        {
            ViewBag.TotalCount = LeaveMessageService.Count(m => m.ParentId == 0 && m.Status == Status.Published);
            var text = await System.IO.File.ReadAllTextAsync(Path.Combine(HostEnvironment.WebRootPath, "template", "agreement.html"));

            return(CurrentUser.IsAdmin ? View("Index_Admin", text) : View(model: text));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Index()
        {
            ViewBag.TotalCount = LeaveMessageService.Count(m => m.ParentId == null && m.Status == Status.Published);
            var text = await new FileInfo(Path.Combine(HostEnvironment.WebRootPath, "template", "agreement.html")).ShareReadWrite().ReadAllTextAsync(Encoding.UTF8);

            return(CurrentUser.IsAdmin ? View("Index_Admin", text) : View(model: text));
        }
Exemplo n.º 3
0
 public ActionResult Index()
 {
     ViewBag.TotalCount = LeaveMessageService.Count(m => m.ParentId == 0 && m.Status == Status.Published);
     return(CurrentUser.IsAdmin ? View("Index_Admin") : View());
 }