程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> C# >> C#入門知識 >> 【C#公共幫助類】枚舉獨特類,

【C#公共幫助類】枚舉獨特類,

編輯:C#入門知識

【C#公共幫助類】枚舉獨特類,


這個是枚舉類,可能大家根據個人需求不同,不是很需要,但是跟著做那個項目的朋友會用到 我在這貼一下代碼

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 /// <summary> 10 /// 枚舉獨特類 11 /// add yuangang by 2016-05-10 12 /// </summary> 13 public class EnumsClass 14 { 15 /// <summary> 16 /// 枚舉value 17 /// </summary> 18 public int Value { get; set; } 19 /// <summary> 20 /// 枚舉顯示值 21 /// </summary> 22 public string Name { get; set; } 23 /// <summary> 24 /// 枚舉說明 25 /// </summary> 26 public string Text { get; set; } 27 } 28 29 #region 系統管理相關 30 /// <summary> 31 /// 系統操作枚舉 32 /// </summary> 33 public enum enumOperator 34 { 35 /// <summary> 36 /// 無 37 /// </summary> 38 [Description("無")] 39 None, 40 /// <summary> 41 /// 查詢 42 /// </summary> 43 [Description("查詢")] 44 Select, 45 /// <summary> 46 /// 添加 47 /// </summary> 48 [Description("添加")] 49 Add, 50 /// <summary> 51 /// 修改 52 /// </summary> 53 [Description("修改")] 54 Edit, 55 /// <summary> 56 /// 移除 57 /// </summary> 58 [Description("移除")] 59 Remove, 60 /// <summary> 61 /// 登錄 62 /// </summary> 63 [Description("登錄")] 64 Login, 65 /// <summary> 66 /// 登出 67 /// </summary> 68 [Description("登出")] 69 LogOut, 70 /// <summary> 71 /// 導出 72 /// </summary> 73 [Description("導出")] 74 Export, 75 /// <summary> 76 /// 導入 77 /// </summary> 78 [Description("導入")] 79 Import, 80 /// <summary> 81 /// 審核 82 /// </summary> 83 [Description("審核")] 84 Audit, 85 /// <summary> 86 /// 回復 87 /// </summary> 88 [Description("回復")] 89 Reply, 90 /// <summary> 91 /// 下載 92 /// </summary> 93 [Description("下載")] 94 Download, 95 /// <summary> 96 /// 上傳 97 /// </summary> 98 [Description("上傳")] 99 Upload, 100 /// <summary> 101 /// 分配 102 /// </summary> 103 [Description("分配")] 104 Allocation, 105 /// <summary> 106 /// 文件 107 /// </summary> 108 [Description("文件")] 109 Files, 110 /// <summary> 111 /// 流程 112 /// </summary> 113 [Description("流程")] 114 Flow 115 } 116 /// <summary> 117 /// log4net枚舉 118 /// </summary> 119 public enum enumLog4net 120 { 121 [Description("普通")] 122 INFO, 123 [Description("警告")] 124 WARN, 125 [Description("錯誤")] 126 ERROR, 127 [Description("異常")] 128 FATAL 129 } 130 /// <summary> 131 /// 模塊類別枚舉,對應TBSYS_Module表的ModuleType字段 132 /// </summary> 133 public enum enumModuleType 134 { 135 無頁面 = 1, 136 列表頁 = 2, 137 彈出頁 = 3 138 } 139 /// <summary> 140 /// 部門類型 141 /// </summary> 142 public enum enumDepartmentType 143 { 144 勝利石油管理局 = 1, 145 施工隊=2, 146 工程部 = 3, 147 計劃科=4, 148 其他單位=5 149 } 150 151 #endregion 152 153 #region 流程枚舉 154 /// <summary> 155 /// 流程枚舉 156 /// </summary> 157 public enum FLowEnums 158 { 159 /// <summary> 160 /// 空白 161 /// </summary> 162 [Description("空白")] 163 Blank = 0, 164 /// <summary> 165 /// 草稿 166 /// </summary> 167 [Description("草稿")] 168 Draft = 1, 169 /// <summary> 170 /// 運行中 171 /// </summary> 172 [Description("運行中")] 173 Runing = 2, 174 /// <summary> 175 /// 已完成 176 /// </summary> 177 [Description("已完成")] 178 Complete = 3, 179 /// <summary> 180 /// 掛起 181 /// </summary> 182 [Description("掛起")] 183 HungUp = 4, 184 /// <summary> 185 /// 退回 186 /// </summary> 187 [Description("退回")] 188 ReturnSta = 5, 189 /// <summary> 190 /// 轉發(移交) 191 /// </summary> 192 [Description("移交")] 193 Shift = 6, 194 /// <summary> 195 /// 刪除(邏輯刪除狀態) 196 /// </summary> 197 [Description("刪除")] 198 Delete = 7, 199 /// <summary> 200 /// 加簽 201 /// </summary> 202 [Description("加簽")] 203 Askfor = 8, 204 /// <summary> 205 /// 凍結 206 /// </summary> 207 [Description("凍結")] 208 Fix = 9, 209 /// <summary> 210 /// 批處理 211 /// </summary> 212 [Description("批處理")] 213 Batch = 10, 214 /// <summary> 215 /// 加簽回復狀態 216 /// </summary> 217 [Description("加簽回復")] 218 AskForReplay = 11 219 } 220 #endregion 221 222 #region 系統字典 223 224 /// <summary> 225 /// 類描述:系統字典 226 /// 創建標識:add yuangang by 2016-05-10 227 /// </summary> 228 public class ClsDic 229 { 230 /// <summary> 231 /// 根據DicKey值獲取value 232 /// </summary> 233 public static string GetDicValueByKey(string key, Dictionary<string, string> p) 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 /// <summary> 246 /// 根據DICValue獲取Key 247 /// </summary> 248 public static string GetDicKeyByValue(string value, Dictionary<string, string> p) 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 /// <summary> 261 /// 描述:實體與編碼對應字典,在驗證數據權限時,通過此處字典來枚舉實體編號 262 /// <author>創建標識: add yuangang by 2016-05-10</author> 263 /// </summary> 264 public static Dictionary<string, string> DicEntity 265 { 266 get 267 { 268 Dictionary<string, string> _dic = new Dictionary<string, string>(); 269 _dic.Add("日志", ""); 270 _dic.Add("用戶", "18da4207-3bfc-49ea-90f7-16867721805c"); 271 return _dic; 272 } 273 } 274 /// <summary> 275 /// 描述:存放特別的角色編號字典,在驗證操作權限時用到 276 /// 創建標識:add by liuj 2013-8-9 9:56 277 /// </summary> 278 public static Dictionary<string, int> DicRole 279 { 280 get 281 { 282 Dictionary<string, int> _dic = new Dictionary<string, int>(); 283 _dic.Add("超級管理員", 1); 284 return _dic; 285 } 286 } 287 /// <summary> 288 /// 字典類型 289 /// </summary> 290 public static Dictionary<string, string> DicCodeType 291 { 292 get 293 { 294 Dictionary<string, string> _dic = new Dictionary<string, string>(); 295 try 296 { 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 /// <summary> 312 /// 附件上傳路徑 313 /// 創建標識:add yuangang by 2016-05-10 314 /// </summary> 315 public static Dictionary<string, string> DicAttachmentPath 316 { 317 get 318 { 319 Dictionary<string, string> _dic = new Dictionary<string, string>(); 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 /// <summary> 331 /// 業務辦理圖片寬高 332 /// 創建標識:add yuangang by 2016-05-10 333 /// </summary> 334 public static Dictionary<string, string> DicImageWH 335 { 336 get 337 { 338 Dictionary<string, string> _dic = new Dictionary<string, string>(); 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 /// <summary> 349 /// 警務室圖片寬高 350 /// 創建標識:add yuangang by 2016-05-10 351 /// </summary> 352 public static Dictionary<string, string> DicPoliceHouseImageWH 353 { 354 get 355 { 356 Dictionary<string, string> _dic = new Dictionary<string, string>(); 357 _dic.Add("圖片寬度", System.Configuration.ConfigurationManager.AppSettings["imgPoliceWidth"]); 358 _dic.Add("圖片高度", System.Configuration.ConfigurationManager.AppSettings["imgPoliceHeight"]); 359 return _dic; 360 } 361 } 362 /// <summary> 363 /// OracleReportData 364 /// 創建標識:add yuangang by 2016-05-10 365 /// </summary> 366 public static Dictionary<string, string> OracleReportData 367 { 368 get 369 { 370 Dictionary<string, string> _dic = new Dictionary<string, string>(); 371 _dic.Add("OrcalReport", System.Configuration.ConfigurationManager.AppSettings["connectionString"]); 372 return _dic; 373 } 374 } 375 /// <summary> 376 /// 手機客戶端命名 377 /// 創建標識:add yuangang by 2016-05-10 378 /// </summary> 379 public static Dictionary<string, string> DicPhone 380 { 381 get 382 { 383 Dictionary<string, string> _dic = new Dictionary<string, string>(); 384 _dic.Add("安卓程序", System.Configuration.ConfigurationManager.AppSettings["AndroidName"]); 385 _dic.Add("蘋果程序", System.Configuration.ConfigurationManager.AppSettings["IOSName"]); 386 return _dic; 387 } 388 } 389 /// <summary> 390 /// 功能描述:記錄Cookie的Key值 391 /// 創建標識:徐戈 392 /// </summary> 393 public static Dictionary<string, string> DicCookie 394 { 395 get 396 { 397 Dictionary<string, string> _dic = new Dictionary<string, string>(); 398 _dic.Add("Session中存儲的帳號和CookieID", "AccountCookieID_Session"); 399 _dic.Add("Cookie中存儲的帳號和CookieID", "AccountCookieIDNew"); 400 return _dic; 401 } 402 } 403 /// <summary> 404 /// 功能描述:記錄Cookie的Key值 405 /// 創建標識:徐戈 406 /// </summary> 407 public static Dictionary<string, string> DicCookieTimeout 408 { 409 get 410 { 411 Dictionary<string, string> _dic = new Dictionary<string, string>(); 412 _dic.Add("帳號過期時間", "30"); 413 return _dic; 414 } 415 } 416 417 } 418 #endregion 419 420 #region 業務相關 421 /// <summary> 422 /// 計劃流轉狀態 423 /// </summary> 424 public enum enumHCA_RecognitionProgramProcessType 425 { 426 上報 = 1, 427 同意 = 2, 428 不同意 = 3 429 } 430 /// <summary> 431 /// 上傳文件類型 432 /// </summary> 433 public enum enumFileType 434 { 435 其他 = 0, 436 Word = 1, 437 Excel = 2, 438 圖片 = 3, 439 PPT = 4, 440 PDF = 5, 441 RAR=6 442 } 443 /// <summary> 444 ///路單狀態 445 /// </summary> 446 public enum enumWAYBILLSTATE 447 { 448 分派 = 1, 449 打印 = 2, 450 數據錄入 = 3, 451 數據填報=4, 452 車隊審核回收=5, 453 刪除=6, 454 作廢=7, 455 交接=8, 456 納入結算=9, 457 完成結算=10 458 459 460 } 461 /// <summary> 462 /// 來源 463 /// </summary> 464 public enum enumORIGIN 465 { 466 自建 = 1, 467 任務 = 2, 468 外委申請 = 3 469 } 470 471 /// <summary> 472 /// 應急物資規格型號 473 /// </summary> 474 public enum enumReliefGoodsModel 475 { 476 規格型號1 = 1, 477 規格型號2 = 2, 478 規格型號3 = 3 479 } 480 /// <summary> 481 /// 應急搶險救援物資類別 482 /// </summary> 483 public enum enumReliefGoodsType 484 { 485 溢油 = 1, 486 防汛 = 2 487 } 488 /// <summary> 489 /// 業務咨詢枚舉,對應業務咨詢表的bptype字段 490 /// </summary> 491 public enum enumBptType 492 { 493 在線咨詢 = 401002, 494 身份證 = 501001, 495 戶籍 = 501002, 496 治安管理 = 501003, 497 出入境 = 501004, 498 消防 = 501005, 499 其他業務 = 501006, 500 交警 = 501007, 501 網安 = 501008, 502 法制 = 501009 503 } 504 505 public enum enumNewsType 506 { 507 警務信息 = 301001, 508 警方公告 = 301002, 509 防范提示 = 101501 510 } 511 512 /// <summary> 513 /// 上傳文件類型 514 /// </summary> 515 public enum enumBusType 516 { 517 518 車輛圖片上傳 = 100001, 519 套管圖片上傳 = 103002, 520 三通圖片上傳 = 103003, 521 閥門圖片上傳 = 103004, 522 占壓圖片上傳 = 103005, 523 524 525 } 526 527 528 /// <summary> 529 /// 管道維修應急預案級別 530 /// </summary> 531 public enum enumEmergencyPlanLevel 532 { 533 中石化 = 1, 534 油田 = 2, 535 總廠 = 3, 536 分廠 = 4 537 } 538 539 /// <summary> 540 /// 陽極材料 541 /// </summary> 542 public enum enumAnodeMaterial 543 { 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 其它 = 99 557 } 558 559 560 /// <summary> 561 /// 業務咨詢處理狀態枚舉,對應業務咨詢表的requesStatus字段 562 /// </summary> 563 public enum enumBussinessType 564 { 565 後台辦理本部門業務 = 1, 566 手機辦理本部門業務 = 2, 567 手機業務 = 3, 568 社區民警 = 4 569 } 570 571 /// <summary> 572 /// 業務咨詢處理狀態枚舉,對應業務咨詢表的requesStatus字段 573 /// </summary> 574 public enum enumRequesStatus 575 { 576 用戶提交 = 0, 577 指定處理 = 1, 578 處理完成 = 2 579 } 580 581 public enum enumWorkType 582 { 583 未指定 = -1, 584 手機方式 = 0, 585 電腦Web = 1 586 } 587 public enum enumIsBool 588 { 589 是 = 1, 590 否 = 2 591 } 592 593 public enum enumPhoneUserType 594 { 595 注冊用戶 = 1, 596 匿名用戶 = 2 597 } 598 599 public enum enumReplyType 600 { 601 未處理 = 0, 602 審核通過 = 1, 603 審核不通過 = 2 604 } 605 606 public enum enumBlogType 607 { 608 新浪微博 = 0, 609 騰訊微博 = 1, 610 東營公安局的騰訊微博 = 2 611 } 612 613 614 #endregion 615 616 } View Code

 原創文章 轉載請尊重勞動成果 http://yuangang.cnblogs.com

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved