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.
83 lines
2.0 KiB
C#
83 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Data.Entity;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DSWeb.Common.DB
|
|
{
|
|
public class RuleContext : DbContext
|
|
{
|
|
public RuleContext()
|
|
: base("DongShengDB")
|
|
{
|
|
|
|
}
|
|
|
|
public RuleContext(string conn)
|
|
: base(conn)
|
|
{
|
|
|
|
}
|
|
|
|
public DbSet<OpRule> Rules { get; set; }
|
|
public DbSet<OpRuleItem> RuleItems { get; set; }
|
|
public DbSet<OpRuleCheckOrder> RuleCheckOrders { get; set; }
|
|
public DbSet<SysEnumValueEF> EnumValues { get; set; }
|
|
|
|
}
|
|
|
|
|
|
[Table("op_rule")]
|
|
public class OpRule
|
|
{
|
|
[Key]
|
|
public string GID { get; set; }
|
|
public string Code { get; set; }
|
|
public string Title { get; set; }
|
|
public string RedAlertField { get; set; }
|
|
public bool SaveDisable { get; set; }
|
|
public bool Enable { get; set; }
|
|
public DateTime CreateTime { get; set; }
|
|
public string CreateUser { get; set; }
|
|
public DateTime? ModifyTime { get; set; }
|
|
public string ModifyUser { get; set; }
|
|
public DateTime? EnableDisableTime { get; set; }
|
|
public string CompareType { get; set; }
|
|
public int SortOrder { get; set; }
|
|
}
|
|
|
|
public enum OpRuleCompareType
|
|
{
|
|
And = 10,
|
|
Or = 20
|
|
}
|
|
|
|
[Table("op_rule_item")]
|
|
public class OpRuleItem
|
|
{
|
|
[Key]
|
|
public string GID { get; set; }
|
|
public string RuleId { get; set; }
|
|
public string Field { get; set; }
|
|
public string Compare { get; set; }
|
|
public string Value { get; set; }
|
|
public int SortOrder { get; set; }
|
|
}
|
|
|
|
|
|
|
|
[Table("op_rule_check_order")]
|
|
public class OpRuleCheckOrder
|
|
{
|
|
[Key]
|
|
public string GID { get; set; }
|
|
public string OrdNO { get; set; }
|
|
public string AlertData { get; set; }
|
|
public int Sort { get; set; }
|
|
}
|
|
}
|