这一章节比较简单,我就直接贴代码了,后台管理登陆界面如下:

对应的控制器HomeController.cs,代码如下:

using YKT.Model;
using YKT.Common;
using YKT.BLL;
using YKT.Common.HtmlHelpers;
using YKT.Common.Functions;
using Microsoft.Practices.Unity;
using YKT.IBLL;namespace YKT.Controllers
{public class HomeController : BaseController{#region 通用部分-实例化业务逻辑对象ValidationErrors validationErrors = new ValidationErrors();HomeService m_BLL = new HomeService();ISysMenuRoleFuncService _menuRoleFunService = new SysMenuRoleFuncService();#endregionpublic ActionResult Index(){Account account = GetCurrentAccount();if (account == null){return RedirectToAction("Index", "Account");}else{ViewData["PersonName"] = account.UID;ViewData["Menu"] = m_BLL.GetMenuByAccount(ref account);// 获取菜单}return View();}//[SupportFilter]public ActionResult Main(){SysInfo model = m_BLL.GetSysInfoModel() as SysInfo;return View(model);}/// <summary>/// 根据父节点获取数据字典,绑定二级下拉框的时候使用/// </summary>/// <param name="id"></param>/// <returns></returns>public ActionResult GetSysFieldByParent(string id, string parentid, string value){if (string.IsNullOrWhiteSpace(value)){return null;}ISysFieldHander baseDDL = new SysFieldHander();return Json(new SelectList(baseDDL.GetSysFieldByParent(id, parentid, value), "MyTexts", "MyTexts"), JsonRequestBehavior.AllowGet);}/// <summary>/// 获取列表中的按钮导航/// </summary>/// <param name="id"></param>/// <returns></returns>public ActionResult GetToolbar(int id){Account account = GetCurrentAccount();if (account == null){return Content(" <script type='text/javascript'> window.top.location='Account'; </script>");}List<SMFUNCTB> sysOperations = _menuRoleFunService.GetByRefSysMenuIdAndSysRoleId(id, account.RoleIds);List<toolbar> toolbars = new List<toolbar>();foreach (SMFUNCTB item in sysOperations){toolbars.Add(new toolbar() { handler = item.EVENT_NAME, iconCls = item.ICONIC, text = item.FUNC_NAME });}return Json(toolbars, JsonRequestBehavior.AllowGet);}}
}

这里我继承了一个基控制器BaseController如下:

/*Company:EMPEROR*/
/*Author:Zouqj*/
/*Date:2014-02-20*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;using System.EnterpriseServices;
using YKT.Model;
using System.Web.Mvc;
using System.Configuration;
using System.Web;
using System.IO.Compression;
using YKT.Common;namespace YKT.Controllers
{[SupportFilter]//此处如果去掉注释,则全部继承BaseController的Controller,都将执行SupportFilter过滤public class BaseController : Controller{/// <summary>/// 是否添加选择行/// </summary>public bool IsAddSelect = true;/// <summary>/// //选择行的文本/// </summary>public string DefaultSelectText = "——请选择——";/// <summary>/// //默认选择的值/// </summary>public string DefaultSelectValue = "";/// <summary>/// 默认选择的整数值/// </summary>public int? DefaultIntValue = -1;/// <summary>/// 是否是Oracle数据库/// </summary>public bool IsOracle = ConfigurationManager.AppSettings["DataBase"] == "Oracle" ? true : false;/// <summary>/// 根据序列名称获取oracle序列/// </summary>/// <param name="name"></param>/// <returns></returns>public Decimal GetProblemXH(string name){Decimal maxXh = 90000000;using (YKTEntities entity = new YKTEntities()){String strDBType = ((System.Data.EntityClient.EntityConnection)(entity.Connection)).StoreConnection.ToString();if (entity != null){string strSeqIDQuerySQL;if (strDBType == "System.Data.SqlClient.SqlConnection"){strSeqIDQuerySQL = "insert into dual(NewDate) values(GETDATE()) select @@identity";}else{strSeqIDQuerySQL = "select " + name + ".nextval from dual";}Decimal decSeqID = entity.ExecuteStoreQuery<Decimal>(strSeqIDQuerySQL).First();maxXh = decSeqID;}}return maxXh;}/// <summary>/// 获取当前登陆人的名称/// </summary>/// <returns></returns>public string GetCurrentPerson(){Account account = GetCurrentAccount();if (account != null && !string.IsNullOrWhiteSpace(account.UID)){return account.UID;}return string.Empty;}/// <summary>/// 获取当前登陆人的账户信息/// </summary>/// <returns>账户信息</returns>public Account GetCurrentAccount(){if (Session["account"] != null){Account account = (Account)Session["account"];return account;}return null;}public BaseController(){ }}}

View如下:

@{ViewBag.Title = "一卡通企业平台";Layout =null;
}
<!DOCTYPE html>
<html>
<head id="Head1"><title>一卡通企业平台</title><base target="_self"/>  <link href='@Url.Content("~/Res/easyui/themes/default/easyui.css")' rel="stylesheet" type="text/css" /><link href='@Url.Content("~/Content/Default.css")' rel="stylesheet" type="text/css" /><link href='@Url.Content("~/Res/easyui/themes/icon.css")' rel="stylesheet" type="text/css" /><script src='@Url.Content("~/Scripts/jquery-1.8.0.min.js")' type="text/javascript"></script><script src='@Url.Content("~/Res/easyui/jquery.easyui.min.js")' type="text/javascript"></script><script src='@Url.Content("~/Res/easyui/locale/easyui-lang-zh_CN.js")' type="text/javascript"></script><script type="text/javascript">function closeErrors() {return true;}window.onerror = closeErrors;    $(function () {//var w = $(document).width();//$("#banner").width(w); //设置bannar的宽度tabCloseEven();addTab("我的工作台", "Home/Main", "xiongdi", false);$('ul li a').click(function () {var tabTitle = $(this).text();var url = $(this).attr("rel"); //获取地址var id = $(this).attr("id"); //获取idvar icon = $(this).attr("icon"); //获取图标if (icon == "") {icon = "icon-save";}addTab(tabTitle, url, icon, true, id);});$('#loginOut').click(function () {$.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {if (r) {location.href = '/Account/LogOff';}});});$('#ChangePassword').click(function () {showPwdWindow("修改密码", "Account/ChangePassword");});})function addTab(subtitle, url, icon, closable, id) {if (!$('#tabs').tabs('exists', subtitle)) {$('#tabs').tabs('add', {title: subtitle,content: createFrame(url, id),closable: closable, icon: icon});} else {$('#tabs').tabs('select', subtitle);}tabClose();}function createFrame(url, id) {var s = '<iframe id="' + id + '" scrolling="no" frameborder="0"  src="' + url + '" style="width:100%;height:99%; "></iframe>';return s;}function tabClose() {/*双击关闭TAB选项卡*/$(".tabs-inner").dblclick(function () {var subtitle = $(this).children(".tabs-closable").text();$('#tabs').tabs('close', subtitle);})/*为选项卡绑定右键*/$(".tabs-inner").bind('contextmenu', function (e) {$('#mm').menu('show', {left: e.pageX,top: e.pageY});var subtitle = $(this).children(".tabs-closable").text();$('#mm').data("currtab", subtitle);$('#tabs').tabs('select', subtitle);return false;});}//绑定右键菜单事件function tabCloseEven() {//刷新$('#mm-tabupdate').click(function () {var currTab = $('#tabs').tabs('getSelected');var url = $(currTab.panel('options').content).attr('src');var id = $(currTab.panel('options').content).attr('id'); ; //获取id$('#tabs').tabs('update', {tab: currTab,options: {content: createFrame(url, id)}})})//关闭$('#mm-tabclose').click(function () {var currtab_title = $('#mm').data("currtab");$('#tabs').tabs('close', currtab_title);})//在新窗口打开该标签$('#tab_menu-openFrame').click(function () {var url = $(".tabs-panels .panel").eq($('.tabs-selected').index()).find("iframe").attr("src");window.open(url);});//全部关闭$('#tab_menu-tabcloseall').click(function () {$('.tabs-inner span').each(function (i, n) {if ($(this).parent().next().is('.tabs-close')) {var t = $(n).text();$('#tabs').tabs('close', t);}});//open menu$(".layout-button-right").trigger("click");});//关闭除当前之外的TAB$('#tab_menu-tabcloseother').click(function () {var currtab_title = $('.tabs-selected .tabs-inner span').text();$('.tabs-inner span').each(function (i, n) {if ($(this).parent().next().is('.tabs-close')) {var t = $(n).text();if (t != currtab_title)$('#tabs').tabs('close', t);}});});//关闭当前右侧的TAB$('#tab_menu-tabcloseright').click(function () {var nextall = $('.tabs-selected').nextAll();if (nextall.length == 0) {$.messager.alert('提示', '前面没有了!', 'warning');return false;}nextall.each(function (i, n) {if ($('a.tabs-close', $(n)).length > 0) {var t = $('a:eq(0) span', $(n)).text();$('#tabs').tabs('close', t);}});return false;});//关闭当前左侧的TAB$('#tab_menu-tabcloseleft').click(function () {var prevall = $('.tabs-selected').prevAll();if (prevall.length == 0) {$.messager.alert('提示', '后面没有了!', 'warning');return false;}prevall.each(function (i, n) {if ($('a.tabs-close', $(n)).length > 0) {var t = $('a:eq(0) span', $(n)).text();$('#tabs').tabs('close', t);}});return false;});}//修改密码function showPwdWindow(title, href) {$('#myWindow').window({title: title,width: 600,height: 400,content: '<iframe scrolling="no" frameborder="0"  src="' + href + '" style="width:100%;height:98%;"></iframe>',shadow: false,cache: false,closed: false,collapsible: false,resizable: false,loadingMessage: '正在加载数据,请稍等片刻......'});}function showMyWindow(title, href, width, height, modal, minimizable, maximizable, isScrolling) {var isScroll = isScrolling == undefined ? "yes" : "no";$('#myWindow').window({title: title,width: width === undefined ? 600 : width,height: height === undefined ? 450 : height,content: '<iframe scrolling="' + isScroll + '" frameborder="0"  src="' + href + '" style="width:100%;height:98%;"></iframe>',//        href: href === undefined ? null : href, modal: modal === undefined ? true : modal,minimizable: minimizable === undefined ? false : minimizable,maximizable: maximizable === undefined ? false : maximizable,shadow: false,cache: false,closed: false,collapsible: false,resizable: false,loadingMessage: '正在加载数据,请稍等片刻......'});}</script><style type="text/css">body{font-family: 微软雅黑,新宋体;}a{color: Black;text-decoration: none;}.easyui-tree li{margin: 5px 0px 0px 0px;padding: 1px;}#mainlogo{position: absolute;top: 0px;left: 0px;width: 575px;height: 72px;}#center{padding-left: 575px;padding-right: 425px;}#mainctrl{position: absolute;top: 0px;right: 0px;height: 72px;width: 425px;}.top{height: 76px;background-color: #00211D;}.wel{height: 30px;line-height: 30px;color: #FFFFFF;font-size: 14px;text-align: right;padding-right: 5px;}.ctr{vertical-align: middle;margin-top: 18px;height: 24px;text-align: right;background-image: url(../images/beijing.gif);background-repeat: repeat-x;}.ctr li{float: left;list-style: none;}.zi{padding-right: 16px;padding-left: 3px;}a.v1:visited, a.v1:active, a.v1:link{font-size: 14px;color: #000;text-decoration: none;}a.v1:hover{font-size: 14px;color: #005500;text-decoration: none;}</style>
</head>
<body class="easyui-layout"><noscript><div style="position: absolute; z-index: 100000; height: 2046px; top: 0px; left: 0px;width: 100%; background: white; text-align: center;"><img src="data:images/noscript.gif" alt='抱歉,请开启脚本支持!'/></div></noscript><div region="north" split="true" border="false" style="overflow: hidden; height: 76px;line-height: 20px; color: #fff; font-family: 微软雅黑,黑体"><div class="top" style="background-color:#204478; width:100%;"><div id="mainlogo"><img id="banner" src="data:images/hzbanner.png"  alt="一卡通" style="height:72px;"/></div><div id="center"></div><div id="mainctrl"><div class="wel">@ViewData["PersonName"],欢迎您的光临!</div><div class="ctr"><li><img src="data:images/yuanjiao.png" alt="" /></li><li><a href="#"><img src="data:images/mimaxiugai.gif" alt="" border="0" /></a></li><li class="zi"><a href="#" id="ChangePassword" class="v1">密码修改</a></li><li><a href="#"><img src="data:images/anquantuichu.gif" alt="" border="0" /></a></li><li class="zi"><a href="#" id="loginOut" class="v1">安全退出</a></li><li><a href="#"><img src="data:images/bangzhu.gif" border="0"></a></li><li class="zi"><a href="http://www.xiongdi.cn" class="v1">帮助中心</a></li>
@*                   <li><a href="#"><img src="data:images/duanxinxi.gif" alt="" border="0" /></a></li><li class="zi"><a href="#" class="v1">短消息(0)</a></li>*@</div></div></div></div><div region="west" hide="true" split="true" title="导航菜单" style="width: 180px;" id="west"><div class="easyui-accordion" fit="true" border="false">@Html.Raw(ViewData["Menu"])</div></div><div id="mainPanle" region="center" style="background: #eee;"><div id="tabs" class="easyui-tabs" fit="true" border="false"></div></div><div region="south" split="true" style="height: 29px;"><div style="padding: 0px; margin-left: 50%;">技术支持 <a href="http://www.xiongdi.cn" target="_blank">雄帝股份</a></div></div><div id="mm" class="easyui-menu" style="width: 150px;"><div id="mm-tabupdate" data-options="iconCls:'icon-reload'">刷新</div><div id="tab_menu-openFrame">在新的窗体打开</div><div class="menu-sep"></div><div id="mm-tabclose" data-options="iconCls:'icon-cancel'">关闭</div><div id="tab_menu-tabcloseright">关闭右边</div><div id="tab_menu-tabcloseleft">关闭左边</div><div id="tab_menu-tabcloseall">关闭所有</div><div id="tab_menu-tabcloseother">关闭其他标签页</div></div><div id="myWindow"></div>
</body>
</html>

