示例#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));
        }
示例#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));
        }
 public ActionResult Index()
 {
     ViewBag.TotalCount = LeaveMessageService.Count(m => m.ParentId == 0 && m.Status == Status.Published);
     return(CurrentUser.IsAdmin ? View("Index_Admin") : View());
 }