【C#公共帮助类】枚举独特类

时间:2022-09-08 22:47:42
【C#公共帮助类】枚举独特类

这个是枚举类,可能大家根据个人需求不同,不是很需要,但是跟着做那个项目的朋友会用到 我在这贴一下代码

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel; namespace Common.Enums
{
/// <summary>
/// 枚举独特类
/// add yuangang by 2016-05-10
/// </summary>
public class EnumsClass
{
/// <summary>
/// 枚举value
/// </summary>
public int Value { get; set; }
/// <summary>
/// 枚举显示值
/// </summary>
public string Name { get; set; }
/// <summary>
/// 枚举说明
/// </summary>
public string Text { get; set; }
} #region 系统管理相关
/// <summary>
/// 系统操作枚举
/// </summary>
public enum enumOperator
{
/// <summary>
/// 无
/// </summary>
[Description("无")]
None,
/// <summary>
/// 查询
/// </summary>
[Description("查询")]
Select,
/// <summary>
/// 添加
/// </summary>
[Description("添加")]
Add,
/// <summary>
/// 修改
/// </summary>
[Description("修改")]
Edit,
/// <summary>
/// 移除
/// </summary>
[Description("移除")]
Remove,
/// <summary>
/// 登录
/// </summary>
[Description("登录")]
Login,
/// <summary>
/// 登出
/// </summary>
[Description("登出")]
LogOut,
/// <summary>
/// 导出
/// </summary>
[Description("导出")]
Export,
/// <summary>
/// 导入
/// </summary>
[Description("导入")]
Import,
/// <summary>
/// 审核
/// </summary>
[Description("审核")]
Audit,
/// <summary>
/// 回复
/// </summary>
[Description("回复")]
Reply,
/// <summary>
/// 下载
/// </summary>
[Description("下载")]
Download,
/// <summary>
/// 上传
/// </summary>
[Description("上传")]
Upload,
/// <summary>
/// 分配
/// </summary>
[Description("分配")]
Allocation,
/// <summary>
/// 文件
/// </summary>
[Description("文件")]
Files,
/// <summary>
/// 流程
/// </summary>
[Description("流程")]
Flow
}
/// <summary>
/// log4net枚举
/// </summary>
public enum enumLog4net
{
[Description("普通")]
INFO,
[Description("警告")]
WARN,
[Description("错误")]
ERROR,
[Description("异常")]
FATAL
}
/// <summary>
/// 模块类别枚举,对应TBSYS_Module表的ModuleType字段
/// </summary>
public enum enumModuleType
{
无页面 = ,
列表页 = ,
弹出页 =
}
/// <summary>
/// 部门类型
/// </summary>
public enum enumDepartmentType
{
胜利石油管理局 = ,
施工队=,
工程部 = ,
计划科=,
其他单位=
} #endregion #region 流程枚举
/// <summary>
/// 流程枚举
/// </summary>
public enum FLowEnums
{
/// <summary>
/// 空白
/// </summary>
[Description("空白")]
Blank = ,
/// <summary>
/// 草稿
/// </summary>
[Description("草稿")]
Draft = ,
/// <summary>
/// 运行中
/// </summary>
[Description("运行中")]
Runing = ,
/// <summary>
/// 已完成
/// </summary>
[Description("已完成")]
Complete = ,
/// <summary>
/// 挂起
/// </summary>
[Description("挂起")]
HungUp = ,
/// <summary>
/// 退回
/// </summary>
[Description("退回")]
ReturnSta = ,
/// <summary>
/// 转发(移交)
/// </summary>
[Description("移交")]
Shift = ,
/// <summary>
/// 删除(逻辑删除状态)
/// </summary>
[Description("删除")]
Delete = ,
/// <summary>
/// 加签
/// </summary>
[Description("加签")]
Askfor = ,
/// <summary>
/// 冻结
/// </summary>
[Description("冻结")]
Fix = ,
/// <summary>
/// 批处理
/// </summary>
[Description("批处理")]
Batch = ,
/// <summary>
/// 加签回复状态
/// </summary>
[Description("加签回复")]
AskForReplay =
}
#endregion #region 系统字典 /// <summary>
/// 类描述:系统字典
/// 创建标识:add yuangang by 2016-05-10
/// </summary>
public class ClsDic
{
/// <summary>
/// 根据DicKey值获取value
/// </summary>
public static string GetDicValueByKey(string key, Dictionary<string, string> p)
{
if (p == null || p.Count == ) return "";
var dic = p.GetEnumerator();
while (dic.MoveNext())
{
var obj = dic.Current;
if (key == obj.Key)
return obj.Value;
}
return "";
}
/// <summary>
/// 根据DICValue获取Key
/// </summary>
public static string GetDicKeyByValue(string value, Dictionary<string, string> p)
{
if (p == null || p.Count == ) return "";
var dic = p.GetEnumerator();
while (dic.MoveNext())
{
var obj = dic.Current;
if (obj.Value == value)
return obj.Key;
}
return "";
}
/// <summary>
/// 描述:实体与编码对应字典,在验证数据权限时,通过此处字典来枚举实体编号
/// <author>创建标识: add yuangang by 2016-05-10</author>
/// </summary>
public static Dictionary<string, string> DicEntity
{
get
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
_dic.Add("日志", "");
_dic.Add("用户", "18da4207-3bfc-49ea-90f7-16867721805c");
return _dic;
}
}
/// <summary>
/// 描述:存放特别的角色编号字典,在验证操作权限时用到
/// 创建标识:add by liuj 2013-8-9 9:56
/// </summary>
public static Dictionary<string, int> DicRole
{
get
{
Dictionary<string, int> _dic = new Dictionary<string, int>();
_dic.Add("超级管理员", );
return _dic;
}
}
/// <summary>
/// 字典类型
/// </summary>
public static Dictionary<string, string> DicCodeType
{
get
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
try
{
string dicStr = Utils.GetFileContent(System.Web.HttpContext.Current.Server.MapPath("/Models/DicType.txt"), false);
var diclist = dicStr.TrimEnd(',').TrimStart(',').Split(',').ToList();
if (diclist.Count>)
{
foreach (var item in diclist)
{
_dic.Add(item.Split('-')[], item.Split('-')[]);
}
}
}
catch { }
return _dic;
}
}
/// <summary>
/// 附件上传路径
/// 创建标识:add yuangang by 2016-05-10
/// </summary>
public static Dictionary<string, string> DicAttachmentPath
{
get
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
_dic.Add("上传路径", System.Configuration.ConfigurationManager.AppSettings["upfile"]);
_dic.Add("档案简历", System.Configuration.ConfigurationManager.AppSettings["upfile"]);
_dic.Add("手机文件", System.Configuration.ConfigurationManager.AppSettings["upphone"]);
_dic.Add("手机照片", System.Configuration.ConfigurationManager.AppSettings["photofile"]);
_dic.Add("技术文件", System.Configuration.ConfigurationManager.AppSettings["upTsfile"]);
_dic.Add("工程图", System.Configuration.ConfigurationManager.AppSettings["UploadFiles"]);
_dic.Add("档案头像", System.Configuration.ConfigurationManager.AppSettings["upfile"]);
return _dic;
}
}
/// <summary>
/// 业务办理图片宽高
/// 创建标识:add yuangang by 2016-05-10
/// </summary>
public static Dictionary<string, string> DicImageWH
{
get
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
_dic.Add("图片宽度", System.Configuration.ConfigurationManager.AppSettings["imgWidth"]);
_dic.Add("图片高度", System.Configuration.ConfigurationManager.AppSettings["imgHeight"]);
_dic.Add("手机用户头像高", System.Configuration.ConfigurationManager.AppSettings["UserPhotoHeight"]);
_dic.Add("手机用户头像宽", System.Configuration.ConfigurationManager.AppSettings["UserPhotoWidth"]);
_dic.Add("用户头像高", System.Configuration.ConfigurationManager.AppSettings["PolicePhotoHeight"]);
_dic.Add("用户头像宽", System.Configuration.ConfigurationManager.AppSettings["PolicePhotoWidth"]);
return _dic;
}
}
/// <summary>
/// 警务室图片宽高
/// 创建标识:add yuangang by 2016-05-10
/// </summary>
public static Dictionary<string, string> DicPoliceHouseImageWH
{
get
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
_dic.Add("图片宽度", System.Configuration.ConfigurationManager.AppSettings["imgPoliceWidth"]);
_dic.Add("图片高度", System.Configuration.ConfigurationManager.AppSettings["imgPoliceHeight"]);
return _dic;
}
}
/// <summary>
/// OracleReportData
/// 创建标识:add yuangang by 2016-05-10
/// </summary>
public static Dictionary<string, string> OracleReportData
{
get
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
_dic.Add("OrcalReport", System.Configuration.ConfigurationManager.AppSettings["connectionString"]);
return _dic;
}
}
/// <summary>
/// 手机客户端命名
/// 创建标识:add yuangang by 2016-05-10
/// </summary>
public static Dictionary<string, string> DicPhone
{
get
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
_dic.Add("安卓程序", System.Configuration.ConfigurationManager.AppSettings["AndroidName"]);
_dic.Add("苹果程序", System.Configuration.ConfigurationManager.AppSettings["IOSName"]);
return _dic;
}
}
/// <summary>
/// 功能描述:记录Cookie的Key值
/// 创建标识:徐戈
/// </summary>
public static Dictionary<string, string> DicCookie
{
get
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
_dic.Add("Session中存储的帐号和CookieID", "AccountCookieID_Session");
_dic.Add("Cookie中存储的帐号和CookieID", "AccountCookieIDNew");
return _dic;
}
}
/// <summary>
/// 功能描述:记录Cookie的Key值
/// 创建标识:徐戈
/// </summary>
public static Dictionary<string, string> DicCookieTimeout
{
get
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
_dic.Add("帐号过期时间", "");
return _dic;
}
} }
#endregion #region 业务相关
/// <summary>
/// 计划流转状态
/// </summary>
public enum enumHCA_RecognitionProgramProcessType
{
上报 = ,
同意 = ,
不同意 =
}
/// <summary>
/// 上传文件类型
/// </summary>
public enum enumFileType
{
其他 = ,
Word = ,
Excel = ,
图片 = ,
PPT = ,
PDF = ,
RAR=
}
/// <summary>
///路单状态
/// </summary>
public enum enumWAYBILLSTATE
{
分派 = ,
打印 = ,
数据录入 = ,
数据填报=,
车队审核回收=,
删除=,
作废=,
交接=,
纳入结算=,
完成结算= }
/// <summary>
/// 来源
/// </summary>
public enum enumORIGIN
{
自建 = ,
任务 = ,
外委申请 =
} /// <summary>
/// 应急物资规格型号
/// </summary>
public enum enumReliefGoodsModel
{
规格型号1 = ,
规格型号2 = ,
规格型号3 =
}
/// <summary>
/// 应急抢险救援物资类别
/// </summary>
public enum enumReliefGoodsType
{
溢油 = ,
防汛 =
}
/// <summary>
/// 业务咨询枚举,对应业务咨询表的bptype字段
/// </summary>
public enum enumBptType
{
在线咨询 = ,
身份证 = ,
户籍 = ,
治安管理 = ,
出入境 = ,
消防 = ,
其他业务 = ,
交警 = ,
网安 = ,
法制 =
} public enum enumNewsType
{
警务信息 = ,
警方公告 = ,
防范提示 =
} /// <summary>
/// 上传文件类型
/// </summary>
public enum enumBusType
{ 车辆图片上传 = ,
套管图片上传 = ,
三通图片上传 = ,
阀门图片上传 = ,
占压图片上传 = , } /// <summary>
/// 管道维修应急预案级别
/// </summary>
public enum enumEmergencyPlanLevel
{
中石化 = ,
油田 = ,
总厂 = ,
分厂 =
} /// <summary>
/// 阳极材料
/// </summary>
public enum enumAnodeMaterial
{
未知 = ,
镀铂阳极 = ,
磁性氧化铁 = ,
混合金属氧化物 = ,
镁 = ,
锌 = ,
铂 = ,
高硅铸铁 = ,
石墨 = ,
废钢铁 = ,
碳 = ,
铝合金 = ,
其它 =
} /// <summary>
/// 业务咨询处理状态枚举,对应业务咨询表的requesStatus字段
/// </summary>
public enum enumBussinessType
{
后台办理本部门业务 = ,
手机办理本部门业务 = ,
手机业务 = ,
社区民警 =
} /// <summary>
/// 业务咨询处理状态枚举,对应业务咨询表的requesStatus字段
/// </summary>
public enum enumRequesStatus
{
用户提交 = ,
指定处理 = ,
处理完成 =
} public enum enumWorkType
{
未指定 = -,
手机方式 = ,
电脑Web =
}
public enum enumIsBool
{
是 = ,
否 =
} public enum enumPhoneUserType
{
注册用户 = ,
匿名用户 =
} public enum enumReplyType
{
未处理 = ,
审核通过 = ,
审核不通过 =
} public enum enumBlogType
{
新浪微博 = ,
腾讯微博 = ,
东营*局的腾讯微博 =
} #endregion }

原创文章 转载请尊重劳动成果 http://yuangang.cnblogs.com