ErrorHelper.cs
8.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Web;
namespace AIAHTML5.API.Constants
{
/// <summary>
/// This class is used to provide error description. This class contain
/// different type of error code and its description.
/// </summary>
public class ErrorHelper
{
private static ErrorHelper _instance;
private Hashtable objHash = new Hashtable();
/* error Id Const */
public const Int16 E_NO_ERROR = 0;
public const Int16 E_USER_NOT_EXIST = 1;
public const Int16 E_PASSWORD_NOT_MATCH = 2;
public const Int16 E_USER_ID_BLOCKED_24_HRS = 3;
public const Int16 E_USER_NOT_ACTIVE = 4;
public const Int16 E_USER_ID_WILL_BLOCKED = 5;
public const Int16 E_EMAIL_ID_NOT_EXIT = 6;
public const Int16 E_LICENCE_IS_INACTIVE = 7;
public const Int16 E_USER_NOT_MAP_TO_LICENCE_EDITION = 8;
public const Int16 E_NO_ROW_FOUND_LICENCE_TO_EDITION_TABLE = 9;
public const Int16 E_NO_ROW_FOUND_LICENCE_TABLE = 10;
public const Int16 E_SECURITY_QUEST_NOT_MATCH = 11;
public const Int16 E_SEQURITY_ANSWER_NOT_MATCH = 12;
public const Int16 E_FORGOT_USER_ID_EMAIL_ID_NOT_EXIT = 13;
public const Int16 E_TOTAL_NUMBER_LOGIN_EXCEED = 14;
public const Int16 E_FORGOT_PASSWORD_EMAIL_ID_NOT_EXIST = 15;
public const Int16 E_TEST_SETUP_ACCOUNT_USER_NAME_EXIST = 16;
public const Int16 E_TEST_SETUP_ACCOUNT_EMAILID_EXIST = 17;
public const Int16 E_SP_ERROR = 18;
public const Int16 E_ACCOUNT_NUMBER_NOT_EXIST = 19;
public const Int16 E_ACCOUNT_NUMBER_ALREADY_EXIST = 20;
public const Int16 E_TEST_ACCOUNT_CREATED_MAIL_COULD_NOT_SENT = 21;
public const Int16 E_MAIL_COULD_NOT_SENT = 22;
public const Int16 E_RESELLER_ACCOUNT_CREATED_MAIL_COULD_NOT_SENT = 23;
public const Int16 E_LICENSE_TERM_CONDITION = 24;
public const Int16 E_EDITION_NOT_LINKED_WITH_SITE = 25;
public const Int16 E_LOGIN_SESSION_EXPIRE = 26;
public const Int16 E_DISCOUNT_CODE_NOT_EXIST = 27;
public const Int16 E_DISCOUNT_CODE_ALREADY_EXIST = 28;
public const Int16 E_SITE_IP_NOT_NULL = 29;
public const Int16 E_EDITION_ID_NOT_NULL = 30;
public const Int16 E_MASTER_SITEIP_NOT_EXIST = 31;
public const Int16 EDITION_ID_NOT_EXIST = 32;
public const Int16 E_ERROR_LOG = 33;
public const Int16 E_MASTER_SITE_ALREADY_EXIST = 34;
public const Int16 E_ACCOUNT_NUMBER_NOT_NULL = 35;
public const Int16 E_SITE_IP_ALREADY_EXIST = 36;
public const Int16 E_LICENCE_IS_EXPIRED = 37;
public const Int16 E_SINGLEACCOUNT_IS_BEING_USED = 38;
public const Int16 E_DATA_BASE_CONNECTION = 4060;
//login failure error constant
public const int ACCOUNT_NUMBER_NOT_NULL = 4;
public const int EDITION_ID_NOT_NULL = 5;
public const int ACCOUNT_NUMBER_NOT_EXIST = 1;
public const int EDITION_NOT_EXIST = 3;
public const int MASTER_SITEIP_NOT_EXIST = 2;
public const int LICENSE_INACTIVE = 6;
/// <summary>
/// constructor
/// </summary>
private ErrorHelper()
{
objHash.Add(E_NO_ERROR, "No Error.");
objHash.Add(E_USER_NOT_EXIST, "Invalid User ID.");
objHash.Add(E_PASSWORD_NOT_MATCH, "Invalid Password. User ID and password will be disabled if your password is entered incorrectly for five consecutive attempts. If you have forgotten your password, please click on the forgot password link. ");
objHash.Add(E_USER_ID_BLOCKED_24_HRS, "User Id is blocked.");
objHash.Add(E_USER_NOT_ACTIVE, "User Id is Inactive.");
objHash.Add(E_USER_ID_WILL_BLOCKED, "Invalid Password. Your login will be blocked for a day if you enter wrong password one more time. Click on forgot password link if you have forgotten your password. ");
objHash.Add(E_EMAIL_ID_NOT_EXIT, "Invalid e-mail ID. If you do not know your correct e-mail ID please contact A.D.A.M. technical support at techsupport@adamcorp.com or your institution's site administrator. ");
objHash.Add(E_LICENCE_IS_INACTIVE, "Your Licence Is inactive.");
objHash.Add(E_USER_NOT_MAP_TO_LICENCE_EDITION, "User is not mapped with licence edition.");
objHash.Add(E_NO_ROW_FOUND_LICENCE_TO_EDITION_TABLE, "No row found in Licence to edition table.");
objHash.Add(E_NO_ROW_FOUND_LICENCE_TABLE, "No row found in Licence table.");
objHash.Add(E_SECURITY_QUEST_NOT_MATCH, "Your security question is incorrect. ");
objHash.Add(E_SEQURITY_ANSWER_NOT_MATCH, "Your answer is incorrect. ");
objHash.Add(E_FORGOT_USER_ID_EMAIL_ID_NOT_EXIT, "Invalid e-mail ID. If you do not know your correct e-mail ID please contact A.D.A.M. technical support at {0} or your institution's site administrator. ");
//objHash.Add(E_TOTAL_NUMBER_LOGIN_EXCEED, "User ID and password has been accessed by another user. Your session is currently timed out.");
objHash.Add(E_TOTAL_NUMBER_LOGIN_EXCEED, "Currently all licenses are in use. Any account that improperly logged out should automatically reset within 5 minutes.");
objHash.Add(E_FORGOT_PASSWORD_EMAIL_ID_NOT_EXIST, "Invalid e-mail ID. Please be sure to enter the e-mail ID used when you registered your license. ");
objHash.Add(E_TEST_SETUP_ACCOUNT_USER_NAME_EXIST, "User Name already exist in system.");
objHash.Add(E_TEST_SETUP_ACCOUNT_EMAILID_EXIST, "Email Id already exist system.");
objHash.Add(E_SP_ERROR, "Error occured in store procedure.");
objHash.Add(E_ACCOUNT_NUMBER_NOT_EXIST, "Account Number does not exist in the system. ");
objHash.Add(E_ACCOUNT_NUMBER_ALREADY_EXIST, "Account Number already exist in the system.");
objHash.Add(E_TEST_ACCOUNT_CREATED_MAIL_COULD_NOT_SENT, "Test account has been created. Account number is: {0}. Mail could not be sent due to some mail server error. ");
objHash.Add(E_MAIL_COULD_NOT_SENT, "Mail could not sent due to some mail server error.");
objHash.Add(E_RESELLER_ACCOUNT_CREATED_MAIL_COULD_NOT_SENT, "Licenses Have been created. Mail could not be sent due to some mail server error. ");
objHash.Add(E_LICENSE_TERM_CONDITION, "Your license is not enabled yet. Please contact your administrator to accept the term & condition.");
objHash.Add(E_EDITION_NOT_LINKED_WITH_SITE, "Your credentials are invalid. Please contact the site administrator of your institution or contact A.D.A.M. technical support at techsupport@adamcorp.com. ");
objHash.Add(E_LOGIN_SESSION_EXPIRE, "Your session has expired. Please log in.");
objHash.Add(E_DISCOUNT_CODE_NOT_EXIST, "Discount code not exist in the system.");
objHash.Add(E_DISCOUNT_CODE_ALREADY_EXIST, "Discount code already exist in the system.");
objHash.Add(E_SITE_IP_NOT_NULL, "SiteIP cannot be null.");
objHash.Add(E_DATA_BASE_CONNECTION, "Could not connect to Database.");
objHash.Add(E_EDITION_ID_NOT_NULL, "Edition Id cannot be zero.");
objHash.Add(E_MASTER_SITEIP_NOT_EXIST, "Master Site IP does not exist in the system.");
objHash.Add(EDITION_ID_NOT_EXIST, "Edition ID does not exist in the system.");
objHash.Add(E_ERROR_LOG, "Problem in database.");
objHash.Add(E_MASTER_SITE_ALREADY_EXIST, "Account already created from this URL.");
objHash.Add(E_ACCOUNT_NUMBER_NOT_NULL, "Account number cannot be null.");
objHash.Add(E_SITE_IP_ALREADY_EXIST, "Site IP already exist.");
objHash.Add(E_LICENCE_IS_EXPIRED, "Your licence is expired since {licenseExpirationDate}.");
objHash.Add(E_SINGLEACCOUNT_IS_BEING_USED, "This account is currently locked due to improper logout or another active browser session. The account should automatically reset within 5 minutes.");
}
/// <summary>
/// This method checks if instance of ErrorHelper class is exist then it returns
/// the exist instance else it creates the ErrorHelper class instance and return it.
/// </summary>
/// <returns>ErrorHelper instance</returns>
public static ErrorHelper GetInstance()
{
if (_instance == null)
{
_instance = new ErrorHelper();
}
return _instance;
}
}
}