using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tiger.Model.Extensions;
namespace Tiger.Model
{
///
/// 数据库查询授权种类枚举
///
public enum DbAuth
{
[Description("组织机构授权")]
Org = 1,
[Description("生产单元授权")]
Prod = 2,
[Description("仓库单元授权")]
Wh = 4,
}
///
/// 数据库授权查询选项
///
public class AuthOption : OptionBase
{
///
/// 用户ID
///
public string UserId { get; set; }
///
/// 用户当前选择的组织机构编码
///
public string CurOrg { get; set; }
///
/// 按照组织机构授权查询
///
public bool ByOrg { get; set; } = false;
///
/// 要查询的组织机构编码,如果多个用","分割
///
public string OrgCode { get; set; }
///
/// 按照生产单元授权查询
///
public bool ByProd { get; set; } = false;
///
/// 要查询的生产单元编码,如果多个用","分割
///
public string ProdCode { get; set; }
///
/// 按照仓库单元授权查询
///
public bool ByWh { get; set; } = false;
///
/// 要查询的仓库单元编码,如果多个用","分割
///
public string WhCode { get; set; }
///
/// 授权查询枚举Options
///
public DbAuth GetOptions() => (DbAuth)((ByOrg ? DbAuth.Org.GetValue() : 0) + (ByProd ? DbAuth.Prod.GetValue() : 0) + (ByWh ? DbAuth.Wh.GetValue() : 0));
}
}