diff --git a/Examples/website/FreeSql.Site.DAL/Db.cs b/Examples/website/FreeSql.Site.DAL/Db.cs index d00e277e..739dae52 100644 --- a/Examples/website/FreeSql.Site.DAL/Db.cs +++ b/Examples/website/FreeSql.Site.DAL/Db.cs @@ -1,13 +1,40 @@ -using System; +using FreeSql.Site.DAL.Helper; +using System; namespace FreeSql.Site.DAL { - public class Db + public static class Db { - - public static IFreeSql mysql = new FreeSql.FreeSqlBuilder() - .UseConnectionString(FreeSql.DataType.MySql, AppSettingsManager.Get("ConnectionStrings:DefaultDbContext")) - .Build(); + public static System.Collections.Generic.Dictionary ConnectionPool = new System.Collections.Generic.Dictionary(); + private static string getConnectionString(string sDatabaseType) + { + return AppSettingsManager.Get($"DbContexts:{sDatabaseType}:ConnectionString"); + } + + private static IFreeSql SelectDBType(string dbtype) + { + if (!ConnectionPool.ContainsKey(dbtype)) + { + ConnectionPool.Add(dbtype, new FreeSql.FreeSqlBuilder() + .UseConnectionString(FreeSql.DataType.MySql, getConnectionString(dbtype)) + .Build()); + } + return ConnectionPool[dbtype]; + } + + public static IFreeSql DB(this DataBaseType t) + { + return SelectDBType(t.ToString()); + } + } + + public enum DataBaseType + { + MySql, + SqlServer, + PostgreSQL, + Oracle, + Sqlite } } diff --git a/Examples/website/FreeSql.Site.DAL/DocumentCommentDAL.cs b/Examples/website/FreeSql.Site.DAL/DocumentCommentDAL.cs new file mode 100644 index 00000000..0d9fcdcd --- /dev/null +++ b/Examples/website/FreeSql.Site.DAL/DocumentCommentDAL.cs @@ -0,0 +1,68 @@ +//using FreeSql.Site.Entity; +using FreeSql.Site.Entity; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text; + +namespace FreeSql.Site.DAL +{ + public class DocumentCommentDAL + { + /// + /// 新增方法 + /// + /// + /// + public long Insert(DocumentComment model) + { + return DataBaseType.MySql.DB().Insert(model).ExecuteIdentity(); + } + + /// + /// 修改方法 + /// + /// + /// + public bool Update(DocumentComment model) + { + return DataBaseType.MySql.DB().Update(model.ID).ExecuteUpdated().Count > 0; + } + + /// + /// 删除方法 + /// + /// + /// + public bool Delete(long id) + { + return DataBaseType.MySql.DB().Delete(id).ExecuteDeleted().Count > 0; + } + + /// + /// 获取一条数据 + /// + /// + /// + public DocumentComment GetByOne(Expression> where) + { + return DataBaseType.MySql.DB().Select() + .Where(where).ToOne(); + } + + /// + /// 查询方法 + /// + /// + /// + /// + public List Query(Expression> where, + Expression> orderby = null) + { + var list = DataBaseType.MySql.DB().Select() + .Where(where); + if (orderby != null) list = list.OrderBy(b => b.CreateDt); + return list.ToList(); + } + } +} diff --git a/Examples/website/FreeSql.Site.DAL/DocumentContentDAL.cs b/Examples/website/FreeSql.Site.DAL/DocumentContentDAL.cs index 22222018..2a0cc0bd 100644 --- a/Examples/website/FreeSql.Site.DAL/DocumentContentDAL.cs +++ b/Examples/website/FreeSql.Site.DAL/DocumentContentDAL.cs @@ -1,42 +1,89 @@ -//using FreeSql.Site.Entity; -using FreeSql.Site.Entity; +using FreeSql.Site.Entity; +using FreeSql.Site.Entity.Common; using System; using System.Collections.Generic; using System.Linq.Expressions; -using System.Text; namespace FreeSql.Site.DAL { public class DocumentContentDAL { + /// + /// 新增 + /// + /// + /// public long Insert(DocumentContent model) { - return Db.mysql.Insert(model).ExecuteIdentity(); + return DataBaseType.MySql.DB().Insert(model).ExecuteIdentity(); } + /// + /// 修改 + /// + /// + /// public bool Update(DocumentContent model) { - return Db.mysql.Update(model.ID).ExecuteUpdated().Count > 0; + return DataBaseType.MySql.DB().Update(model.ID).ExecuteUpdated().Count > 0; } + /// + /// 删除 + /// + /// + /// public bool Delete(long id) { - return Db.mysql.Delete(id).ExecuteDeleted().Count > 0; + return DataBaseType.MySql.DB().Delete(id).ExecuteDeleted().Count > 0; } + /// + /// 获取一条数据 + /// + /// + /// public DocumentContent GetByOne(Expression> where) { - return Db.mysql.Select() + return DataBaseType.MySql.DB().Select() .Where(where).ToOne(); } - public List Query(Expression> where, - Expression> orderby = null) + + /// + /// 获取一条数据 + /// + /// + /// + public long Count(Expression> where) { - var list = Db.mysql.Select() + return DataBaseType.MySql.DB().Select() + .Where(where).Count(); + } + + /// + /// 查询功能 + /// + /// + /// + /// + public (List list, long count) Query(Expression> where, + Expression> orderby = null, PageInfo pageInfo = null) + { + //设置查询条件 + var list = DataBaseType.MySql.DB().Select() .Where(where); + + //设置排序 if (orderby != null) list = list.OrderBy(b => b.CreateDt); - return list.ToList(); + + var count = list.Count(); + //设置分页操作 + if (pageInfo != null && pageInfo.IsPaging) + list.Skip(pageInfo.PageIndex * pageInfo.PageSize).Limit(pageInfo.PageSize); + + //执行查询 + return (list.ToList(), count); } } } diff --git a/Examples/website/FreeSql.Site.DAL/DocumentTypeDAL.cs b/Examples/website/FreeSql.Site.DAL/DocumentTypeDAL.cs index a7c204fa..4e03fe14 100644 --- a/Examples/website/FreeSql.Site.DAL/DocumentTypeDAL.cs +++ b/Examples/website/FreeSql.Site.DAL/DocumentTypeDAL.cs @@ -9,25 +9,57 @@ namespace FreeSql.Site.DAL { public class DocumentTypeDAL { + /// + /// 新增方法 + /// + /// + /// public long Insert(DocumentType model) { - return Db.mysql.Insert(model).ExecuteIdentity(); + return DataBaseType.MySql.DB().Insert(model).ExecuteIdentity(); } + /// + /// 修改方法 + /// + /// + /// public bool Update(DocumentType model) { - return Db.mysql.Update(model.ID).ExecuteUpdated().Count > 0; + return DataBaseType.MySql.DB().Update(model.ID).ExecuteUpdated().Count > 0; } + /// + /// 删除方法 + /// + /// + /// public bool Delete(long id) { - return Db.mysql.Delete(id).ExecuteDeleted().Count > 0; + return DataBaseType.MySql.DB().Delete(id).ExecuteDeleted().Count > 0; } + /// + /// 获取一条数据 + /// + /// + /// + public DocumentType GetByOne(Expression> where) + { + return DataBaseType.MySql.DB().Select() + .Where(where).ToOne(); + } + + /// + /// 查询方法 + /// + /// + /// + /// public List Query(Expression> where, Expression> orderby = null) { - var list = Db.mysql.Select() + var list = DataBaseType.MySql.DB().Select() .Where(where); if (orderby != null) list = list.OrderBy(b => b.CreateDt); return list.ToList(); diff --git a/Examples/website/FreeSql.Site.DAL/AppSettingsManager.cs b/Examples/website/FreeSql.Site.DAL/Helper/AppSettingsManager.cs similarity index 100% rename from Examples/website/FreeSql.Site.DAL/AppSettingsManager.cs rename to Examples/website/FreeSql.Site.DAL/Helper/AppSettingsManager.cs diff --git a/Examples/website/FreeSql.Site.DAL/Helper/EnumHelper.cs b/Examples/website/FreeSql.Site.DAL/Helper/EnumHelper.cs new file mode 100644 index 00000000..0d9489a9 --- /dev/null +++ b/Examples/website/FreeSql.Site.DAL/Helper/EnumHelper.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace FreeSql.Site.DAL.Helper +{ + public class EnumHelper + { + /// + /// 枚举类型转换为字符串 + /// + /// + /// + /// + public static string EnumConvertToString(T en) + { + //方法一 + //return color.ToString(); + + //方法二 + return Enum.GetName(en.GetType(), en); + } + public static T StringConvertToEnum(string str) + { + T result = default(T); + try + { + result = (T)Enum.Parse(typeof(T), str); + } + catch (Exception ex) + { + return result; + } + return result; + } + } +} diff --git a/Examples/website/FreeSql.Site.DAL/TemplateExampleDAL.cs b/Examples/website/FreeSql.Site.DAL/TemplateExampleDAL.cs new file mode 100644 index 00000000..75bf5c8f --- /dev/null +++ b/Examples/website/FreeSql.Site.DAL/TemplateExampleDAL.cs @@ -0,0 +1,68 @@ +//using FreeSql.Site.Entity; +using FreeSql.Site.Entity; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text; + +namespace FreeSql.Site.DAL +{ + public class TemplateExampleDAL + { + /// + /// 新增方法 + /// + /// + /// + public long Insert(TemplateExample model) + { + return DataBaseType.MySql.DB().Insert(model).ExecuteIdentity(); + } + + /// + /// 修改方法 + /// + /// + /// + public bool Update(TemplateExample model) + { + return DataBaseType.MySql.DB().Update(model.ID).ExecuteUpdated().Count > 0; + } + + /// + /// 删除方法 + /// + /// + /// + public bool Delete(long id) + { + return DataBaseType.MySql.DB().Delete(id).ExecuteDeleted().Count > 0; + } + + /// + /// 获取一条数据 + /// + /// + /// + public TemplateExample GetByOne(Expression> where) + { + return DataBaseType.MySql.DB().Select() + .Where(where).ToOne(); + } + + /// + /// 查询方法 + /// + /// + /// + /// + public List Query(Expression> where, + Expression> orderby = null) + { + var list = DataBaseType.MySql.DB().Select() + .Where(where); + if (orderby != null) list = list.OrderBy(b => b.CreateDt); + return list.ToList(); + } + } +} diff --git a/Examples/website/FreeSql.Site.Entity/Common/DataPage.cs b/Examples/website/FreeSql.Site.Entity/Common/DataPage.cs new file mode 100644 index 00000000..d1bda637 --- /dev/null +++ b/Examples/website/FreeSql.Site.Entity/Common/DataPage.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace FreeSql.Site.Entity.Common +{ + /// + /// 列表数据返回对象 + /// + /// + public class DataPage + where T : class + { + /// + /// 返回成功与否 + /// + public string code { get; set; } + + /// + /// 如果返回报错,具体报错内容 + /// + public string msg { get; set; } + + /// + /// 总计记录行数 + /// + public long count { get; set; } + + /// + /// 返回具体的数据 + /// + public List data { get; set; } + } +} diff --git a/Examples/website/FreeSql.Site.Entity/Common/PageInfo.cs b/Examples/website/FreeSql.Site.Entity/Common/PageInfo.cs new file mode 100644 index 00000000..251fcb7b --- /dev/null +++ b/Examples/website/FreeSql.Site.Entity/Common/PageInfo.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace FreeSql.Site.Entity.Common +{ + /// + /// 列表数据返回对象 + /// + /// + public class PageInfo + { + /// + /// 排序字段 + /// + public string Order { get; set; } + + /// + /// 页码 + /// + public int PageIndex { get; set; } + + /// + /// 页记录数 + /// + public int PageSize { get; set; } + + /// + /// 排序方式 + /// + public string Sort { get; set; } + + /// + /// 总计数量 + /// + public int Total { get; set; } + + /// + /// 是否获取总数 + /// + public bool IsPaging { get; set; } + } +} diff --git a/Examples/website/FreeSql.Site.Entity/DocumentContent.cs b/Examples/website/FreeSql.Site.Entity/DocumentContent.cs index 4197d508..63480a71 100644 --- a/Examples/website/FreeSql.Site.Entity/DocumentContent.cs +++ b/Examples/website/FreeSql.Site.Entity/DocumentContent.cs @@ -4,6 +4,9 @@ using System; namespace FreeSql.Site.Entity { + /// + /// 数据库实体 + /// public class DocumentContent { [Column(IsIdentity = true, IsPrimary = true)] @@ -64,4 +67,12 @@ namespace FreeSql.Site.Entity /// public string UpdateBy { get; set; } } + + /// + /// 返回实体内容 + /// + public class DocumentContentView : DocumentContent + { + + } } diff --git a/Examples/website/FreeSql.Site.Entity/DocumentType.cs b/Examples/website/FreeSql.Site.Entity/DocumentType.cs index 4c2da05d..69f9a92f 100644 --- a/Examples/website/FreeSql.Site.Entity/DocumentType.cs +++ b/Examples/website/FreeSql.Site.Entity/DocumentType.cs @@ -13,6 +13,11 @@ namespace FreeSql.Site.Entity public int? UpID { get; set; } + /// + /// 标签 + /// + public string Tag { get; set; } + /// /// 状态 /// diff --git a/Examples/website/FreeSql.Site.Entity/TemplateExample.cs b/Examples/website/FreeSql.Site.Entity/TemplateExample.cs index 0431e647..ca8cd095 100644 --- a/Examples/website/FreeSql.Site.Entity/TemplateExample.cs +++ b/Examples/website/FreeSql.Site.Entity/TemplateExample.cs @@ -23,6 +23,11 @@ namespace FreeSql.Site.Entity /// public string TempateName { get; set; } + /// + /// 描述 + /// + public string Describe { get; set; } + /// /// 模板路径 /// diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Common/BaseController.cs b/Examples/website/FreeSql.Site.UI/Areas/Admin/Common/BaseController.cs new file mode 100644 index 00000000..e990ec49 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Common/BaseController.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace FreeSql.Site.UI.Admin.Common +{ + public class AdminBaseController : Controller + { + + } +} \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/BBSController.cs b/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/BBSController.cs new file mode 100644 index 00000000..5324920c --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/BBSController.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using FreeSql.Site.Entity; +using FreeSql.Site.UI.Admin.Common; +using FreeSql.Site.UI.Areas.BBS.Models; +using FreeSql.Site.UI.Controllers; +using Microsoft.AspNetCore.Mvc; + +namespace FreeSql.Site.UI.Areas.Admin.Controllers +{ + [Area("Admin")] + public class BBSController : AdminBaseController + { + public IActionResult Index() + { + DocumentContent model = new DocumentContent(); + return View(model); + } + + } +} \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/DocumentController.cs b/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/DocumentController.cs new file mode 100644 index 00000000..1f07e058 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/DocumentController.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Threading.Tasks; +using FreeSql.Site.DAL; +using FreeSql.Site.Entity; +using FreeSql.Site.Entity.Common; +using FreeSql.Site.UI.Admin.Common; +using FreeSql.Site.UI.Areas.BBS.Models; +using FreeSql.Site.UI.Common; +using FreeSql.Site.UI.Controllers; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace FreeSql.Site.UI.Areas.Admin.Controllers +{ + [Area("Admin")] + public class DocumentController : AdminBaseController + { + public DocumentTypeDAL DocumentTypeDAL { get; set; } + + public DocumentContentDAL DocumentContentDAL { get; set; } + + public DocumentController() + { + this.DocumentTypeDAL = new DocumentTypeDAL(); + this.DocumentContentDAL = new DocumentContentDAL(); + } + + + public IActionResult Index() + { + DocumentContent model = new DocumentContent(); + return View(model); + } + + #region 文档分类 + public IActionResult DocType() + { + DocumentType model = new DocumentType(); + return View(model); + } + + #endregion + + #region 文档内容 + public IActionResult DocContent() + { + DocumentContent model = new DocumentContent(); + return View(model); + } + + [HttpGet] + public IActionResult DocContentList(string searchContent, string seniorQueryJson, int page = 1, int limit = 10) + { + DocumentContent model = null; + if (!string.IsNullOrWhiteSpace(seniorQueryJson)) + { + model = Newtonsoft.Json.JsonConvert.DeserializeObject(seniorQueryJson); + } + Expression> predicate = i => 1 == 0; + var searchPredicate = PredicateExtensions.True(); + if (model != null) + { + if (model.TypeID >= 0) + searchPredicate = searchPredicate.And(u => u.TypeID == model.TypeID); + + if (!string.IsNullOrEmpty(model.DocTitle)) + searchPredicate = searchPredicate.And(u => u.DocTitle.IndexOf(model.DocTitle) != -1); + } + var contents = DocumentContentDAL.Query(searchPredicate); + + return Json(new DataPage + { + code = "0", + msg = "", + count = contents.count, + data = contents.list + }); + } + + // GET: Documents/Create + public ActionResult DocContentCreate() + { + + return View(); + } + + // POST: Documents/Create + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult DocContentCreate(IFormCollection collection) + { + try + { + // TODO: Add insert logic here + return RedirectToAction(nameof(Index)); + } + catch + { + return View(); + } + } + + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult DocContentDelete(int id, IFormCollection collection) + { + bool flag = false; + flag = DocumentContentDAL.Delete(id); + return Json(flag); + } + + #endregion + } +} \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/SystemController.cs b/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/SystemController.cs new file mode 100644 index 00000000..c5e888e6 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/SystemController.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using FreeSql.Site.Entity; +using FreeSql.Site.UI.Admin.Common; +using FreeSql.Site.UI.Areas.BBS.Models; +using FreeSql.Site.UI.Controllers; +using Microsoft.AspNetCore.Mvc; + +namespace FreeSql.Site.UI.Areas.Admin.Controllers +{ + [Area("Admin")] + public class SystemController : AdminBaseController + { + public IActionResult Setting() + { + DocumentContent model = new DocumentContent(); + return View(model); + } + + } +} \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/TemplateController.cs b/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/TemplateController.cs new file mode 100644 index 00000000..eee09a3e --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Controllers/TemplateController.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using FreeSql.Site.Entity; +using FreeSql.Site.UI.Admin.Common; +using FreeSql.Site.UI.Areas.BBS.Models; +using FreeSql.Site.UI.Controllers; +using Microsoft.AspNetCore.Mvc; + +namespace FreeSql.Site.UI.Areas.Admin.Controllers +{ + [Area("Admin")] + public class TemplateController : AdminBaseController + { + public IActionResult Index() + { + DocumentContent model = new DocumentContent(); + return View(model); + } + + } +} \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Models/DocumentContentModel.cs b/Examples/website/FreeSql.Site.UI/Areas/Admin/Models/DocumentContentModel.cs new file mode 100644 index 00000000..42767bcf --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Models/DocumentContentModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace FreeSql.Site.UI.Areas.Admin.Models +{ + public class DocumentContentModel + { + public int OrderBy { get; set; } + + public int ContentID { get; set; } + } +} diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Models/DocumentTypeModel.cs b/Examples/website/FreeSql.Site.UI/Areas/Admin/Models/DocumentTypeModel.cs new file mode 100644 index 00000000..51868a2b --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Models/DocumentTypeModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace FreeSql.Site.UI.Areas.Admin.Models +{ + public class DocumentTypeModel + { + public int OrderBy { get; set; } + + public int ContentID { get; set; } + } +} diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Shared/_Layout.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Admin/Shared/_Layout.cshtml new file mode 100644 index 00000000..f55842d0 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Shared/_Layout.cshtml @@ -0,0 +1,91 @@ + + + + + + @ViewData["Title"] - FreeSql.Site.UI + + + + + + + + + + + + + + + +
+ + + + @RenderBody() + + + +
+ + @**@ + + + + + + + + + @RenderSection("Scripts", required: false) + + diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/BBS/Index.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/BBS/Index.cshtml new file mode 100644 index 00000000..1a2dc136 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/BBS/Index.cshtml @@ -0,0 +1,61 @@ +@{ + ViewBag.Title = ""; + Layout = "~/Areas/Admin/Shared/_Layout.cshtml"; +} + + +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Document/DocContent.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Document/DocContent.cshtml new file mode 100644 index 00000000..91a50f67 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Document/DocContent.cshtml @@ -0,0 +1,197 @@ + +@{ + ViewBag.Title = ".NET文档园 .NET开源ORM - 首页"; +} +@using FreeSql.Site.UI.Areas.BBS.Models; + +
+ + + + + + diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Document/DocType.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Document/DocType.cshtml new file mode 100644 index 00000000..7f160f53 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Document/DocType.cshtml @@ -0,0 +1,79 @@ +@{ + ViewBag.Title = ""; + + //Layout = "~/Areas/Admin/Shared/_Layout.cshtml"; +} +
+
+ +
+ +
+
+
+ +
+ +
+
辅助文字
+
+
+ +
+ +
+
+
+ +
+ + + +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Document/Index.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Document/Index.cshtml new file mode 100644 index 00000000..ae237f87 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Document/Index.cshtml @@ -0,0 +1,66 @@ +@{ + ViewBag.Title = ""; + Layout = "~/Areas/Admin/Shared/_Layout.cshtml"; +} +
+ +
+ +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/System/Index.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/System/Index.cshtml new file mode 100644 index 00000000..c535abf9 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/System/Index.cshtml @@ -0,0 +1,61 @@ +@{ + ViewBag.Title = ""; + Layout = "~/Areas/Admin/Shared/_Layout.cshtml"; +} + + +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/System/Setting.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/System/Setting.cshtml new file mode 100644 index 00000000..f69ee226 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/System/Setting.cshtml @@ -0,0 +1,4 @@ +@{ + ViewBag.Title = ""; +} +系统参数设置 diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Template/Index.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Template/Index.cshtml new file mode 100644 index 00000000..6e2c5b59 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/Views/Template/Index.cshtml @@ -0,0 +1,62 @@ +@{ + ViewBag.Title = ""; + Layout = "~/Areas/Admin/Shared/_Layout.cshtml"; +} + + +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Admin/_ViewStart.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Admin/_ViewStart.cshtml new file mode 100644 index 00000000..be2a4f37 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Admin/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = null; +} diff --git a/Examples/website/FreeSql.Site.UI/Areas/Doc/Controllers/DocumentsController.cs b/Examples/website/FreeSql.Site.UI/Areas/Doc/Controllers/DocumentsController.cs index bbb6ee94..8d81a34f 100644 --- a/Examples/website/FreeSql.Site.UI/Areas/Doc/Controllers/DocumentsController.cs +++ b/Examples/website/FreeSql.Site.UI/Areas/Doc/Controllers/DocumentsController.cs @@ -28,7 +28,7 @@ namespace FreeSql.Site.UI.Areas.Doc.Controllers public IActionResult Index(int id = 1) { var typeList = DocumentTypeDAL.Query(d => d.ID != 0); - var contentlist = DocumentContentDAL.Query(d => d.Status == 1); + var contentlist = DocumentContentDAL.Query(d => d.Status == 1).list; //适应两层结构即可 var query = (from p in typeList diff --git a/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Create.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Create.cshtml new file mode 100644 index 00000000..8d4d570e --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Create.cshtml @@ -0,0 +1,6 @@ +@* + For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 +*@ +@{ + +} diff --git a/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Details.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Details.cshtml index 04d4f7d5..4c3d2bf4 100644 --- a/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Details.cshtml +++ b/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Details.cshtml @@ -12,7 +12,7 @@ else {

@*开始使用 - 入门指南*@@documentinfo.DocTitle

-
+