这个是枚举类,可能大家根据个人需求不同,不是很需要,但是跟着做那个项目的朋友会用到 我在这贴一下代码
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.ComponentModel; 6 7 namespace Common.Enums 8 { 9 ///10 /// 枚举独特类 11 /// add yuangang by 2016-05-10 12 /// 13 public class EnumsClass 14 { 15 ///16 /// 枚举value 17 /// 18 public int Value { get; set; } 19 ///20 /// 枚举显示值 21 /// 22 public string Name { get; set; } 23 ///24 /// 枚举说明 25 /// 26 public string Text { get; set; } 27 } 28 29 #region 系统管理相关 30 ///31 /// 系统操作枚举 32 /// 33 public enum enumOperator 34 { 35 ///36 /// 无 37 /// 38 [Description("无")] 39 None, 40 ///41 /// 查询 42 /// 43 [Description("查询")] 44 Select, 45 ///46 /// 添加 47 /// 48 [Description("添加")] 49 Add, 50 ///51 /// 修改 52 /// 53 [Description("修改")] 54 Edit, 55 ///56 /// 移除 57 /// 58 [Description("移除")] 59 Remove, 60 ///61 /// 登录 62 /// 63 [Description("登录")] 64 Login, 65 ///66 /// 登出 67 /// 68 [Description("登出")] 69 LogOut, 70 ///71 /// 导出 72 /// 73 [Description("导出")] 74 Export, 75 ///76 /// 导入 77 /// 78 [Description("导入")] 79 Import, 80 ///81 /// 审核 82 /// 83 [Description("审核")] 84 Audit, 85 ///86 /// 回复 87 /// 88 [Description("回复")] 89 Reply, 90 ///91 /// 下载 92 /// 93 [Description("下载")] 94 Download, 95 ///96 /// 上传 97 /// 98 [Description("上传")] 99 Upload,100 ///101 /// 分配102 /// 103 [Description("分配")]104 Allocation,105 ///106 /// 文件107 /// 108 [Description("文件")]109 Files,110 ///111 /// 流程112 /// 113 [Description("流程")]114 Flow115 }116 ///117 /// log4net枚举118 /// 119 public enum enumLog4net 120 {121 [Description("普通")]122 INFO,123 [Description("警告")]124 WARN,125 [Description("错误")]126 ERROR,127 [Description("异常")]128 FATAL129 }130 ///131 /// 模块类别枚举,对应TBSYS_Module表的ModuleType字段132 /// 133 public enum enumModuleType134 {135 无页面 = 1,136 列表页 = 2,137 弹出页 = 3138 }139 ///140 /// 部门类型141 /// 142 public enum enumDepartmentType143 {144 胜利石油管理局 = 1,145 施工队=2,146 工程部 = 3,147 计划科=4,148 其他单位=5149 }150 151 #endregion152 153 #region 流程枚举154 ///155 /// 流程枚举156 /// 157 public enum FLowEnums 158 {159 ///160 /// 空白161 /// 162 [Description("空白")]163 Blank = 0,164 ///165 /// 草稿166 /// 167 [Description("草稿")]168 Draft = 1,169 ///170 /// 运行中171 /// 172 [Description("运行中")]173 Runing = 2,174 ///175 /// 已完成176 /// 177 [Description("已完成")]178 Complete = 3,179 ///180 /// 挂起181 /// 182 [Description("挂起")]183 HungUp = 4,184 ///185 /// 退回186 /// 187 [Description("退回")]188 ReturnSta = 5,189 ///190 /// 转发(移交)191 /// 192 [Description("移交")]193 Shift = 6,194 ///195 /// 删除(逻辑删除状态)196 /// 197 [Description("删除")]198 Delete = 7,199 ///200 /// 加签201 /// 202 [Description("加签")]203 Askfor = 8,204 ///205 /// 冻结206 /// 207 [Description("冻结")]208 Fix = 9,209 ///210 /// 批处理211 /// 212 [Description("批处理")]213 Batch = 10,214 ///215 /// 加签回复状态216 /// 217 [Description("加签回复")]218 AskForReplay = 11219 }220 #endregion221 222 #region 系统字典223 224 ///225 /// 类描述:系统字典226 /// 创建标识:add yuangang by 2016-05-10227 /// 228 public class ClsDic229 {230 ///231 /// 根据DicKey值获取value232 /// 233 public static string GetDicValueByKey(string key, Dictionaryp)234 {235 if (p == null || p.Count == 0) return "";236 var dic = p.GetEnumerator();237 while (dic.MoveNext())238 {239 var obj = dic.Current;240 if (key == obj.Key)241 return obj.Value;242 }243 return "";244 }245 /// 246 /// 根据DICValue获取Key247 /// 248 public static string GetDicKeyByValue(string value, Dictionaryp) 249 {250 if (p == null || p.Count == 0) return "";251 var dic = p.GetEnumerator();252 while (dic.MoveNext())253 {254 var obj = dic.Current;255 if (obj.Value == value)256 return obj.Key;257 }258 return "";259 }260 /// 261 /// 描述:实体与编码对应字典,在验证数据权限时,通过此处字典来枚举实体编号262 /// 264 public static Dictionary创建标识: add yuangang by 2016-05-10 263 ///DicEntity265 {266 get267 {268 Dictionary _dic = new Dictionary ();269 _dic.Add("日志", "");270 _dic.Add("用户", "18da4207-3bfc-49ea-90f7-16867721805c");271 return _dic;272 }273 }274 /// 275 /// 描述:存放特别的角色编号字典,在验证操作权限时用到276 /// 创建标识:add by liuj 2013-8-9 9:56277 /// 278 public static DictionaryDicRole279 {280 get281 {282 Dictionary _dic = new Dictionary ();283 _dic.Add("超级管理员", 1);284 return _dic;285 }286 }287 /// 288 /// 字典类型289 /// 290 public static DictionaryDicCodeType291 {292 get293 {294 Dictionary _dic = new Dictionary ();295 try296 {297 string dicStr = Utils.GetFileContent(System.Web.HttpContext.Current.Server.MapPath("/Models/DicType.txt"), false);298 var diclist = dicStr.TrimEnd(',').TrimStart(',').Split(',').ToList();299 if (diclist.Count>0)300 {301 foreach (var item in diclist)302 {303 _dic.Add(item.Split('-')[0], item.Split('-')[1]);304 }305 }306 }307 catch { }308 return _dic;309 }310 }311 /// 312 /// 附件上传路径313 /// 创建标识:add yuangang by 2016-05-10314 /// 315 public static DictionaryDicAttachmentPath316 {317 get318 {319 Dictionary _dic = new Dictionary ();320 _dic.Add("上传路径", System.Configuration.ConfigurationManager.AppSettings["upfile"]);321 _dic.Add("档案简历", System.Configuration.ConfigurationManager.AppSettings["upfile"]);322 _dic.Add("手机文件", System.Configuration.ConfigurationManager.AppSettings["upphone"]);323 _dic.Add("手机照片", System.Configuration.ConfigurationManager.AppSettings["photofile"]);324 _dic.Add("技术文件", System.Configuration.ConfigurationManager.AppSettings["upTsfile"]);325 _dic.Add("工程图", System.Configuration.ConfigurationManager.AppSettings["UploadFiles"]);326 _dic.Add("档案头像", System.Configuration.ConfigurationManager.AppSettings["upfile"]);327 return _dic;328 }329 }330 /// 331 /// 业务办理图片宽高332 /// 创建标识:add yuangang by 2016-05-10333 /// 334 public static DictionaryDicImageWH335 {336 get337 {338 Dictionary _dic = new Dictionary ();339 _dic.Add("图片宽度", System.Configuration.ConfigurationManager.AppSettings["imgWidth"]);340 _dic.Add("图片高度", System.Configuration.ConfigurationManager.AppSettings["imgHeight"]);341 _dic.Add("手机用户头像高", System.Configuration.ConfigurationManager.AppSettings["UserPhotoHeight"]);342 _dic.Add("手机用户头像宽", System.Configuration.ConfigurationManager.AppSettings["UserPhotoWidth"]);343 _dic.Add("用户头像高", System.Configuration.ConfigurationManager.AppSettings["PolicePhotoHeight"]);344 _dic.Add("用户头像宽", System.Configuration.ConfigurationManager.AppSettings["PolicePhotoWidth"]);345 return _dic;346 }347 }348 /// 349 /// 警务室图片宽高350 /// 创建标识:add yuangang by 2016-05-10351 /// 352 public static DictionaryDicPoliceHouseImageWH353 {354 get355 {356 Dictionary _dic = new Dictionary ();357 _dic.Add("图片宽度", System.Configuration.ConfigurationManager.AppSettings["imgPoliceWidth"]);358 _dic.Add("图片高度", System.Configuration.ConfigurationManager.AppSettings["imgPoliceHeight"]);359 return _dic;360 }361 }362 /// 363 /// OracleReportData364 /// 创建标识:add yuangang by 2016-05-10365 /// 366 public static DictionaryOracleReportData367 {368 get369 {370 Dictionary _dic = new Dictionary ();371 _dic.Add("OrcalReport", System.Configuration.ConfigurationManager.AppSettings["connectionString"]);372 return _dic;373 }374 }375 /// 376 /// 手机客户端命名377 /// 创建标识:add yuangang by 2016-05-10378 /// 379 public static DictionaryDicPhone380 {381 get382 {383 Dictionary _dic = new Dictionary ();384 _dic.Add("安卓程序", System.Configuration.ConfigurationManager.AppSettings["AndroidName"]);385 _dic.Add("苹果程序", System.Configuration.ConfigurationManager.AppSettings["IOSName"]);386 return _dic;387 }388 }389 /// 390 /// 功能描述:记录Cookie的Key值 391 /// 创建标识:徐戈392 /// 393 public static DictionaryDicCookie394 {395 get396 {397 Dictionary _dic = new Dictionary ();398 _dic.Add("Session中存储的帐号和CookieID", "AccountCookieID_Session");399 _dic.Add("Cookie中存储的帐号和CookieID", "AccountCookieIDNew");400 return _dic;401 }402 }403 /// 404 /// 功能描述:记录Cookie的Key值 405 /// 创建标识:徐戈406 /// 407 public static DictionaryDicCookieTimeout408 {409 get410 {411 Dictionary _dic = new Dictionary ();412 _dic.Add("帐号过期时间", "30");413 return _dic;414 }415 }416 417 }418 #endregion419 420 #region 业务相关421 /// 422 /// 计划流转状态423 /// 424 public enum enumHCA_RecognitionProgramProcessType425 {426 上报 = 1,427 同意 = 2,428 不同意 = 3429 }430 ///431 /// 上传文件类型432 /// 433 public enum enumFileType434 {435 其他 = 0,436 Word = 1,437 Excel = 2,438 图片 = 3,439 PPT = 4,440 PDF = 5,441 RAR=6442 }443 ///444 ///路单状态445 /// 446 public enum enumWAYBILLSTATE447 {448 分派 = 1,449 打印 = 2,450 数据录入 = 3,451 数据填报=4,452 车队审核回收=5,453 删除=6,454 作废=7,455 交接=8,456 纳入结算=9,457 完成结算=10458 459 460 }461 ///462 /// 来源463 /// 464 public enum enumORIGIN465 {466 自建 = 1,467 任务 = 2,468 外委申请 = 3469 }470 471 ///472 /// 应急物资规格型号473 /// 474 public enum enumReliefGoodsModel475 {476 规格型号1 = 1,477 规格型号2 = 2,478 规格型号3 = 3479 }480 ///481 /// 应急抢险救援物资类别482 /// 483 public enum enumReliefGoodsType484 {485 溢油 = 1,486 防汛 = 2487 }488 ///489 /// 业务咨询枚举,对应业务咨询表的bptype字段490 /// 491 public enum enumBptType492 {493 在线咨询 = 401002,494 身份证 = 501001,495 户籍 = 501002,496 治安管理 = 501003,497 出入境 = 501004,498 消防 = 501005,499 其他业务 = 501006,500 交警 = 501007,501 网安 = 501008,502 法制 = 501009503 }504 505 public enum enumNewsType506 {507 警务信息 = 301001,508 警方公告 = 301002,509 防范提示 = 101501510 }511 512 ///513 /// 上传文件类型514 /// 515 public enum enumBusType516 {517 518 车辆图片上传 = 100001,519 套管图片上传 = 103002,520 三通图片上传 = 103003,521 阀门图片上传 = 103004,522 占压图片上传 = 103005,523 524 525 }526 527 528 ///529 /// 管道维修应急预案级别530 /// 531 public enum enumEmergencyPlanLevel532 {533 中石化 = 1,534 油田 = 2,535 总厂 = 3,536 分厂 = 4537 }538 539 ///540 /// 阳极材料541 /// 542 public enum enumAnodeMaterial543 {544 未知 = 0,545 镀铂阳极 = 1,546 磁性氧化铁 = 2,547 混合金属氧化物 = 3,548 镁 = 4,549 锌 = 5,550 铂 = 6,551 高硅铸铁 = 7,552 石墨 = 8,553 废钢铁 = 9,554 碳 = 10,555 铝合金 = 11,556 其它 = 99557 }558 559 560 ///561 /// 业务咨询处理状态枚举,对应业务咨询表的requesStatus字段562 /// 563 public enum enumBussinessType564 {565 后台办理本部门业务 = 1,566 手机办理本部门业务 = 2,567 手机业务 = 3,568 社区民警 = 4569 }570 571 ///572 /// 业务咨询处理状态枚举,对应业务咨询表的requesStatus字段573 /// 574 public enum enumRequesStatus575 {576 用户提交 = 0,577 指定处理 = 1,578 处理完成 = 2579 }580 581 public enum enumWorkType582 {583 未指定 = -1,584 手机方式 = 0,585 电脑Web = 1586 }587 public enum enumIsBool588 {589 是 = 1,590 否 = 2591 }592 593 public enum enumPhoneUserType594 {595 注册用户 = 1,596 匿名用户 = 2597 }598 599 public enum enumReplyType600 {601 未处理 = 0,602 审核通过 = 1,603 审核不通过 = 2604 }605 606 public enum enumBlogType607 {608 新浪微博 = 0,609 腾讯微博 = 1,610 东营公安局的腾讯微博 = 2611 }612 613 614 #endregion615 616 }
原创文章 转载请尊重劳动成果