4、VS2010+ASP.NET MVC4+EF4+JqueryEasyUI+Oracle项目开发之——后台管理界面相关推荐

  1. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(12)-系统日志和异常的处理②...

    原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(12)-系统日志和异常的处理② 上一讲我们做了日志与异常的结果显示列表,这一节我们讲要把他应用系统中来. ...

  2. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(31)-MVC使用RDL报表

    原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(31)-MVC使用RDL报表 这次我们来演示MVC3怎么显示RDL报表,坑爹的微软把MVC升级到5都木有良 ...

  3. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(32)-swfupload多文件上传[附源码]...

    原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(32)-swfupload多文件上传[附源码] 文件上传这东西说到底有时候很痛,原来的asp.net服务器 ...

  4. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(39)-在线人数统计探讨

    原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(39)-在线人数统计探讨 系列目录 基于web的网站在线统计一直处于不是很精准的状态!基本上没有一种方法可 ...

  5. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(34)-文章发布系统①-简要分析...

    构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(34)-文章发布系统①-简要分析 原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入 ...

  6. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(13)-系统日志和异常的处理③

    构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(13)-系统日志和异常的处理③ 参考文章: (1)构建ASP.NET MVC4+EF5+EasyUI+Unity ...

  7. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(10)-系统菜单栏[附源码]

    构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(10)-系统菜单栏[附源码] 原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后 ...

  8. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(40)-精准在线人数统计实现-【过滤器+Cache】...

    构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(40)-精准在线人数统计实现-[过滤器+Cache] 原文:构建ASP.NET MVC4+EF5+EasyUI+ ...

  9. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(44)-工作流设计-设计表单...

    构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(44)-工作流设计-设计表单 原文:构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后 ...

  10. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(36)-文章发布系统③-kindeditor使用...

    构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(36)-文章发布系统③-kindeditor使用 原文:构建ASP.NET MVC4+EF5+EasyUI+Un ...

