mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-23 13:57:20 +08:00
添加项目文件。
This commit is contained in:
38
CoreCms.Net.Model/ViewModels/Basics/DbTableInfo.cs
Normal file
38
CoreCms.Net.Model/ViewModels/Basics/DbTableInfo.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Model.ViewModels.Basics
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器下拉数据列表实体
|
||||
/// </summary>
|
||||
public class DbTableInfoTree
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Label { get; set; }
|
||||
public string Description { get; set; }
|
||||
public DbObjectType DbObjectType { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 表名带字段
|
||||
/// </summary>
|
||||
public class DbTableInfoAndColumns
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public List<DbColumnInfo> columns { get; set; } = null;
|
||||
public DbObjectType DbObjectType { get; set; }
|
||||
}
|
||||
}
|
||||
56
CoreCms.Net.Model/ViewModels/Basics/DictionaryKeyValues.cs
Normal file
56
CoreCms.Net.Model/ViewModels/Basics/DictionaryKeyValues.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.ViewModels.Basics
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局配置字典值内容
|
||||
/// </summary>
|
||||
public class DictionaryKeyValues
|
||||
{
|
||||
/// <summary>
|
||||
/// key
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "key不能为空")]
|
||||
public string sKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
public string sValue { get; set; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 常用复用无条件匹配
|
||||
/// </summary>
|
||||
public class CommonKeyValues
|
||||
{
|
||||
/// <summary>
|
||||
/// key
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "key不能为空")]
|
||||
public string sKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
public string sValue { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 说明备注
|
||||
/// </summary>
|
||||
public string sDescription { get; set; }
|
||||
}
|
||||
}
|
||||
31
CoreCms.Net.Model/ViewModels/Basics/ErrorViewModel.cs
Normal file
31
CoreCms.Net.Model/ViewModels/Basics/ErrorViewModel.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
namespace CoreCms.Net.Model.ViewModels.Basics
|
||||
{
|
||||
/// <summary>
|
||||
/// 验证错误信息视图模型
|
||||
/// </summary>
|
||||
public class ErrorView
|
||||
{
|
||||
/// <summary>
|
||||
/// 错误字段
|
||||
/// </summary>
|
||||
|
||||
public string ErrorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误内容ErrorMessage
|
||||
/// </summary>
|
||||
|
||||
public string Error { get; set; }
|
||||
}
|
||||
}
|
||||
24
CoreCms.Net.Model/ViewModels/Basics/IPageList.cs
Normal file
24
CoreCms.Net.Model/ViewModels/Basics/IPageList.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CoreCms.Net.Model.ViewModels.Basics
|
||||
{
|
||||
public interface IPageList<T> : IList<T>
|
||||
{
|
||||
int PageIndex { get; }
|
||||
int PageSize { get; }
|
||||
int TotalCount { get; }
|
||||
int TotalPages { get; }
|
||||
bool HasPreviousPage { get; }
|
||||
bool HasNextPage { get; }
|
||||
}
|
||||
}
|
||||
38
CoreCms.Net.Model/ViewModels/Basics/LastTimeDetail.cs
Normal file
38
CoreCms.Net.Model/ViewModels/Basics/LastTimeDetail.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
namespace CoreCms.Net.Model.ViewModels.Basics
|
||||
{
|
||||
/// <summary>
|
||||
/// 剩余时间
|
||||
/// </summary>
|
||||
public class LastTimeDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// 日
|
||||
/// </summary>
|
||||
public int day { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 时
|
||||
/// </summary>
|
||||
public int hour { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 分
|
||||
/// </summary>
|
||||
public int minute { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 秒
|
||||
/// </summary>
|
||||
public int second { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
114
CoreCms.Net.Model/ViewModels/Basics/PageList.cs
Normal file
114
CoreCms.Net.Model/ViewModels/Basics/PageList.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace CoreCms.Net.Model.ViewModels.Basics
|
||||
{
|
||||
/// <summary>
|
||||
/// 分页组件实体类
|
||||
/// </summary>
|
||||
/// <typeparam name="T">泛型实体</typeparam>
|
||||
[Serializable]
|
||||
public class PageList<T> : List<T>, IPageList<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="source">数据源</param>
|
||||
/// <param name="pageIndex">分页索引</param>
|
||||
/// <param name="pageSize">分页大小</param>
|
||||
public PageList(IQueryable<T> source, int pageIndex, int pageSize)
|
||||
{
|
||||
var total = source.Count();
|
||||
TotalCount = total;
|
||||
TotalPages = total / pageSize;
|
||||
|
||||
if (total % pageSize > 0)
|
||||
TotalPages++;
|
||||
|
||||
PageSize = pageSize;
|
||||
PageIndex = pageIndex;
|
||||
|
||||
AddRange(source.Skip(pageIndex * pageSize).Take(pageSize).ToList());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="source">数据源</param>
|
||||
/// <param name="pageIndex">分页索引</param>
|
||||
/// <param name="pageSize">分页大小</param>
|
||||
public PageList(IList<T> source, int pageIndex, int pageSize)
|
||||
{
|
||||
TotalCount = source.Count();
|
||||
TotalPages = TotalCount / pageSize;
|
||||
|
||||
if (TotalCount % pageSize > 0)
|
||||
TotalPages++;
|
||||
|
||||
PageSize = pageSize;
|
||||
PageIndex = pageIndex;
|
||||
AddRange(source.Skip(pageIndex * pageSize).Take(pageSize).ToList());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="source">数据源</param>
|
||||
/// <param name="pageIndex">分页索引</param>
|
||||
/// <param name="pageSize">分页大小</param>
|
||||
/// <param name="totalCount">总记录数</param>
|
||||
public PageList(IEnumerable<T> source, int pageIndex, int pageSize, int totalCount)
|
||||
{
|
||||
TotalCount = totalCount;
|
||||
TotalPages = TotalCount / pageSize;
|
||||
|
||||
if (TotalCount % pageSize > 0)
|
||||
TotalPages++;
|
||||
|
||||
PageSize = pageSize;
|
||||
PageIndex = pageIndex;
|
||||
AddRange(source);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页索引
|
||||
/// </summary>
|
||||
public int PageIndex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 分页大小
|
||||
/// </summary>
|
||||
public int PageSize { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总记录数
|
||||
/// </summary>
|
||||
public int TotalCount { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 总页数
|
||||
/// </summary>
|
||||
public int TotalPages { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否有上一页
|
||||
/// </summary>
|
||||
public bool HasPreviousPage => PageIndex > 0;
|
||||
|
||||
/// <summary>
|
||||
/// 是否有下一页
|
||||
/// </summary>
|
||||
public bool HasNextPage => PageIndex + 1 < TotalPages;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user