AppExceptions.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace MTWorkHR.Core.Global
  7. {
  8. public static class AppExceptions
  9. {
  10. public static IDictionary<ExceptionEnum, Dictionary<string, string>> ExceptionMessages = new Dictionary<ExceptionEnum, Dictionary<string, string>>()
  11. {
  12. {ExceptionEnum.RecordNotExist, new Dictionary<string, string>
  13. {
  14. { "en", "Record Not Existed" },
  15. { "ar", "السجل غير موجود" }
  16. }},
  17. {ExceptionEnum.ModelNotValid, new Dictionary<string, string>
  18. {
  19. { "en", "Model is not valid" },
  20. { "ar", "النموذج غير صالح" }
  21. }},
  22. {ExceptionEnum.NotAuthorized, new Dictionary<string, string>
  23. {
  24. { "en", "Not Authorized" },
  25. { "ar", "غير مصرح" }
  26. }},
  27. {ExceptionEnum.PropertyNotAccess, new Dictionary<string, string>
  28. {
  29. { "en", "A property called {0} can't be accessed for type {1}." },
  30. { "ar", "الخاصية {0} لا يمكن الوصول إليها لنوع {1}." }
  31. } },
  32. {ExceptionEnum.WrongCredentials, new Dictionary<string, string>
  33. {
  34. { "en", "Username or password incorrect!" },
  35. { "ar", "اسم المستخدم أو كلمة المرور غير صحيحة!" }
  36. }},
  37. {ExceptionEnum.RecordCannotBeDelete, new Dictionary<string, string>
  38. {
  39. { "en", "Cannot delete the user" },
  40. { "ar", "لا يمكن حذف المستخدم" }
  41. }},
  42. {ExceptionEnum.RecordAlreadyExist, new Dictionary<string, string>
  43. {
  44. { "en", "Record is already existed!" },
  45. { "ar", "السجل موجود بالفعل!" }
  46. } },
  47. {ExceptionEnum.RecordCreationFailed, new Dictionary<string, string>
  48. {
  49. { "en", "Record creation failed! Please check the record details and try again." },
  50. { "ar", "خطأ اثناء الإضافة برجاء مراجعة البيانات" }
  51. } },
  52. {ExceptionEnum.RecordUpdateFailed, new Dictionary<string, string>
  53. {
  54. { "en", "Record update failed! Please check the record details and try again."},
  55. { "ar", "خطأ اثناء التعديل برجاء مراجعة البيانات" }
  56. } },
  57. {ExceptionEnum.RecordDeleteFailed, new Dictionary<string, string>
  58. {
  59. { "en", "Record delete failed!"},
  60. { "ar", "خطأ اثناء الحذف" }
  61. } },
  62. {ExceptionEnum.RecordNameAlreadyExist, new Dictionary<string, string>
  63. {
  64. { "en", "Record name already existed"},
  65. { "ar", "الاسم موجود مسبقا" }
  66. } },
  67. {ExceptionEnum.RecordEmailAlreadyExist, new Dictionary<string, string>
  68. {
  69. { "en", "Record email already existed"},
  70. { "ar", "البريد الإلكتروني موجود مسبقا" }
  71. } },
  72. {ExceptionEnum.AttachmentsRequired, new Dictionary<string, string>
  73. {
  74. { "en", "Attachment Required"},
  75. { "ar", "المرفقات مطلوبة" }
  76. } },
  77. {ExceptionEnum.CouldNotMoveFiles, new Dictionary<string, string>
  78. {
  79. { "en", "Could Not Move Files"},
  80. { "ar", "لا يمكن نقل الملفات" }
  81. } },
  82. {ExceptionEnum.MapperIssue, new Dictionary<string, string>
  83. {
  84. { "en", "Mapper Issue"},
  85. { "ar", "مشكلة فى المطابقة" }
  86. } },
  87. {ExceptionEnum.InCorrectFileLength, new Dictionary<string, string>
  88. {
  89. { "en", "InCorrect File Length"},
  90. { "ar", "حجم الملف غير مسموح به" }
  91. } },
  92. {ExceptionEnum.WrongOTP, new Dictionary<string, string>
  93. {
  94. { "en", "Wrong or expired OTP" },
  95. { "ar", "كلمة السر المؤقتة غير صحيحة او منتهية الصلاحية" }
  96. } },
  97. {ExceptionEnum.EmptyResponse, new Dictionary<string, string>
  98. {
  99. { "en", "Empty Response" },
  100. { "ar", "رد فارغ" }
  101. } },
  102. {ExceptionEnum.ErrorSendingSMS, new Dictionary<string, string>
  103. {
  104. { "en", "Error Sending SMS"},
  105. { "ar", "خطأ في ارسال الرسالة النصية" }
  106. } },
  107. {ExceptionEnum.InvalidCaptcha, new Dictionary<string, string>
  108. {
  109. { "en", "Invalid Captcha" },
  110. { "ar", "رمز خاطىء" }
  111. } },
  112. {ExceptionEnum.AccountLocked, new Dictionary<string, string>
  113. {
  114. { "en", "Account Locked"},
  115. { "ar", "الحساب موقوف" }
  116. } },
  117. {ExceptionEnum.InvalidFileType, new Dictionary<string, string>
  118. {
  119. { "en", "Invalid File Type" },
  120. { "ar", "نوع الملف خطأ" }
  121. } },
  122. {ExceptionEnum.NoVacationBalance, new Dictionary<string, string>
  123. {
  124. { "en", "No Vacation Balance" },
  125. { "ar", "لا يوجد رصيد أجازات" }
  126. } },
  127. {ExceptionEnum.EmailNotExist, new Dictionary<string, string>
  128. {
  129. { "en", "Email Not Exist" },
  130. { "ar", "البريد الالكتروني غير موجود" }
  131. } },
  132. {ExceptionEnum.RecordPhoneAlreadyExist, new Dictionary<string, string>
  133. {
  134. { "en", "Phone Already Exist" },
  135. { "ar", "رقم الهاتف موجود مسبقا" }
  136. } },
  137. {ExceptionEnum.UserNotExist, new Dictionary<string, string>
  138. {
  139. { "en", "User Not Exist" },
  140. { "ar", "المستخدم غير موجود" }
  141. } },
  142. {ExceptionEnum.UserAlreadyCheckedIn, new Dictionary<string, string>
  143. {
  144. { "en", "User already checked in"},
  145. { "ar", "تم تسجيل الحضور اليوم من قبل" }
  146. } },
  147. };
  148. }
  149. }