ASP.NET MVC 4 + Windows Authentication – Controller Returns with Different Data Model

ASP.NET MVC 4 + Windows Authentication – Controller Returns with Different Data Model

   \Controllers\HomeController.cs
 
   using System;
   using System.Collections.Generic;
   using System.Linq;
   using System.Web;
   using System.Web.Mvc;
   using NetworkAssetDAO;
   using System.Configuration;
 
   namespace NetworkAssetWeb.Controllers
   {
      public class HomeController : Controller
      {
         … …
 
         public ActionResult Item()
         {
            DAO dao = new DAO();
 
            ViewBag.LoginName = System.Web.HttpContext.Current.User.Identity.Name;
 
            if (this.auth(System.Web.HttpContext.Current.User.Identity.Name.ToUpper()))
            {
               List<Asset> list = dao.getAllItem();
               ViewBag.ErrorMessage = "";
               return View(list);
            }else{
               ViewBag.ErrorMessage = "Access Denied";
               return View("Item", null);
            }
         }
 
         private bool auth(string loginaccount)
         {
            if(Validate the account is accept to browse the page ( from DB or something else ))
            {
               return true;
            }else{
               return false;
            }
         }
 
         … …
      }
   }