最新文章

  1. Dubbo基础专题——第二章(Dubbo工程简单实践)
  2. Embarcadero公司花2千3百万买下Borland的开发工具业务
  3. 交互式讲解傅里叶变换
  4. java 存入对象io_Java面向对象 IO (一)
  5. 安装acdsee 3.1后出错
  6. 多线程:Immutable对象?如何创建Immutable对象?
  7. 福州java培训哪里好_广州java学习哪里好?需要学多长时间
  8. 关于VC预定义常量_WIN32,WIN32,_WIN64等预定义宏的介绍(整理、转载)
  9. 了解过Vintage的N种样式?
  10. vmware提示虚拟机似乎正在使用中
  11. PHPExcel导出文件
  12. Atitit 减少财政支出之减少通讯支出 解决方案attilax总结
  13. OpenCL入门程序
  14. 使用破解包激活MyEclipse 2018
  15. 谈谈我对元宇宙的理解
  16. 一篇关于批处理文件的经典文章
  17. 泪目了!原河南常务副省长的艰辛求学路竟然这么感人
  18. Github项目文档的管理
  19. Suzy找到实习了吗Day 7 | 哈希表结束啦 454. 四数相加 II,383. 赎金信,15. 三数之和,18. 四数之和
  20. web前端学习笔记(二)

热门文章

  1. 司机秘书:让司机省心的违章查询助手
  2. 软件测试中期答辩,毕业论文中期答辩报告.doc
  3. 如何突破四维空间,进入五维空间
  4. CSS Border(边框)
  5. Hadoop 中 FileSplit (文件分割器)的简单使用
  6. 推荐一本好书《代码整洁之道 (claen code) 》
  7. 为手机游戏而生的Linux 发行版
  8. slic codec
  9. AutoCAD 二次开发
  10. leapftp连接不上,为什么leapftp连接不上