You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
2.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CommonModel
{
public class PageSearch : PageBase
{
/// <summary>
/// 统一查询
/// </summary>
public string? Search { get; set; }
/// <summary>
/// 开始日期
/// </summary>
public DateTime? StartDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
public DateTime? EndDate { get; set; }
}
public class PageSearch<T> : PageSearch
{
/// <summary>
/// 查询条件
/// </summary>
public T? Mode { get; set; }
}
public class PageDaySearch : PageSearch {
public PageDaySearch()
{
var DateNow = DateTime.Now;
if (StartDate == null && EndDate == null)
{
StartDate = DateTime.Today;
EndDate = DateNow;
}
else if (StartDate == null)
{
StartDate = DateTime.Today;
}
else if (EndDate == null)
{
EndDate = DateNow;
}
}
}
public class PageDaySearch<T> : PageDaySearch {
/// <summary>
/// 查询条件
/// </summary>
public T? Mode { get; set; }
}
public class PageMonthSearch : PageSearch
{
public PageMonthSearch()
{
var DateNow = DateTime.Now;
if (StartDate == null && EndDate == null)
{
StartDate = DateNow.AddMonths(-1);
EndDate = DateNow;
}
else if (StartDate == null)
{
StartDate = DateNow.AddMonths(-1);
}
else if (EndDate == null)
{
EndDate = DateNow;
}
}
}
public class PageMonthSearch<T> : PageMonthSearch
{
/// <summary>
/// 查询条件
/// </summary>
public T? Mode { get; set; }
}
public class PageYearSearch : PageSearch
{
public PageYearSearch()
{
var DateNow = DateTime.Now;
if (StartDate == null && EndDate == null)
{
StartDate = DateNow.AddYears(-1);
EndDate = DateNow;
}
else if (StartDate == null)
{
StartDate = DateNow.AddYears(-1);
}
else if (EndDate == null)
{
EndDate = DateNow;
}
}
}
public class PageYearSearch<T> : PageYearSearch
{
/// <summary>
/// 查询条件
/// </summary>
public T? Mode { get; set; }
}
}