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.

105 lines
3.0 KiB
C#

using FluentValidation;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Sys.Dtos
{
/// <summary>
/// 打印模板请求实体
/// </summary>
public class SysPrintTemplateReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 打印模块Id
/// </summary>
public long ModuleId { get; set; }
/// <summary>
///打印模板名称
/// </summary>
[Description("打印模板名称")]
public string TemplateName { get; set; }
/// <summary>
///数据源;打印方案对应的数据来源SQL
/// </summary>
[Description("数据源;打印方案对应的数据来源SQL")]
public string SourceSql { get; set; }
/// <summary>
///中文视图名;设计打印方案时,提供中文快捷按钮的视图来源
/// </summary>
[Description("中文视图名;设计打印方案时,提供中文快捷按钮的视图来源")]
public string ColumnView { get; set; }
/// <summary>
///入口参数字段;入库参数字段数组,通过,分隔
/// </summary>
[Description("入口参数字段;入库参数字段数组,通过,分隔")]
public string InParamColumn { get; set; }
/// <summary>
///分组字段,通常用于主从表结构打印时
/// </summary>
[Description("分组字段,通常用于主从表结构打印时")]
public string GroupBy { get; set; }
/// <summary>
/// 打印类型
/// </summary>
[Description("打印类型")]
public string PrintType { get; set; }
/// <summary>
///打印方案内容;打印方案JSON对象
/// </summary>
[Description("打印方案内容;打印方案JSON对象")]
public string PrintJsonContent { get; set; }
/// <summary>
///是否使用数据源
/// </summary>
public bool IsUseDataSource { get; set; }
/// <summary>
///是否公用
/// </summary>
[Description("是否公用")]
public bool IsPublic { get; set; }
/// <summary>
/// 是否可用
/// </summary>
[Description("是否可用")]
public bool Disable { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; }
}
/// <summary>
/// 验证
/// </summary>
public class SysPrintTemplateReqValidator : AbstractValidator<SysPrintTemplateReq>
{
/// <summary>
/// 构造函数
/// </summary>
public SysPrintTemplateReqValidator()
{
this.RuleFor(o => o.TemplateName)
.NotEmpty().WithName("打印模板名称");
this.RuleFor(o => o.PrintType)
.NotEmpty().WithName("打印类型");
}
}
}