CommonController---_Admin.cshtml
1 SysUserRepository sysuserrepository = new SysUserRepository(); 2 public SysUser sysuser { get; set; } 3 public string Css() 4 { 5 int sysuserid = int.Parse(CookieHelper.GetValue("SysUserID")); 6 sysuser = sysuserrepository.GetModel(sysuserid); 7 switch (sysuser.SkinColor) 8 { 9 case 0: return "blue"; 10 case 1: return "green"; 11 case 2: return "brown"; 12 case 3: return "purple"; 13 case 4: return "red"; 14 case 5: return "greyblue"; 15 default: return "blue"; 16 } 17 }
<link id="color" rel="stylesheet" type="text/css" href="/Content/admin/css/colors/@{@Html.Action("Css","Common")}.css" />