Skip to content

Commit

Permalink
实现门户网站页面框架。
Browse files Browse the repository at this point in the history
  • Loading branch information
smartbooks committed Dec 17, 2012
1 parent de4afcd commit 2e9625f
Show file tree
Hide file tree
Showing 84 changed files with 3,773 additions and 41,189 deletions.
23 changes: 22 additions & 1 deletion Git基础知识.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,25 @@ fixbug 修补分支
  git branch -d fixbug-0.1

建议新手阅读这篇文章
http://rogerdudler.github.com/git-guide/index.zh.html
http://rogerdudler.github.com/git-guide/index.zh.html

#分子合并模式
#添加一个远程版本库
git remote add smartdevelop https://github.com/smartdevelop/SmartAdmin.git

#获取远程版本库gotgithub的分支和提交
git fetch smartdevelop

#将远程分支合并到当前分支中
git merge smartdevelop/master
#git merge smartdevelop/develop

#提交到本地仓库
git add *
git commit -m""

#推送到服务器
git push

#更新到最新版本
git pull
52 changes: 26 additions & 26 deletions Smart.sln
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartAdmin", "SmartAdmin\SmartAdmin.csproj", "{D6E561E0-04BF-4147-9D6B-0FFE768104BE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartPortal", "SmartPortal\SmartPortal.csproj", "{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Release|Any CPU.Build.0 = Release|Any CPU
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Web
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartPortal", "SmartPortal\SmartPortal.csproj", "{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartAdmin", "SmartAdmin\SmartAdmin.csproj", "{D6E561E0-04BF-4147-9D6B-0FFE768104BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4DC8D31A-8E32-4EAF-8C78-9B30E85D6B0D}.Release|Any CPU.Build.0 = Release|Any CPU
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6E561E0-04BF-4147-9D6B-0FFE768104BE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file removed Smart.suo
Binary file not shown.
30 changes: 2 additions & 28 deletions SmartAdmin/Controllers/SystemController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Web.Mvc;
using Smart.Admin;
using System.Drawing;
using Smart.Admin.Helpers;

namespace Smart.Admin.Controllers
{
Expand All @@ -26,32 +27,6 @@ public class SystemController : Controller
[Filter.DefaultAuthorizationFilter]
public ActionResult Index()
{
//添加一条测试数据
/*
Models.User user = new Models.User();
user.CurrentIPAddress = Request.UserHostAddress;
user.EmailAddress = "[email protected]";
user.EndLoginDate = DateTime.Now;
user.MutileOnLine = false;
user.Nick = "飞翔的小鸟";
user.OnLine = false;
user.Password = "123456789";
user.RegisterDate = DateTime.Now;
user.UserName = new Random().Next(999999).ToString();
user.UserRole = "超级管理员";
smartAdminDB.Users.Add(user);
smartAdminDB.SaveChanges();
var data = from u in smartAdminDB.Users
//where u.UserName == user.UserName
orderby u.RegisterDate descending
select u;
ViewBag.Data = data;
*/
//return View("~/Views/System/Login.cshtml");
return View();
}

Expand Down Expand Up @@ -95,7 +70,7 @@ public ActionResult Login(string username, string password, string code, string
ViewBag.Message = "用户名或密码错误,请重新登录";
return View("~/Views/System/Login.cshtml");
}

//一周内免登陆设置
if (remember == "1")
{
Expand Down Expand Up @@ -130,7 +105,6 @@ public ActionResult Login()
public ActionResult LoginOut(string username)
{
Response.Cookies.Add(new HttpCookie("username", ""));
//return View("~/Views/System/Login.cshtml");

return new RedirectResult("~/System/Login", false);
}
Expand Down
74 changes: 74 additions & 0 deletions SmartAdmin/Helpers/UrlHelperExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Smart.Admin.Helpers
{
/// <summary>
/// UrlHelper扩展
/// </summary>
public static class UrlHelperExtensions
{
/// <summary>
/// 带有Areas的url地址(链接)
/// </summary>
/// <param name="url"></param>
/// <param name="path"></param>
/// <returns></returns>
public static string ContentArea(this UrlHelper url, string path)
{
var area = url.RequestContext.RouteData.DataTokens["area"];

if (area != null)
{
/*
if (!string.IsNullOrEmpty(area.ToString()))
area = "Areas/" + area;
*/

if (path.StartsWith("~/"))
path = path.Remove(0, 2);

if (path.StartsWith("/"))
path = path.Remove(0, 1);

path = path.Replace("../", string.Empty);

return VirtualPathUtility.ToAbsolute("~/" + area + "/" + path);
}

return string.Empty;
}

/// <summary>
/// 带有Areas的url地址(素材)
/// </summary>
/// <param name="url"></param>
/// <param name="path"></param>
/// <returns></returns>
public static string ContentAreaMaterial(this UrlHelper url, string path)
{
var area = url.RequestContext.RouteData.DataTokens["area"];

if (area != null)
{
if (!string.IsNullOrEmpty(area.ToString()))
area = "Areas/" + area;

if (path.StartsWith("~/"))
path = path.Remove(0, 2);

if (path.StartsWith("/"))
path = path.Remove(0, 1);

path = path.Replace("../", string.Empty);

return VirtualPathUtility.ToAbsolute("~/" + area + "/" + path);
}

return string.Empty;
}
}
}
Loading

0 comments on commit 2e9625f

Please sign in to comment.