Commit 44d149c54dd06d53165504e3d74c501af5c72215
Merge branch 'Develop' of http://52.6.196.163/ADAM/AIAHTML5 into ListManagerIntegration
Showing
54 changed files
with
1362 additions
and
230 deletions
150-DOCUMENTATION/002-DBScripts/AddSlugColumnInResourceModuleTable.sql
0 → 100644
1 | +USE AIADATABASEV5LIVE | |
2 | +ALTER TABLE ResourceModule | |
3 | + ADD Slug varchar(100); | |
4 | + | |
5 | +UPDATE ResourceModule SET SLUG= 'da-view-list' WHERE ID=1 | |
6 | +UPDATE ResourceModule SET SLUG= 'tile-view-list' WHERE ID=2 | |
7 | +UPDATE ResourceModule SET SLUG= '3d-anatomy-list' WHERE ID=3 | |
8 | +UPDATE ResourceModule SET SLUG= 'clinical-illustrations' WHERE ID=4 | |
9 | +UPDATE ResourceModule SET SLUG= 'clinical-animations' WHERE ID=5 | |
10 | +UPDATE ResourceModule SET SLUG= 'Link/encyclopedia' WHERE ID=6 | |
11 | +UPDATE ResourceModule SET SLUG= 'curriculum-builder' WHERE ID=7 | |
12 | +UPDATE ResourceModule SET SLUG= 'anatomy-test' WHERE ID=8 | |
13 | +UPDATE ResourceModule SET SLUG= 'Link/IP-10' WHERE ID=9 | |
14 | +UPDATE ResourceModule SET SLUG= 'lab-exercises' WHERE ID=10 | |
15 | +UPDATE ResourceModule SET SLUG= 'Link/indepth-reports' WHERE ID=11 | |
16 | +UPDATE ResourceModule SET SLUG= 'Link/complementary-and-alternate-medicine' WHERE ID=12 | |
17 | +UPDATE ResourceModule SET SLUG= 'ADAM-images' WHERE ID=13 | |
18 | +UPDATE ResourceModule SET SLUG= 'Link/bodyguide' WHERE ID=14 | |
19 | +UPDATE ResourceModule SET SLUG= 'Link/health-navigator' WHERE ID=15 | |
20 | +UPDATE ResourceModule SET SLUG= 'Link/wellness-tools' WHERE ID=16 | |
21 | +UPDATE ResourceModule SET SLUG= 'Link/aod' WHERE ID=1017 | ... | ... |
150-DOCUMENTATION/002-DBScripts/GetAllModuleStatusWithSlug.sql
0 → 100644
1 | +-- ============================================= | |
2 | +-- Author: <Author,,Name> | |
3 | +-- Create date: <Create Date,,> | |
4 | +-- Description: <Description,,> | |
5 | +-- ============================================= | |
6 | +CREATE PROCEDURE [dbo].[GetAllModuleStatusWithSlug] | |
7 | + -- Add the parameters for the stored procedure here | |
8 | + | |
9 | +AS | |
10 | +BEGIN | |
11 | + IF 1=0 BEGIN | |
12 | + SET FMTONLY OFF | |
13 | + END | |
14 | + -- SET NOCOUNT ON added to prevent extra result sets from | |
15 | + -- interfering with SELECT statements. | |
16 | + SET NOCOUNT ON; | |
17 | + | |
18 | + -- Insert statements for procedure here | |
19 | + SELECT ResourceModule.Id,ResourceModule.Title AS Name, ResourceModule.Slug | |
20 | + FROM ResourceModule | |
21 | +END | |
0 | 22 | \ No newline at end of file | ... | ... |
150-DOCUMENTATION/002-DBScripts/GetLicenseDetailsById.sql
0 → 100644
1 | +-- ================================================ | |
2 | +-- Template generated from Template Explorer using: | |
3 | +-- Create Procedure (New Menu).SQL | |
4 | +-- | |
5 | +-- Use the Specify Values for Template Parameters | |
6 | +-- command (Ctrl-Shift-M) to fill in the parameter | |
7 | +-- values below. | |
8 | +-- | |
9 | +-- This block of comments will not be included in | |
10 | +-- the definition of the procedure. | |
11 | +-- ================================================ | |
12 | +SET ANSI_NULLS ON | |
13 | +GO | |
14 | +SET QUOTED_IDENTIFIER ON | |
15 | +GO | |
16 | +-- ============================================= | |
17 | +-- Author: <Utkarsh Singh> | |
18 | +-- Create date: <7/17/2017> | |
19 | +-- Description: <Gets user license details based on user License Id> | |
20 | +-- ============================================= | |
21 | +CREATE PROCEDURE GetLicenseDetailsById | |
22 | + -- Add the parameters for the stored procedure here | |
23 | + @Id INT | |
24 | +AS | |
25 | +BEGIN | |
26 | + -- SET NOCOUNT ON added to prevent extra result sets from | |
27 | + -- interfering with SELECT statements. | |
28 | + SET NOCOUNT OFF; | |
29 | + | |
30 | + -- Insert statements for procedure here | |
31 | + SELECT Id, AccountNumber, LicenseeFirstName, LicenseeLastName, LicenseTypeId, InstitutionName, Address1, Address2, CountryId, StateId, City, Zip, Phone, | |
32 | + EmailId, TotalLogins, AccountTypeId, IsActive, IsDistrictSiteLicense, CreationDate, ModifiedDate, NoOfRenewals, IsTermsAccepted, ProductId --, '' as SiteIp, '' as SiteIpTo, '' as SiteMasterIpTo, 0 as IsMaster | |
33 | +FROM License | |
34 | +WHERE (Id = @id) | |
35 | +END | |
36 | +GO | |
0 | 37 | \ No newline at end of file | ... | ... |
150-DOCUMENTATION/002-DBScripts/GetLicenseSubscriptionDetails.sql
0 → 100644
1 | +-- ================================================ | |
2 | +-- Template generated from Template Explorer using: | |
3 | +-- Create Procedure (New Menu).SQL | |
4 | +-- | |
5 | +-- Use the Specify Values for Template Parameters | |
6 | +-- command (Ctrl-Shift-M) to fill in the parameter | |
7 | +-- values below. | |
8 | +-- | |
9 | +-- This block of comments will not be included in | |
10 | +-- the definition of the procedure. | |
11 | +-- ================================================ | |
12 | +SET ANSI_NULLS ON | |
13 | +GO | |
14 | +SET QUOTED_IDENTIFIER ON | |
15 | +GO | |
16 | +-- ============================================= | |
17 | +-- Author: <Utkarsh Singh> | |
18 | +-- Create date: <07/17/2017> | |
19 | +-- Description: <Returns LicenseSubscription Details based on LicenseId> | |
20 | +-- ============================================= | |
21 | +CREATE PROCEDURE GetSubscriptionDetailsByLicenseId | |
22 | + -- Add the parameters for the stored procedure here | |
23 | + @iLicenseId INT | |
24 | + | |
25 | +AS | |
26 | +BEGIN | |
27 | + -- SET NOCOUNT ON added to prevent extra result sets from | |
28 | + -- interfering with SELECT statements. | |
29 | + SET NOCOUNT OFF; | |
30 | + | |
31 | + -- Insert statements for procedure here | |
32 | + SELECT Id, LicenseId, SubscriptionPlanId, SubscriptionValidFrom, SubscriptionValidThrough, RenewalDate, PaymentMode, TotalAmount, AmountPaid, | |
33 | + AmountPending,NoofImages | |
34 | +FROM LicenseSubscriptionDetail | |
35 | +WHERE (LicenseId = @iLicenseId) | |
36 | +END | |
37 | +GO | |
0 | 38 | \ No newline at end of file | ... | ... |
150-DOCUMENTATION/002-DBScripts/GetUserDetailsByLoginIdandPassword.sql
0 → 100644
1 | +-- ================================================ | |
2 | +-- Template generated from Template Explorer using: | |
3 | +-- Create Procedure (New Menu).SQL | |
4 | +-- | |
5 | +-- Use the Specify Values for Template Parameters | |
6 | +-- command (Ctrl-Shift-M) to fill in the parameter | |
7 | +-- values below. | |
8 | +-- | |
9 | +-- This block of comments will not be included in | |
10 | +-- the definition of the procedure. | |
11 | +-- ================================================ | |
12 | +SET ANSI_NULLS ON | |
13 | +GO | |
14 | +SET QUOTED_IDENTIFIER ON | |
15 | +GO | |
16 | +-- ============================================= | |
17 | +-- Author: <Utkarsh Singh> | |
18 | +-- Create date: <07/18/2017> | |
19 | +-- Description: <Gets user details based on loginId and password> | |
20 | +-- ============================================= | |
21 | +CREATE PROCEDURE GetUserDetailsByLoginIdAndPassword | |
22 | + -- Add the parameters for the stored procedure here | |
23 | + @sLoginId VARCHAR(50), | |
24 | + @sPassword VARCHAR(50) | |
25 | +AS | |
26 | +BEGIN | |
27 | + -- SET NOCOUNT ON added to prevent extra result sets from | |
28 | + -- interfering with SELECT statements. | |
29 | + SET NOCOUNT OFF; | |
30 | + | |
31 | + -- Insert statements for procedure here | |
32 | + SELECT CreationDate, CreatorId, DeactivationDate, EmailId, FirstName, Id, IsActive, LastName, LoginId, ModifiedDate, ModifierId, Password, SecurityAnswer, SecurityQuestionId, UserTypeId FROM AIAUser WHERE (LoginId = @sLoginId) AND (Password = @sPassword) | |
33 | +END | |
34 | +GO | |
0 | 35 | \ No newline at end of file | ... | ... |
150-DOCUMENTATION/002-DBScripts/GetUserInfoByEmailId.sql
0 → 100644
1 | +-- ================================================ | |
2 | +-- Template generated from Template Explorer using: | |
3 | +-- Create Procedure (New Menu).SQL | |
4 | +-- | |
5 | +-- Use the Specify Values for Template Parameters | |
6 | +-- command (Ctrl-Shift-M) to fill in the parameter | |
7 | +-- values below. | |
8 | +-- | |
9 | +-- This block of comments will not be included in | |
10 | +-- the definition of the procedure. | |
11 | +-- ================================================ | |
12 | +SET ANSI_NULLS ON | |
13 | +GO | |
14 | +SET QUOTED_IDENTIFIER ON | |
15 | +GO | |
16 | +-- ============================================= | |
17 | +-- Author: <Author,,Name> | |
18 | +-- Create date: <Create Date,,> | |
19 | +-- Description: <Description,,> | |
20 | +-- ============================================= | |
21 | +CREATE PROCEDURE GetUserInfoByEmailId | |
22 | + -- Add the parameters for the stored procedure here | |
23 | + @sEmailId VARCHAR(100) | |
24 | +AS | |
25 | +BEGIN | |
26 | + -- SET NOCOUNT ON added to prevent extra result sets from | |
27 | + -- interfering with SELECT statements. | |
28 | + SET NOCOUNT ON; | |
29 | + | |
30 | + -- Insert statements for procedure here | |
31 | + SELECT CreationDate, CreatorId, DeactivationDate, EmailId, FirstName, Id, IsActive, LastName, LoginId, ModifiedDate, ModifierId, Password, SecurityAnswer, SecurityQuestionId, UserTypeId FROM AIAUser WHERE EmailId = @sEmailId | |
32 | +END | |
33 | +GO | |
0 | 34 | \ No newline at end of file | ... | ... |
150-DOCUMENTATION/002-DBScripts/UpdateUserPassord.sql
0 → 100644
1 | +-- ================================================ | |
2 | +-- Template generated from Template Explorer using: | |
3 | +-- Create Procedure (New Menu).SQL | |
4 | +-- | |
5 | +-- Use the Specify Values for Template Parameters | |
6 | +-- command (Ctrl-Shift-M) to fill in the parameter | |
7 | +-- values below. | |
8 | +-- | |
9 | +-- This block of comments will not be included in | |
10 | +-- the definition of the procedure. | |
11 | +-- ================================================ | |
12 | +SET ANSI_NULLS ON | |
13 | +GO | |
14 | +SET QUOTED_IDENTIFIER ON | |
15 | +GO | |
16 | +-- ============================================= | |
17 | +-- Author: <Author,,Name> | |
18 | +-- Create date: <Create Date,,> | |
19 | +-- Description: <Description,,> | |
20 | +-- ============================================= | |
21 | +CREATE PROCEDURE UpdateUserPassword | |
22 | + -- Add the parameters for the stored procedure here | |
23 | + @sLoginId VARCHAR(50), | |
24 | + @sEmailId VARCHAR(100), | |
25 | + @sNewPassword varchar(100) | |
26 | +AS | |
27 | +BEGIN | |
28 | + -- SET NOCOUNT ON added to prevent extra result sets from | |
29 | + -- interfering with SELECT statements. | |
30 | + SET NOCOUNT OFF; | |
31 | + | |
32 | + -- Insert statements for procedure here | |
33 | + UPDATE AIAUser SET Password= @sNewPassword WHERE LoginId= @sLoginId AND EmailId = @sEmailId | |
34 | +END | |
35 | +GO | |
0 | 36 | \ No newline at end of file | ... | ... |
150-DOCUMENTATION/Audit/100-PROJECTPLANNING/100-COMMUNICATION/startWork/FW RE AIA HTML5 Version.msg
0 → 100644
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/14Oct2016.csv renamed to 150-DOCUMENTATION/Audit/Sprints/14Oct2016.csv
150-DOCUMENTATION/Audit/Sprints/OND/20Dec2016.csv renamed to 150-DOCUMENTATION/Audit/Sprints/20Dec2016.csv
150-DOCUMENTATION/Audit/Sprints/OND/21Oct2016.csv renamed to 150-DOCUMENTATION/Audit/Sprints/21Oct2016.csv
150-DOCUMENTATION/Audit/Sprints/OND/25Nov2016.csv renamed to 150-DOCUMENTATION/Audit/Sprints/25Nov2016.csv
150-DOCUMENTATION/Audit/Sprints/OND/27Dec2016.csv renamed to 150-DOCUMENTATION/Audit/Sprints/27Dec2016.csv
150-DOCUMENTATION/Audit/Sprints/OND/28Dec2106.csv renamed to 150-DOCUMENTATION/Audit/Sprints/28Dec2106.csv
150-DOCUMENTATION/Audit/Sprints/OND/28Oct2016.csv renamed to 150-DOCUMENTATION/Audit/Sprints/28Oct2016.csv
150-DOCUMENTATION/Audit/Sprints/OND/2Dec2016.csv renamed to 150-DOCUMENTATION/Audit/Sprints/2Dec2016.csv
150-DOCUMENTATION/Audit/Sprints/OND/31Dec16.csv renamed to 150-DOCUMENTATION/Audit/Sprints/31Dec16.csv
150-DOCUMENTATION/Audit/Sprints/OND/7Oct2016.csv renamed to 150-DOCUMENTATION/Audit/Sprints/7Oct2016.csv
150-DOCUMENTATION/Audit/Sprints/OND/AIAHTML5-MatrixCollection(OND).xlsx renamed to 150-DOCUMENTATION/Audit/Sprints/AIAHTML5-MatrixCollection(OND).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Estimation/Ebix-Estimation Model_Health_Dev-Product Sprint 34(17-April-17).xlsx renamed to 150-DOCUMENTATION/Audit/Sprints/AMJ/Ebix-Estimation Model_Health_Dev-Product Sprint 34(17-April-17).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 25(28-Dec-16).xlsx renamed to 150-DOCUMENTATION/Audit/Sprints/AMJ/Ebix-Estimation Model_Health_Dev-Product Sprint 35-17-May-17.xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/AMJ/Ebix-Estimation Model_Health_Dev-Product Sprint 36-16-June-17.xlsx
0 → 100644
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/CoveredSprints.txt renamed to 150-DOCUMENTATION/Audit/Sprints/CoveredSprints.txt
150-DOCUMENTATION/Audit/Sprints/Ebix-Estimation Model_Health_Dev-Product Sprint 27(13-Jan-17).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/Ebix-Estimation Model_Health_Dev-Product Sprint 27(3-March-17).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/Ebix-Estimation Model_Health_Dev-Product Sprint 31(20-Feb-17).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/Ebix-Estimation Model_Health_Dev-Product Sprint 32(03-March-17).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/Ebix-Estimation Model_Health_Dev-Product Sprint 33(30-March-17).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 14(7-October-16).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 15(14-October-16).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 16(21-October-16).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 17(28-October-16).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 21(25-Nov-16).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 22(02-Dec-16).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 23(27-Dec-16).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 24(31-Dec-16).xlsx
No preview for this file type
150-DOCUMENTATION/Audit/Sprints/OND/Ebix-Estimation Model_Health_Dev-Product Sprint 26(20-Dec-16).xlsx
No preview for this file type
400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj
... | ... | @@ -113,6 +113,8 @@ |
113 | 113 | <Compile Include="Global.asax.cs"> |
114 | 114 | <DependentUpon>Global.asax</DependentUpon> |
115 | 115 | </Compile> |
116 | + <Compile Include="Models\DBModel.cs" /> | |
117 | + <Compile Include="Models\User.cs" /> | |
116 | 118 | <Compile Include="Models\UserUtility.cs" /> |
117 | 119 | <Compile Include="Models\Users.cs" /> |
118 | 120 | <Compile Include="Properties\AssemblyInfo.cs" /> | ... | ... |
400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs
... | ... | @@ -7,11 +7,19 @@ namespace AIAHTML5.API.Constants |
7 | 7 | { |
8 | 8 | public class AIAConstants |
9 | 9 | { |
10 | - public const string ERROR_IN_FECTHING_DETAILS = "Error in fecthing details."; | |
11 | - public const string USER_NOT_FOUND = "User not found."; | |
12 | - public const string MAIL_NOT_SENT = "Mail not sent."; | |
13 | - public const string MAIL_SENT = "Mail sent."; | |
10 | + public const string ERROR_IN_FECTHING_DETAILS = "Error in fecthing details."; | |
11 | + public const string USER_NOT_FOUND = "User not found."; | |
12 | + public const string MAIL_NOT_SENT = "Mail not sent."; | |
13 | + public const string MAIL_SENT = "Mail sent."; | |
14 | 14 | |
15 | - | |
15 | + public const string KEY_ID = "id"; | |
16 | + public const string KEY_TITLE = "title"; | |
17 | + public const string KEY_NAME = "name"; | |
18 | + public const string KEY_SLUG = "slug"; | |
19 | + | |
20 | + public const string PASSWORD_UPDATE_SUCCESS = "Password updated successfully"; | |
21 | + public const string PASSWORD_UPDATE_FAILED = "Password update failed"; | |
22 | + | |
23 | + public const string INVALID_USER = "Invalid UserID"; | |
16 | 24 | } |
17 | 25 | } |
18 | 26 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... | ... | @@ -27,24 +27,24 @@ namespace AIAHTML5.API.Controllers |
27 | 27 | |
28 | 28 | // POST api/authenticate |
29 | 29 | public HttpResponseMessage Post([FromBody]JObject credentials) |
30 | - | |
31 | 30 | { |
32 | 31 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
33 | 32 | logger.Debug("inside POST"); |
34 | 33 | |
35 | 34 | bool isUserAuthenticatedByDefault = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["isUserAuthenticated"]); |
36 | - if (isUserAuthenticatedByDefault) { | |
35 | + if (isUserAuthenticatedByDefault) | |
36 | + { | |
37 | 37 | return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent("true") }; |
38 | - | |
38 | + | |
39 | 39 | } |
40 | 40 | else |
41 | 41 | { |
42 | 42 | |
43 | - dynamic authenticationRepsonse = AIAHTML5.API.Models.Users.AuthenticateUser(credentials); | |
43 | + dynamic authenticationRepsonse = AIAHTML5.API.Models.Users.GetUserDetailsForAuthenticatedUser(credentials); | |
44 | 44 | if (Convert.ToString(authenticationRepsonse) != AIAConstants.USER_NOT_FOUND && Convert.ToString(authenticationRepsonse) != AIAConstants.ERROR_IN_FECTHING_DETAILS) |
45 | 45 | { |
46 | - string userDetails = Newtonsoft.Json.JsonConvert.SerializeObject(authenticationRepsonse); | |
47 | - return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userDetails) }; | |
46 | + //string userDetails = Newtonsoft.Json.JsonConvert.SerializeObject(authenticationRepsonse); | |
47 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(authenticationRepsonse) }; | |
48 | 48 | } |
49 | 49 | else |
50 | 50 | { |
... | ... | @@ -64,4 +64,4 @@ namespace AIAHTML5.API.Controllers |
64 | 64 | { |
65 | 65 | } |
66 | 66 | } |
67 | -} | |
67 | +} | |
68 | 68 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/ForgotUserController.cs
1 | -using System; | |
2 | -using System.Collections.Generic; | |
3 | -using System.Linq; | |
4 | -using System.Net; | |
5 | -using System.Net.Http; | |
6 | -using System.Web.Http; | |
7 | -using AIAHTML5.API.Constants; | |
8 | -using log4net; | |
9 | -using Newtonsoft.Json; | |
10 | -using Newtonsoft.Json.Linq; | |
11 | -using AIAHTML5.API.Models; | |
12 | -using AIAHTML5.API.Utility; | |
13 | - | |
14 | -namespace AIAHTML5.API.Controllers | |
15 | -{ | |
16 | - public class ForgotUserController : ApiController | |
17 | - { | |
18 | - // GET api/<controller> | |
19 | - public IEnumerable<string> Get() | |
20 | - { | |
21 | - return new string[] { "value1", "value2" }; | |
22 | - } | |
23 | - | |
24 | - // GET api/<controller>/5 | |
25 | - public string Get(int id) | |
26 | - { | |
27 | - return "value"; | |
28 | - } | |
29 | - | |
30 | - // POST api/<controller> | |
31 | - //public void Post([FromBody]string value) | |
32 | - //{ | |
33 | - //} | |
34 | - public HttpResponseMessage Post([FromBody]JObject userInfo) | |
35 | - { | |
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Net; | |
5 | +using System.Net.Http; | |
6 | +using System.Web.Http; | |
7 | +using AIAHTML5.API.Constants; | |
8 | +using log4net; | |
9 | +using Newtonsoft.Json; | |
10 | +using Newtonsoft.Json.Linq; | |
11 | +using AIAHTML5.API.Models; | |
12 | +using AIAHTML5.API.Utility; | |
13 | + | |
14 | +namespace AIAHTML5.API.Controllers | |
15 | +{ | |
16 | + public class ForgotUserController : ApiController | |
17 | + { | |
18 | + // GET api/<controller> | |
19 | + public IEnumerable<string> Get() | |
20 | + { | |
21 | + return new string[] { "value1", "value2" }; | |
22 | + } | |
23 | + | |
24 | + // GET api/<controller>/5 | |
25 | + public string Get(int id) | |
26 | + { | |
27 | + return "value"; | |
28 | + } | |
29 | + | |
30 | + // POST api/<controller> | |
31 | + //public void Post([FromBody]string value) | |
32 | + //{ | |
33 | + //} | |
34 | + //public HttpResponseMessage Post([FromBody]JObject userInfo) | |
35 | + //{ | |
36 | + // ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); | |
37 | + // logger.Debug("inside POST in ForgotUserController for emailId = " + userInfo["emailId"]); | |
38 | + | |
39 | + // dynamic userData = AIAHTML5.API.Models.Users.GetUserByEmail(userInfo); | |
40 | + // if (Convert.ToString(userData) != AIAConstants.USER_NOT_FOUND && Convert.ToString(userData) != AIAConstants.ERROR_IN_FECTHING_DETAILS) | |
41 | + // { | |
42 | + // //logger.Debug("inside if in ForgotUserController userData.loginId= " + userData.LoginId); | |
43 | + // bool isMailSent = false; | |
44 | + // string userDetails = Newtonsoft.Json.JsonConvert.SerializeObject(userData); | |
45 | + | |
46 | + // logger.Debug("1. inside if in ForgotUserController userDetails= " + userDetails); | |
47 | + | |
48 | + // if (Convert.ToBoolean(userInfo["havePassword"])) | |
49 | + // { | |
50 | + // logger.Debug("2. havePassword= " + Convert.ToBoolean(userInfo["havePassword"])); | |
51 | + | |
52 | + // isMailSent = AIAHTML5.API.Models.UserUtility.SendEmail(userData, Convert.ToBoolean(userInfo["havePassword"])); | |
53 | + // } | |
54 | + // else | |
55 | + // { | |
56 | + // logger.Debug("3. havePassword= " + Convert.ToBoolean(userInfo["havePassword"])); | |
57 | + | |
58 | + // isMailSent = AIAHTML5.API.Models.UserUtility.SendEmail(userData, Convert.ToBoolean(userInfo["havePassword"])); | |
59 | + // } | |
60 | + // logger.Debug("isMailSent= " + isMailSent); | |
61 | + // if (isMailSent) | |
62 | + // return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userDetails) }; | |
63 | + // else | |
64 | + // return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.MAIL_NOT_SENT)}; | |
65 | + // } | |
66 | + // else | |
67 | + // { | |
68 | + // logger.Debug("inside else in ForgotUserController userData= " + userData); | |
69 | + // return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userData)}; | |
70 | + // } | |
71 | + //} | |
72 | + | |
73 | + public HttpResponseMessage Post([FromBody]JObject userInfo) | |
74 | + { | |
36 | 75 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
37 | - logger.Debug("inside POST in ForgotUserController for emailId = " + userInfo["emailId"]); | |
38 | - | |
39 | - dynamic userData = AIAHTML5.API.Models.Users.GetUserByEmail(userInfo); | |
40 | - if (Convert.ToString(userData) != AIAConstants.USER_NOT_FOUND && Convert.ToString(userData) != AIAConstants.ERROR_IN_FECTHING_DETAILS) | |
76 | + logger.Debug("inside POST in ForgotUserController for emailId = " + userInfo["emailId"]); | |
77 | + | |
78 | + User userData = AIAHTML5.API.Models.Users.GetUserByEmail(userInfo); | |
79 | + if (Convert.ToString(userData) != AIAConstants.USER_NOT_FOUND && Convert.ToString(userData) != AIAConstants.ERROR_IN_FECTHING_DETAILS) | |
41 | 80 | { |
42 | - logger.Debug("inside if in ForgotUserController userData.loginId= " + userData.loginId); | |
43 | - bool isMailSent = false; | |
44 | - string userDetails = Newtonsoft.Json.JsonConvert.SerializeObject(userData); | |
45 | - | |
46 | - logger.Debug("1. inside if in ForgotUserController userDetails= " + userDetails); | |
81 | + //logger.Debug("inside if in ForgotUserController userData.loginId= " + userData.LoginId); | |
82 | + bool isMailSent = false; | |
83 | + | |
84 | + logger.Debug("1. inside if in ForgotUserController userDetails= " + userData.ToString()); | |
47 | 85 | |
48 | 86 | if (Convert.ToBoolean(userInfo["havePassword"])) |
49 | 87 | { |
... | ... | @@ -57,28 +95,27 @@ namespace AIAHTML5.API.Controllers |
57 | 95 | |
58 | 96 | isMailSent = AIAHTML5.API.Models.UserUtility.SendEmail(userData, Convert.ToBoolean(userInfo["havePassword"])); |
59 | 97 | } |
60 | - logger.Debug("isMailSent= " + isMailSent); | |
61 | - if (isMailSent) | |
62 | - return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userDetails) }; | |
63 | - else | |
64 | - return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.MAIL_NOT_SENT)}; | |
65 | - } | |
66 | - else | |
98 | + logger.Debug("isMailSent= " + isMailSent); | |
99 | + if (isMailSent) | |
100 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userData.ToString()) }; | |
101 | + else | |
102 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.MAIL_NOT_SENT) }; | |
103 | + } | |
104 | + else | |
67 | 105 | { |
68 | - logger.Debug("inside else in ForgotUserController userData= " + userData); | |
69 | - return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userData)}; //new StringContent(userData) | |
70 | - | |
71 | - } | |
72 | - } | |
73 | - | |
74 | - // PUT api/<controller>/5 | |
75 | - public void Put(int id, [FromBody]string value) | |
76 | - { | |
77 | - } | |
78 | - | |
79 | - // DELETE api/<controller>/5 | |
80 | - public void Delete(int id) | |
81 | - { | |
82 | - } | |
83 | - } | |
106 | + logger.Debug("inside else in ForgotUserController userData= " + userData); | |
107 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userData.ToString()) }; | |
108 | + } | |
109 | + } | |
110 | + | |
111 | + // PUT api/<controller>/5 | |
112 | + public void Put(int id, [FromBody]string value) | |
113 | + { | |
114 | + } | |
115 | + | |
116 | + // DELETE api/<controller>/5 | |
117 | + public void Delete(int id) | |
118 | + { | |
119 | + } | |
120 | + } | |
84 | 121 | } |
85 | 122 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/ResetPasswordController.cs
... | ... | @@ -35,29 +35,24 @@ namespace AIAHTML5.API.Controllers |
35 | 35 | { |
36 | 36 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
37 | 37 | logger.Debug("inside POST"); |
38 | - dynamic userData = AIAHTML5.API.Models.Users.GetUserByEmail(userInfo); | |
38 | + User userData = AIAHTML5.API.Models.Users.GetUserByEmail(userInfo); | |
39 | + HttpResponseMessage response = null; | |
39 | 40 | if (Convert.ToString(userData) != AIAConstants.USER_NOT_FOUND && Convert.ToString(userData) != AIAConstants.ERROR_IN_FECTHING_DETAILS) |
40 | 41 | { |
41 | - dynamic updatedInfo; | |
42 | - string upInfo; | |
42 | + int result = 0; | |
43 | 43 | if (!String.IsNullOrEmpty(userInfo["newPassword"].ToString())) |
44 | 44 | { |
45 | - updatedInfo = AIAHTML5.API.Models.Users.UpdatePassword(userInfo); | |
46 | - upInfo = Newtonsoft.Json.JsonConvert.SerializeObject(updatedInfo); | |
47 | - if (!string.IsNullOrEmpty(Convert.ToString(updatedInfo))) | |
48 | - return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(upInfo) }; | |
45 | + result = AIAHTML5.API.Models.Users.UpdatePassword(userInfo, userData.LoginId, userData.EmailId); | |
46 | + if (result > 0) | |
47 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.PASSWORD_UPDATE_SUCCESS) }; | |
49 | 48 | else |
50 | - return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(userData) }; | |
49 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.PASSWORD_UPDATE_FAILED) }; | |
51 | 50 | } |
52 | - else | |
53 | - return new HttpResponseMessage { StatusCode = HttpStatusCode.BadRequest, Content = new StringContent("Nothing to update") }; | |
54 | - } | |
55 | - else | |
56 | - { | |
57 | - return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userData) }; | |
58 | 51 | } |
52 | + | |
53 | + return response; | |
59 | 54 | } |
60 | - | |
55 | + | |
61 | 56 | // PUT api/<controller>/5 |
62 | 57 | public void Put(int id, [FromBody]string value) |
63 | 58 | { | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.Linq; | |
4 | +using System.Web; | |
5 | +using AIAHTML5.API.Properties; | |
6 | +using AIAHTML5.API.Constants; | |
7 | +using log4net; | |
8 | +using System.Data; | |
9 | +using System.Data.SqlClient; | |
10 | +using Newtonsoft.Json; | |
11 | +using System.Collections; | |
12 | + | |
13 | +namespace AIAHTML5.API.Models | |
14 | +{ | |
15 | + public class DBModel | |
16 | + { | |
17 | + static string dbConnectionString = System.Configuration.ConfigurationManager.AppSettings["AIADatabaseV5Context"]; | |
18 | + | |
19 | + static SqlConnection conn; | |
20 | + static SqlCommand cmd; | |
21 | + | |
22 | + | |
23 | + public DBModel() { } | |
24 | + | |
25 | + public static void OpenConnection() | |
26 | + { | |
27 | + SqlConnection conn = new SqlConnection(dbConnectionString); | |
28 | + | |
29 | + if (conn.State == ConnectionState.Closed) | |
30 | + conn.Open(); | |
31 | + } | |
32 | + | |
33 | + protected static DataSet GetSQLData(string commandText, bool isSp) | |
34 | + { | |
35 | + conn = new SqlConnection(dbConnectionString); | |
36 | + if (isSp) | |
37 | + { | |
38 | + cmd = new SqlCommand(commandText, conn); | |
39 | + cmd.CommandType = CommandType.StoredProcedure; | |
40 | + } | |
41 | + else | |
42 | + { | |
43 | + cmd = new SqlCommand(commandText, conn); | |
44 | + } | |
45 | + SqlDataAdapter da = new SqlDataAdapter(); | |
46 | + da.SelectCommand = cmd; | |
47 | + DataSet ds = new DataSet(); | |
48 | + da.Fill(ds); | |
49 | + return ds; | |
50 | + } | |
51 | + | |
52 | + protected ArrayList GetUserModules() | |
53 | + { | |
54 | + ArrayList arrUserModules = new ArrayList(); | |
55 | + Hashtable userModuleHash = null; | |
56 | + userModuleHash = new Hashtable(); | |
57 | + | |
58 | + string sp = "GetAllModuleStatusWithSlug"; | |
59 | + | |
60 | + DataSet ds = DBModel.GetSQLData(sp, true); | |
61 | + DataTable dt = ds.Tables[0]; | |
62 | + | |
63 | + foreach (DataRow drActType in dt.Rows) | |
64 | + { | |
65 | + userModuleHash = new Hashtable(); | |
66 | + userModuleHash.Add(AIAConstants.KEY_NAME, drActType["Name"]); | |
67 | + userModuleHash.Add(AIAConstants.KEY_SLUG, drActType["Slug"]); | |
68 | + arrUserModules.Add(userModuleHash); | |
69 | + } | |
70 | + return arrUserModules; | |
71 | + } | |
72 | + | |
73 | + public static dynamic GetUserDetailsByLoginIdAndPassword(string loginId, string password) | |
74 | + { | |
75 | + User objUser = new User(); | |
76 | + DBModel objModel = new DBModel(); | |
77 | + | |
78 | + conn = new SqlConnection(dbConnectionString); | |
79 | + cmd = new SqlCommand(); | |
80 | + SqlDataAdapter da = new SqlDataAdapter(); | |
81 | + SqlParameter param; | |
82 | + DataSet ds = new DataSet(); | |
83 | + | |
84 | + cmd.Connection = conn; | |
85 | + cmd.CommandText = "GetUserDetailsByLoginIdAndPassword"; | |
86 | + cmd.CommandType = CommandType.StoredProcedure; | |
87 | + | |
88 | + param = new SqlParameter("@sLoginId", loginId); | |
89 | + param.Direction = ParameterDirection.Input; | |
90 | + param.DbType = DbType.String; | |
91 | + cmd.Parameters.Add(param); | |
92 | + | |
93 | + param = new SqlParameter("@sPassword", password); | |
94 | + param.Direction = ParameterDirection.Input; | |
95 | + param.DbType = DbType.String; | |
96 | + cmd.Parameters.Add(param); | |
97 | + | |
98 | + da.SelectCommand = cmd; | |
99 | + DataTable dt = new DataTable(); | |
100 | + da.Fill(dt); | |
101 | + | |
102 | + if (dt.Rows.Count > 0) | |
103 | + { | |
104 | + foreach (DataRow dr in dt.Rows) | |
105 | + { | |
106 | + foreach (DataColumn dc in dt.Columns) | |
107 | + { | |
108 | + if (dc.ColumnName == "Id") | |
109 | + objUser.Id = Convert.ToInt32(dr[dc]); | |
110 | + if (dc.ColumnName == "FirstName") | |
111 | + objUser.FirstName = dr[dc].ToString(); | |
112 | + if (dc.ColumnName == "LastName") | |
113 | + objUser.LastName = dr[dc].ToString(); | |
114 | + if (dc.ColumnName == "EmailId") | |
115 | + objUser.EmailId = dr[dc].ToString(); | |
116 | + if (dc.ColumnName == "LoginId") | |
117 | + objUser.LoginId = dr[dc].ToString(); | |
118 | + if (dc.ColumnName == "Password") | |
119 | + objUser.Password = dr[dc].ToString(); | |
120 | + if (dc.ColumnName == "SecurityQuestionId") | |
121 | + { | |
122 | + int tempVal; | |
123 | + objUser.SecurityQuestionId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
124 | + } | |
125 | + if (dc.ColumnName == "SecurityAnswer") | |
126 | + objUser.SecurityAnswer = dr[dc].ToString(); | |
127 | + if (dc.ColumnName == "CreatorId") | |
128 | + { | |
129 | + int tempVal; | |
130 | + objUser.CreatorId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
131 | + } | |
132 | + if (dc.ColumnName == "CreationDate") | |
133 | + objUser.CreationDate = Convert.ToDateTime(dr[dc]); | |
134 | + if (dc.ColumnName == "DeactivationDate") | |
135 | + { | |
136 | + DateTime? date; | |
137 | + if (dr[dc] == DBNull.Value) | |
138 | + date = null; | |
139 | + else | |
140 | + date = (DateTime)dr[dc]; | |
141 | + | |
142 | + objUser.DeactivationDate = date; | |
143 | + } | |
144 | + if (dc.ColumnName == "ModifierId") | |
145 | + { | |
146 | + int tempVal; | |
147 | + objUser.ModifierId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
148 | + } | |
149 | + if (dc.ColumnName == "ModifiedDate") | |
150 | + { | |
151 | + DateTime? date; | |
152 | + if (dr[dc] == DBNull.Value) | |
153 | + date = null; | |
154 | + else | |
155 | + date = (DateTime)dr[dc]; | |
156 | + | |
157 | + objUser.ModifiedDate = date; | |
158 | + } | |
159 | + if (dc.ColumnName == "UserTypeId") | |
160 | + objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); | |
161 | + if (dc.ColumnName == "IsActive") | |
162 | + objUser.IsActive = Convert.ToBoolean(dr[dc]); | |
163 | + | |
164 | + } | |
165 | + } | |
166 | + } | |
167 | + | |
168 | + else | |
169 | + { | |
170 | + objUser = null; | |
171 | + } | |
172 | + | |
173 | + if (objUser != null) | |
174 | + { | |
175 | + | |
176 | + int licenseId = objModel.GetUserLicenseIdByUserId(objUser.Id); | |
177 | + if (licenseId != 0) | |
178 | + { | |
179 | + objUser.License = objModel.GetLicenseDetailsByLicenseId(licenseId); | |
180 | + objUser.LicenseSubscriptions = objModel.GetLicenseSubscriptionDetailsByLicenseId(licenseId); | |
181 | + } | |
182 | + else | |
183 | + { | |
184 | + objUser.License = null; | |
185 | + } | |
186 | + | |
187 | + if (objUser.UserType == User.SUPER_ADMIN || objUser.UserType == User.GENERAL_ADMIN) | |
188 | + { | |
189 | + objUser.Modules = objModel.GetUserModules(); | |
190 | + } | |
191 | + else | |
192 | + { | |
193 | + if (objUser.License != null) | |
194 | + { | |
195 | + if (objUser.LicenseSubscriptions != null) | |
196 | + { | |
197 | + DateTime? subscriptionValidThrough = objUser.LicenseSubscriptions.SubscriptionValidThrough; | |
198 | + if (subscriptionValidThrough != null && subscriptionValidThrough.Value.Date >= DateTime.Now.Date) | |
199 | + { | |
200 | + ArrayList allModulesList = objModel.GetUserModules(); | |
201 | + ArrayList licensedModulesList = objModel.GetModuleStatusByLicenseId(licenseId); | |
202 | + | |
203 | + ArrayList userModuleList = objModel.GetUserModulesList(allModulesList, licensedModulesList); | |
204 | + objUser.Modules = userModuleList; | |
205 | + } | |
206 | + else | |
207 | + { | |
208 | + objUser.IsSubscriptionExpired = true; | |
209 | + objUser.SubscriptionExpirationDateString = objUser.LicenseSubscriptions.SubscriptionValidThrough.Value.Date.ToString("MM/dd/yyyy").ToString(); | |
210 | + } | |
211 | + } | |
212 | + } | |
213 | + } | |
214 | + } | |
215 | + | |
216 | + return objUser; | |
217 | + } | |
218 | + | |
219 | + protected int GetUserLicenseIdByUserId(int userId) | |
220 | + { | |
221 | + int _licenseId = 0; | |
222 | + conn = new SqlConnection(dbConnectionString); | |
223 | + cmd = new SqlCommand(); | |
224 | + SqlDataAdapter adapter; | |
225 | + SqlParameter param; | |
226 | + DataSet ds = new DataSet(); | |
227 | + | |
228 | + cmd.Connection = conn; | |
229 | + cmd.CommandText = "GetLicenseIdByUserId"; | |
230 | + cmd.CommandType = CommandType.StoredProcedure; | |
231 | + | |
232 | + param = new SqlParameter("@iUserId", userId); | |
233 | + param.Direction = ParameterDirection.Input; | |
234 | + param.DbType = DbType.Int32; | |
235 | + cmd.Parameters.Add(param); | |
236 | + | |
237 | + adapter = new SqlDataAdapter(cmd); | |
238 | + adapter.Fill(ds); | |
239 | + if (ds.Tables[0].Rows.Count > 0) | |
240 | + _licenseId = Convert.ToInt32(ds.Tables[0].Rows[0][0]); | |
241 | + return _licenseId; | |
242 | + } | |
243 | + | |
244 | + protected ArrayList GetModuleStatusByLicenseId(int licenseId) | |
245 | + { | |
246 | + ArrayList userModulelist = new ArrayList(); | |
247 | + Hashtable modulesHash; | |
248 | + DataSet ds = new DataSet(); | |
249 | + | |
250 | + conn = new SqlConnection(dbConnectionString); | |
251 | + cmd = new SqlCommand(); | |
252 | + SqlDataAdapter adapter; | |
253 | + SqlParameter param; | |
254 | + | |
255 | + cmd.Connection = conn; | |
256 | + cmd.CommandText = "GetModuleStatusByLicenseId"; | |
257 | + cmd.CommandType = CommandType.StoredProcedure; | |
258 | + | |
259 | + param = new SqlParameter("@iLicenseId", licenseId); | |
260 | + param.Direction = ParameterDirection.Input; | |
261 | + param.DbType = DbType.Int32; | |
262 | + cmd.Parameters.Add(param); | |
263 | + | |
264 | + adapter = new SqlDataAdapter(cmd); | |
265 | + adapter.Fill(ds); | |
266 | + DataTable dt = ds.Tables[0]; | |
267 | + | |
268 | + foreach (DataRow dr in dt.Rows) | |
269 | + { | |
270 | + modulesHash = new Hashtable(); | |
271 | + modulesHash.Add("Id", dr["Id"]); | |
272 | + modulesHash.Add("Title", dr["Title"]); | |
273 | + modulesHash.Add("Status", dr["Status"]); | |
274 | + userModulelist.Add(modulesHash); | |
275 | + } | |
276 | + | |
277 | + return userModulelist; | |
278 | + } | |
279 | + | |
280 | + protected ArrayList GetUserModulesList(ArrayList allModules, ArrayList modulesByLicense) | |
281 | + { | |
282 | + ArrayList userModules = new ArrayList(); | |
283 | + Hashtable moduleHash; | |
284 | + foreach (Hashtable module in allModules) | |
285 | + { | |
286 | + foreach (Hashtable userModule in modulesByLicense) | |
287 | + { | |
288 | + if ((userModule["Title"].ToString().Trim() == module["name"].ToString().Trim()) && (Convert.ToBoolean(userModule["Status"]) == true)) | |
289 | + { | |
290 | + moduleHash = new Hashtable(); | |
291 | + moduleHash.Add("name", userModule["Title"]); | |
292 | + moduleHash.Add("slug", module["slug"]); | |
293 | + | |
294 | + userModules.Add(moduleHash); | |
295 | + } | |
296 | + } | |
297 | + } | |
298 | + | |
299 | + return userModules; | |
300 | + } | |
301 | + | |
302 | + protected string GetUserTypeStringById(int userTypeId) | |
303 | + { | |
304 | + string userType = string.Empty; | |
305 | + | |
306 | + switch (userTypeId) | |
307 | + { | |
308 | + case 1: | |
309 | + userType = User.SUPER_ADMIN; | |
310 | + break; | |
311 | + case 2: | |
312 | + userType = User.GENERAL_ADMIN; | |
313 | + break; | |
314 | + case 3: | |
315 | + userType = User.DISTRICT_ADMIN; | |
316 | + break; | |
317 | + case 4: | |
318 | + userType = User.CLIENT_ADMIN; | |
319 | + break; | |
320 | + case 5: | |
321 | + userType = User.SINGLE_USER; | |
322 | + break; | |
323 | + case 6: | |
324 | + userType = User.CONCURRENT_USER; | |
325 | + break; | |
326 | + case 7: | |
327 | + userType = User.RESELLER; | |
328 | + break; | |
329 | + case 8: | |
330 | + userType = User.TEST_ACCOUNT; | |
331 | + break; | |
332 | + case 9: | |
333 | + userType = User.SITE_USER; | |
334 | + break; | |
335 | + } | |
336 | + return userType; | |
337 | + } | |
338 | + | |
339 | + public static User GetUserDetailsByEmailId(string emailId) | |
340 | + { | |
341 | + User objUser = new User(); | |
342 | + DBModel objModel = new DBModel(); | |
343 | + | |
344 | + try | |
345 | + { | |
346 | + conn = new SqlConnection(dbConnectionString); | |
347 | + cmd = new SqlCommand(); | |
348 | + SqlDataAdapter adapter; | |
349 | + SqlParameter param; | |
350 | + DataSet ds = new DataSet(); | |
351 | + | |
352 | + cmd.Connection = conn; | |
353 | + cmd.CommandText = "GetUserInfoByEmailId"; | |
354 | + cmd.CommandType = CommandType.StoredProcedure; | |
355 | + | |
356 | + param = new SqlParameter("@sEmailId", emailId); | |
357 | + param.Direction = ParameterDirection.Input; | |
358 | + param.DbType = DbType.String; | |
359 | + cmd.Parameters.Add(param); | |
360 | + | |
361 | + adapter = new SqlDataAdapter(cmd); | |
362 | + adapter.Fill(ds); | |
363 | + DataTable dt = ds.Tables[0]; | |
364 | + | |
365 | + foreach (DataRow dr in dt.Rows) | |
366 | + { | |
367 | + foreach (DataColumn dc in dt.Columns) | |
368 | + { | |
369 | + if (dc.ColumnName == "Id") | |
370 | + objUser.Id = Convert.ToInt32(dr[dc]); | |
371 | + if (dc.ColumnName == "FirstName") | |
372 | + objUser.FirstName = dr[dc].ToString(); | |
373 | + if (dc.ColumnName == "LastName") | |
374 | + objUser.LastName = dr[dc].ToString(); | |
375 | + if (dc.ColumnName == "EmailId") | |
376 | + objUser.EmailId = dr[dc].ToString(); | |
377 | + if (dc.ColumnName == "LoginId") | |
378 | + objUser.LoginId = dr[dc].ToString(); | |
379 | + if (dc.ColumnName == "Password") | |
380 | + objUser.Password = dr[dc].ToString(); | |
381 | + if (dc.ColumnName == "SecurityQuestionId") | |
382 | + { | |
383 | + int tempVal; | |
384 | + objUser.SecurityQuestionId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
385 | + } | |
386 | + if (dc.ColumnName == "SecurityAnswer") | |
387 | + objUser.SecurityAnswer = dr[dc].ToString(); | |
388 | + if (dc.ColumnName == "CreatorId") | |
389 | + { | |
390 | + int tempVal; | |
391 | + objUser.CreatorId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
392 | + } | |
393 | + if (dc.ColumnName == "CreationDate") | |
394 | + objUser.CreationDate = Convert.ToDateTime(dr[dc]); | |
395 | + if (dc.ColumnName == "DeactivationDate") | |
396 | + { | |
397 | + DateTime? date; | |
398 | + if (dr[dc] == DBNull.Value) | |
399 | + date = null; | |
400 | + else | |
401 | + date = (DateTime)dr[dc]; | |
402 | + | |
403 | + objUser.DeactivationDate = date; | |
404 | + } | |
405 | + if (dc.ColumnName == "ModifierId") | |
406 | + { | |
407 | + int tempVal; | |
408 | + objUser.ModifierId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
409 | + } | |
410 | + if (dc.ColumnName == "ModifiedDate") | |
411 | + { | |
412 | + DateTime? date; | |
413 | + if (dr[dc] == DBNull.Value) | |
414 | + date = null; | |
415 | + else | |
416 | + date = (DateTime)dr[dc]; | |
417 | + | |
418 | + objUser.ModifiedDate = date; | |
419 | + } | |
420 | + if (dc.ColumnName == "UserTypeId") | |
421 | + objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr[dc])); | |
422 | + if (dc.ColumnName == "IsActive") | |
423 | + objUser.IsActive = Convert.ToBoolean(dr[dc]); | |
424 | + | |
425 | + } | |
426 | + } | |
427 | + } | |
428 | + catch (Exception ex) | |
429 | + { } | |
430 | + | |
431 | + return objUser; | |
432 | + } | |
433 | + | |
434 | + public static int UpdateUserPassword(dynamic userInfo, string loginId, string emailId) | |
435 | + { | |
436 | + int result = 0; | |
437 | + conn = new SqlConnection(dbConnectionString); | |
438 | + cmd = new SqlCommand(); | |
439 | + cmd.Connection = conn; | |
440 | + conn.Open(); | |
441 | + cmd.CommandText = "UpdateUserPassword"; | |
442 | + cmd.CommandType = CommandType.StoredProcedure; | |
443 | + cmd.Parameters.AddWithValue("@sLoginId", loginId); | |
444 | + cmd.Parameters.AddWithValue("@sEmailId", emailId); | |
445 | + cmd.Parameters.AddWithValue("@sNewPassword", userInfo["newPassword"].ToString()); | |
446 | + result = cmd.ExecuteNonQuery(); | |
447 | + conn.Close(); | |
448 | + return result; | |
449 | + } | |
450 | + | |
451 | + protected LicenseSubscriptionDetails GetLicenseSubscriptionDetailsByLicenseId(int licenseId) | |
452 | + { | |
453 | + LicenseSubscriptionDetails lsd = new LicenseSubscriptionDetails(); | |
454 | + try | |
455 | + { | |
456 | + conn = new SqlConnection(dbConnectionString); | |
457 | + cmd = new SqlCommand(); | |
458 | + SqlDataAdapter adapter; | |
459 | + SqlParameter param; | |
460 | + DataSet ds = new DataSet(); | |
461 | + | |
462 | + cmd.Connection = conn; | |
463 | + cmd.CommandText = "GetSubscriptionDetailsByLicenseId"; | |
464 | + cmd.CommandType = CommandType.StoredProcedure; | |
465 | + | |
466 | + param = new SqlParameter("@iLicenseId", licenseId); | |
467 | + param.Direction = ParameterDirection.Input; | |
468 | + param.DbType = DbType.Int32; | |
469 | + cmd.Parameters.Add(param); | |
470 | + | |
471 | + adapter = new SqlDataAdapter(cmd); | |
472 | + adapter.Fill(ds); | |
473 | + DataTable dt = ds.Tables[0]; | |
474 | + | |
475 | + foreach (DataRow dr in dt.Rows) | |
476 | + { | |
477 | + foreach (DataColumn dc in dt.Columns) | |
478 | + { | |
479 | + if (dc.ColumnName == "Id") | |
480 | + lsd.Id = Convert.ToInt32(dr[dc]); | |
481 | + if (dc.ColumnName == "LicenseId") | |
482 | + lsd.LicenseId = Convert.ToInt32(dr[dc]); | |
483 | + if (dc.ColumnName == "SubscriptionPlanId") | |
484 | + { | |
485 | + int tempVal; | |
486 | + lsd.SubscriptionPlanId = Int32.TryParse(dr[dc].ToString(), out tempVal) ? tempVal : (int?)null; | |
487 | + } | |
488 | + if (dc.ColumnName == "SubscriptionValidFrom") | |
489 | + { | |
490 | + DateTime? date; | |
491 | + if (dr[dc] == DBNull.Value) | |
492 | + date = null; | |
493 | + else | |
494 | + date = (DateTime)dr[dc]; | |
495 | + | |
496 | + lsd.SubscriptionValidFrom = date; | |
497 | + } | |
498 | + if (dc.ColumnName == "SubscriptionValidThrough") | |
499 | + { | |
500 | + DateTime? date; | |
501 | + if (dr[dc] == DBNull.Value) | |
502 | + date = null; | |
503 | + else | |
504 | + date = (DateTime)dr[dc]; | |
505 | + | |
506 | + lsd.SubscriptionValidThrough = date; | |
507 | + } | |
508 | + if (dc.ColumnName == "RenewelDate") | |
509 | + { | |
510 | + DateTime? date; | |
511 | + if (dr[dc] == DBNull.Value) | |
512 | + date = null; | |
513 | + else | |
514 | + date = (DateTime)dr[dc]; | |
515 | + | |
516 | + lsd.RenewalDate = date; | |
517 | + } | |
518 | + if (dc.ColumnName == "PaymentMode") | |
519 | + lsd.PaymentMode = dr[dc].ToString(); | |
520 | + if (dc.ColumnName == "TotalAmount") | |
521 | + lsd.TotalAmount = Convert.ToDouble(dr[dc]); | |
522 | + if (dc.ColumnName == "AmountPaid") | |
523 | + lsd.AmountPaid = Convert.ToDouble(dr[dc]); | |
524 | + if (dc.ColumnName == "AmountPending") | |
525 | + lsd.AmountPending = Convert.ToDouble(dr[dc]); | |
526 | + if (dc.ColumnName == "NoofImages") | |
527 | + lsd.NoOfImages = Convert.ToInt32(dr[dc]); | |
528 | + } | |
529 | + } | |
530 | + } | |
531 | + catch (Exception ex) | |
532 | + { | |
533 | + | |
534 | + } | |
535 | + | |
536 | + return lsd; | |
537 | + } | |
538 | + | |
539 | + protected License GetLicenseDetailsByLicenseId(int licenseId) | |
540 | + { | |
541 | + License lic = new License(); | |
542 | + try | |
543 | + { | |
544 | + conn = new SqlConnection(dbConnectionString); | |
545 | + cmd = new SqlCommand(); | |
546 | + SqlDataAdapter adapter; | |
547 | + SqlParameter param; | |
548 | + DataSet ds = new DataSet(); | |
549 | + | |
550 | + cmd.Connection = conn; | |
551 | + cmd.CommandText = "GetLicenseDetailsById"; | |
552 | + cmd.CommandType = CommandType.StoredProcedure; | |
553 | + | |
554 | + param = new SqlParameter("@Id", licenseId); | |
555 | + param.Direction = ParameterDirection.Input; | |
556 | + param.DbType = DbType.Int32; | |
557 | + cmd.Parameters.Add(param); | |
558 | + | |
559 | + adapter = new SqlDataAdapter(cmd); | |
560 | + adapter.Fill(ds); | |
561 | + DataTable dt = ds.Tables[0]; | |
562 | + | |
563 | + foreach (DataRow dr in dt.Rows) | |
564 | + { | |
565 | + foreach (DataColumn dc in dt.Columns) | |
566 | + { | |
567 | + if (dc.ColumnName == "Id") | |
568 | + lic.Id = Convert.ToInt32(dr[dc]); | |
569 | + if (dc.ColumnName == "AccountNumber") | |
570 | + lic.AccountNumber = dr[dc].ToString(); | |
571 | + if (dc.ColumnName == "LicenseeFirstName") | |
572 | + lic.LicenseeFirstName = dr[dc].ToString(); | |
573 | + if (dc.ColumnName == "LicenseeLastName") | |
574 | + lic.LicenseeLastName = dr[dc].ToString(); | |
575 | + if (dc.ColumnName == "LicenseTypeId") | |
576 | + lic.LicenseTypeId = Convert.ToInt32(dr[dc]); | |
577 | + if (dc.ColumnName == "InstitutionName") | |
578 | + lic.InstitutionName = dr[dc].ToString(); | |
579 | + if (dc.ColumnName == "Adress1") | |
580 | + lic.Address1 = dr[dc].ToString(); | |
581 | + if (dc.ColumnName == "Adress2") | |
582 | + lic.Address2 = dr[dc].ToString(); | |
583 | + if (dc.ColumnName == "CountryId") | |
584 | + lic.CountryId = Convert.ToInt32(dr[dc]); | |
585 | + if (dc.ColumnName == "StateId") | |
586 | + lic.StateId = Convert.ToInt32(dr[dc]); | |
587 | + if (dc.ColumnName == "City") | |
588 | + lic.City = dr[dc].ToString(); | |
589 | + if (dc.ColumnName == "Zip") | |
590 | + lic.Zip = dr[dc].ToString(); | |
591 | + if (dc.ColumnName == "Phone") | |
592 | + lic.Phone = dr[dc].ToString(); | |
593 | + if (dc.ColumnName == "EmailId") | |
594 | + lic.EmailId = dr[dc].ToString(); | |
595 | + if (dc.ColumnName == "TotalLogin") | |
596 | + lic.TotalLogins = Convert.ToInt32(dr[dc]); | |
597 | + if (dc.ColumnName == "AccountTypeId") | |
598 | + lic.AccountTypeId = Convert.ToInt32(dr[dc]); | |
599 | + if (dc.ColumnName == "IsActive") | |
600 | + lic.IsActive = Convert.ToBoolean(dr[dc]); | |
601 | + if (dc.ColumnName == "IsDistrictSiteLicense") | |
602 | + lic.IsDistrictSiteLicense = Convert.ToBoolean(dr[dc]); | |
603 | + if (dc.ColumnName == "CreationDate") | |
604 | + lic.CreationDate = Convert.ToDateTime(dr[dc]); | |
605 | + if (dc.ColumnName == "ModifiedDate") | |
606 | + { | |
607 | + DateTime? date; | |
608 | + if (dr[dc] == DBNull.Value) | |
609 | + date = null; | |
610 | + else | |
611 | + date = (DateTime)dr[dc]; | |
612 | + | |
613 | + lic.ModifiedDate = date; | |
614 | + } | |
615 | + if (dc.ColumnName == "NoOfRenewals") | |
616 | + lic.NoOfRenewals = Convert.ToInt32(dr[dc]); | |
617 | + if (dc.ColumnName == "IsTermAccepted") | |
618 | + lic.IsTermAccepted = Convert.ToBoolean(dr[dc]); | |
619 | + if (dc.ColumnName == "ProductId") | |
620 | + lic.ProductId = dr[dc].ToString(); | |
621 | + } | |
622 | + } | |
623 | + } | |
624 | + catch (Exception ex) | |
625 | + { | |
626 | + | |
627 | + } | |
628 | + | |
629 | + return lic; | |
630 | + } | |
631 | + } | |
632 | +} | |
0 | 633 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/User.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections; | |
3 | +using System.Collections.Generic; | |
4 | +using System.Linq; | |
5 | +using System.Web; | |
6 | + | |
7 | +namespace AIAHTML5.API.Models | |
8 | +{ | |
9 | + public class User | |
10 | + { | |
11 | + public int Id { get; set; } | |
12 | + public string FirstName { get; set; } | |
13 | + public string LastName { get; set; } | |
14 | + public string EmailId { get; set; } | |
15 | + public string LoginId { get; set; } | |
16 | + public string Password { get; set; } | |
17 | + public int? SecurityQuestionId { get; set; } | |
18 | + public string SecurityAnswer { get; set; } | |
19 | + public int? CreatorId { get; set; } | |
20 | + public DateTime CreationDate { get; set; } | |
21 | + public DateTime? DeactivationDate { get; set; } | |
22 | + public int? ModifierId { get; set; } | |
23 | + public DateTime? ModifiedDate { get; set; } | |
24 | + public string UserType { get; set; } | |
25 | + public bool IsActive { get; set; } | |
26 | + | |
27 | + public ArrayList Modules { get; set; } | |
28 | + | |
29 | + public License License { get; set; } | |
30 | + public LicenseSubscriptionDetails LicenseSubscriptions { get; set; } | |
31 | + public bool IsSubscriptionExpired { get; set; } | |
32 | + public string SubscriptionExpirationDateString { get; set; } | |
33 | + | |
34 | + public const string SUPER_ADMIN = "Super Admin"; | |
35 | + public const string GENERAL_ADMIN = "General Admin"; | |
36 | + public const string DISTRICT_ADMIN = "District Admin"; | |
37 | + public const string CLIENT_ADMIN = "Client Admin"; | |
38 | + public const string SINGLE_USER = "Single User"; | |
39 | + public const string CONCURRENT_USER = "Concurrent User"; | |
40 | + public const string RESELLER = "Reseller"; | |
41 | + public const string TEST_ACCOUNT = "Test Account"; | |
42 | + public const string SITE_USER = "Site User"; | |
43 | + } | |
44 | + | |
45 | + public class License | |
46 | + { | |
47 | + public int Id { get; set; } | |
48 | + public string AccountNumber { get; set; } | |
49 | + public string LicenseeFirstName { get; set; } | |
50 | + public string LicenseeLastName { get; set; } | |
51 | + public int LicenseTypeId { get; set; } | |
52 | + public string InstitutionName { get; set; } | |
53 | + public string Address1 { get; set; } | |
54 | + public string Address2 { get; set; } | |
55 | + public int CountryId { get; set; } | |
56 | + public int StateId { get; set; } | |
57 | + public string City { get; set; } | |
58 | + public string Zip { get; set; } | |
59 | + public string Phone { get; set; } | |
60 | + public string EmailId { get; set; } | |
61 | + public int TotalLogins { get; set; } | |
62 | + public int AccountTypeId { get; set; } | |
63 | + public bool IsActive { get; set; } | |
64 | + public bool IsDistrictSiteLicense { get; set; } | |
65 | + public DateTime CreationDate { get; set; } | |
66 | + public DateTime? ModifiedDate { get; set; } | |
67 | + public DateTime? CancellationDate { get; set; } | |
68 | + public int NoOfRenewals { get; set; } | |
69 | + public bool IsTermAccepted { get; set; } | |
70 | + public int CardNumber { get; set; } | |
71 | + public string ProductId { get; set; } | |
72 | + | |
73 | + | |
74 | + } | |
75 | + | |
76 | + public class LicenseSubscriptionDetails | |
77 | + { | |
78 | + public int Id { get; set; } | |
79 | + public int LicenseId { get; set; } | |
80 | + public int? SubscriptionPlanId { get; set; } | |
81 | + public DateTime? SubscriptionValidFrom { get; set; } | |
82 | + public DateTime? SubscriptionValidThrough { get; set; } | |
83 | + public DateTime? RenewalDate { get; set; } | |
84 | + public string PaymentMode { get; set; } | |
85 | + public double TotalAmount { get; set; } | |
86 | + public double AmountPaid { get; set; } | |
87 | + public double AmountPending { get; set; } | |
88 | + public int NoOfImages { get; set; } | |
89 | + } | |
90 | +} | |
0 | 91 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/UserUtility.cs
... | ... | @@ -22,7 +22,7 @@ namespace AIAHTML5.API.Models |
22 | 22 | { |
23 | 23 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
24 | 24 | logger.Debug("inside SendEmail in for havePassword =" + havePassword); |
25 | - | |
25 | + | |
26 | 26 | try |
27 | 27 | { |
28 | 28 | List<LinkedResource> lstLinkedResource = new List<LinkedResource>(); |
... | ... | @@ -38,23 +38,32 @@ namespace AIAHTML5.API.Models |
38 | 38 | string lName = string.Empty; |
39 | 39 | string site_url = Convert.ToString(ConfigurationManager.AppSettings["Site_URL"]); |
40 | 40 | |
41 | - foreach (KeyValuePair<string, object> userObj in UserDetails) | |
42 | - { | |
43 | - if (userObj.Key == "loginId") | |
44 | - userId = userObj.Value.ToString(); | |
41 | + //foreach (KeyValuePair<string, object> userObj in UserDetails) | |
42 | + //{ | |
43 | + // if (userObj.Key == "LoginId") | |
44 | + // userId = userObj.Value.ToString(); | |
45 | 45 | |
46 | - if (userObj.Key == "emailId") | |
47 | - userMail = userObj.Value.ToString(); | |
46 | + // if (userObj.Key == "EmailId") | |
47 | + // userMail = userObj.Value.ToString(); | |
48 | 48 | |
49 | - if (userObj.Key == "firstName") | |
50 | - fName = userObj.Value.ToString(); | |
49 | + // if (userObj.Key == "FirstName") | |
50 | + // fName = userObj.Value.ToString(); | |
51 | 51 | |
52 | - if (userObj.Key == "lastName") | |
53 | - lName = userObj.Value.ToString(); | |
54 | - } | |
52 | + // if (userObj.Key == "LastName") | |
53 | + // lName = userObj.Value.ToString(); | |
54 | + //} | |
55 | + | |
56 | + if (UserDetails.LoginId != "") | |
57 | + userId = UserDetails.LoginId.ToString(); | |
58 | + if (UserDetails.EmailId != "") | |
59 | + userMail = UserDetails.EmailId.ToString(); | |
60 | + if (UserDetails.FirstName != "") | |
61 | + fName = UserDetails.FirstName.ToString(); | |
62 | + if (UserDetails.LastName != "") | |
63 | + lName = UserDetails.LastName.ToString(); | |
55 | 64 | |
56 | 65 | string fullName = fName + " " + lName; |
57 | - | |
66 | + | |
58 | 67 | string logoPath = HttpContext.Current.Server.MapPath("~/content/images/logo.png"); |
59 | 68 | |
60 | 69 | string templatePath = string.Empty; |
... | ... | @@ -66,7 +75,7 @@ namespace AIAHTML5.API.Models |
66 | 75 | resetPasswordLink = site_url + "?em:" + HttpUtility.UrlEncode(userMail); |
67 | 76 | } |
68 | 77 | else |
69 | - templatePath = "~/Templates/forgot-UserId.html"; | |
78 | + templatePath = "~/Templates/forgot-UserId.html"; | |
70 | 79 | |
71 | 80 | logger.Debug("inside SendEmail for templatePath= " + templatePath + ", userId= " + userId + ", userMail= " + userMail + ",fullName= " + fullName + ",resetPasswordLink= " + resetPasswordLink); |
72 | 81 | string mailBody = UserUtility.GetMailBodyTextFromTemplate(templatePath, userId, userMail, fullName, resetPasswordLink); |
... | ... | @@ -97,7 +106,7 @@ namespace AIAHTML5.API.Models |
97 | 106 | mailSubject = "UserID recovery mail for: "; |
98 | 107 | else |
99 | 108 | mailSubject = "Password recovery mail for: "; |
100 | - | |
109 | + | |
101 | 110 | |
102 | 111 | emailUtility.sHostName = Convert.ToString(ConfigurationManager.AppSettings["HostAddress"]); |
103 | 112 | emailUtility.sFromAddress = Convert.ToString(ConfigurationManager.AppSettings["SenderEmailAddress"]); |
... | ... | @@ -122,11 +131,11 @@ namespace AIAHTML5.API.Models |
122 | 131 | { |
123 | 132 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
124 | 133 | logger.Debug("Inside GetMailBodyTextFromTemplate for templatePath= " + templatePath + ", userId= " + userId + ", userMail= " + userMail + ",fullName= " + fullName + ",resetPasswordLink= " + resetPasswordUrl); |
125 | - | |
134 | + | |
126 | 135 | string fileToRead = string.Empty; |
127 | 136 | string emailBody = string.Empty; |
128 | 137 | try |
129 | - { | |
138 | + { | |
130 | 139 | fileToRead = HttpContext.Current.Server.MapPath(templatePath); |
131 | 140 | |
132 | 141 | using (StreamReader reader = new StreamReader(fileToRead)) |
... | ... | @@ -134,13 +143,13 @@ namespace AIAHTML5.API.Models |
134 | 143 | emailBody = reader.ReadToEnd(); |
135 | 144 | } |
136 | 145 | |
137 | - if(!string.IsNullOrEmpty(userId)) | |
146 | + if (!string.IsNullOrEmpty(userId)) | |
138 | 147 | emailBody = emailBody.Replace("{loginId}", userId); |
139 | 148 | if (!string.IsNullOrEmpty(userMail)) |
140 | 149 | emailBody = emailBody.Replace("{emailId}", userMail); |
141 | - if(!string.IsNullOrEmpty(fullName)) | |
150 | + if (!string.IsNullOrEmpty(fullName)) | |
142 | 151 | emailBody = emailBody.Replace("{userFullName}", fullName); |
143 | - if(!string.IsNullOrEmpty(resetPasswordUrl)) | |
152 | + if (!string.IsNullOrEmpty(resetPasswordUrl)) | |
144 | 153 | emailBody = emailBody.Replace("{resetPasswordLink}", resetPasswordUrl); |
145 | 154 | } |
146 | 155 | catch (Exception e) |
... | ... | @@ -165,7 +174,7 @@ namespace AIAHTML5.API.Models |
165 | 174 | string userMail = string.Empty; |
166 | 175 | string fullName = string.Empty; |
167 | 176 | string emailMessage = string.Empty; |
168 | - | |
177 | + | |
169 | 178 | string[] mailToArr = (ConfigurationManager.AppSettings["AdminSupport"]).Split(','); |
170 | 179 | if (mailToArr.Length > 0) |
171 | 180 | { |
... | ... | @@ -180,7 +189,7 @@ namespace AIAHTML5.API.Models |
180 | 189 | emailMessage = userInfo["userMessage"].ToString(); |
181 | 190 | |
182 | 191 | lstToAddress.Add(userMail); |
183 | - | |
192 | + | |
184 | 193 | emailMessage = emailMessage.Replace("\n", "<br/>"); |
185 | 194 | |
186 | 195 | emailMessage += "<br/><br/>"; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... | ... | @@ -7,39 +7,55 @@ using MongoDB.Bson; |
7 | 7 | using AIAHTML5.API.Properties; |
8 | 8 | using AIAHTML5.API.Constants; |
9 | 9 | using log4net; |
10 | +using AIAHTML5.API.Models; | |
11 | +using Newtonsoft.Json; | |
10 | 12 | |
11 | 13 | namespace AIAHTML5.API.Models |
12 | 14 | { |
13 | 15 | public class Users |
14 | 16 | { |
15 | - | |
16 | - | |
17 | - internal static dynamic AuthenticateUser(Newtonsoft.Json.Linq.JObject credentials) | |
17 | + internal static dynamic GetUserDetailsForAuthenticatedUser(Newtonsoft.Json.Linq.JObject credentials) | |
18 | 18 | { |
19 | 19 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
20 | 20 | logger.Debug("inside AuthenticateUser for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString()); |
21 | + dynamic userDetails = null; | |
22 | + | |
21 | 23 | try |
22 | 24 | { |
23 | - var client = new MongoClient(); | |
24 | - var db = client.GetDatabase(Settings.Default.database); | |
25 | + //var client = new MongoClient(); | |
26 | + //var db = client.GetDatabase(Settings.Default.database); | |
27 | + | |
28 | + //var collection = db.GetCollection<dynamic>("Users"); | |
25 | 29 | |
26 | - var collection = db.GetCollection<dynamic>("Users"); | |
30 | + //FilterDefinition<dynamic>[] filterCondition = { Builders<dynamic>.Filter.Eq("loginId", credentials["username"].ToString()), | |
31 | + // Builders<dynamic>.Filter.Eq("password", credentials["password"].ToString())}; | |
27 | 32 | |
28 | - FilterDefinition<dynamic>[] filterCondition = { Builders<dynamic>.Filter.Eq("loginId", credentials["username"].ToString()), | |
29 | - Builders<dynamic>.Filter.Eq("password", credentials["password"].ToString())}; | |
33 | + //dynamic userDetails = collection.Find(Builders<dynamic>.Filter.And(filterCondition)).SingleOrDefault(); | |
30 | 34 | |
31 | - dynamic userDetails = collection.Find(Builders<dynamic>.Filter.And(filterCondition)).SingleOrDefault(); | |
32 | 35 | |
36 | + //if (userDetails != null) | |
37 | + //{ | |
38 | + // logger.Debug("userDetails.loginId= " + userDetails.loginId); | |
39 | + // return userDetails; | |
40 | + //} | |
41 | + //else | |
42 | + //{ | |
43 | + // return AIAConstants.USER_NOT_FOUND; | |
44 | + //} | |
45 | + User user = DBModel.GetUserDetailsByLoginIdAndPassword(credentials["username"].ToString(), credentials["password"].ToString()); | |
46 | + //string userDetails = DBModel.GetUserDetailsByLoginId2(credentials["username"].ToString()); | |
33 | 47 | |
34 | - if (userDetails != null) | |
48 | + if (user != null) | |
35 | 49 | { |
36 | - logger.Debug("userDetails.loginId= " + userDetails.loginId); | |
37 | - return userDetails; | |
50 | + logger.Debug("userDetails.loginId= " + user.LoginId); // .loginId); | |
51 | + | |
52 | + userDetails = JsonConvert.SerializeObject(user); | |
38 | 53 | } |
39 | 54 | else |
40 | 55 | { |
41 | - return AIAConstants.USER_NOT_FOUND; | |
56 | + userDetails = AIAConstants.USER_NOT_FOUND; | |
42 | 57 | } |
58 | + | |
43 | 59 | } |
44 | 60 | catch (Exception e) |
45 | 61 | { |
... | ... | @@ -47,58 +63,87 @@ namespace AIAHTML5.API.Models |
47 | 63 | logger.Fatal("Exception in AuthenticateUser for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message); |
48 | 64 | |
49 | 65 | string errorMessage = AIAConstants.ERROR_IN_FECTHING_DETAILS; |
50 | - return errorMessage; | |
66 | + userDetails = errorMessage; | |
51 | 67 | } |
52 | - | |
68 | + return userDetails; | |
53 | 69 | } |
54 | 70 | |
55 | 71 | internal static dynamic GetUserByEmail(Newtonsoft.Json.Linq.JObject userInfo) |
56 | 72 | { |
57 | 73 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
58 | - logger.Debug(" inside GetUserByEmail for emailId = " + userInfo["emailId"] ); | |
59 | - var client = new MongoClient(); | |
74 | + logger.Debug(" inside GetUserByEmail for emailId = " + userInfo["emailId"]); | |
75 | + //var client = new MongoClient(); | |
60 | 76 | |
61 | - try | |
62 | - { | |
77 | + //try | |
78 | + //{ | |
63 | 79 | |
64 | - var db = client.GetDatabase(Settings.Default.database); | |
80 | + // var db = client.GetDatabase(Settings.Default.database); | |
65 | 81 | |
66 | - var collection = db.GetCollection<dynamic>("Users"); | |
82 | + // var collection = db.GetCollection<dynamic>("Users"); | |
67 | 83 | |
68 | - FilterDefinition<dynamic> filterCondition = Builders<dynamic>.Filter.Eq("emailId", userInfo["emailId"].ToString().ToLower()); | |
84 | + // FilterDefinition<dynamic> filterCondition = Builders<dynamic>.Filter.Eq("emailId", userInfo["emailId"].ToString().ToLower()); | |
69 | 85 | |
70 | - dynamic userDetails = collection.Find(Builders<dynamic>.Filter.And(filterCondition)).SingleOrDefault(); | |
71 | - if (userDetails != null) | |
72 | - { | |
73 | - logger.Debug("userDetails= " + userDetails.loginId); | |
86 | + // dynamic userDetails = collection.Find(Builders<dynamic>.Filter.And(filterCondition)).SingleOrDefault(); | |
87 | + // if (userDetails != null) | |
88 | + // { | |
89 | + // logger.Debug("userDetails= " + userDetails.loginId); | |
90 | + | |
91 | + // return userDetails; | |
92 | + // } | |
93 | + // else | |
94 | + // { | |
95 | + // logger.Debug("user not found"); | |
96 | + // return AIAConstants.USER_NOT_FOUND; | |
97 | + // } | |
98 | + //} | |
99 | + //catch (Exception e) | |
100 | + //{ | |
101 | + // logger.Fatal("Exception= " + e.Message+", stacktrace = "+e.StackTrace); | |
102 | + // return AIAConstants.ERROR_IN_FECTHING_DETAILS; | |
103 | + //} | |
74 | 104 | |
75 | - return userDetails; | |
105 | + try | |
106 | + { | |
107 | + User objUser = DBModel.GetUserDetailsByEmailId(userInfo["emailId"].ToString()); | |
108 | + | |
109 | + //dynamic userDetails; | |
110 | + | |
111 | + if (objUser != null) | |
112 | + { | |
113 | + logger.Debug("userDetails.loginId= " + objUser.LoginId); | |
114 | + //return userDetails = JsonConvert.SerializeObject(objUser); | |
115 | + return objUser; | |
76 | 116 | } |
77 | 117 | else |
78 | 118 | { |
79 | - logger.Debug("user not found"); | |
80 | 119 | return AIAConstants.USER_NOT_FOUND; |
81 | 120 | } |
82 | 121 | } |
83 | - catch (Exception e) | |
122 | + catch (Exception ex) | |
84 | 123 | { |
85 | - logger.Fatal("Exception= " + e.Message+", stacktrace = "+e.StackTrace); | |
86 | - return AIAConstants.ERROR_IN_FECTHING_DETAILS; | |
124 | + logger.Fatal("Exception in Gettting UserDetailsByEmailId for EmailId =" + userInfo["emailId"].ToString() + " Exception= " + ex.Message); | |
125 | + | |
126 | + string errorMessage = AIAConstants.ERROR_IN_FECTHING_DETAILS; | |
127 | + return errorMessage; | |
87 | 128 | } |
129 | + | |
130 | + | |
88 | 131 | } |
89 | 132 | |
90 | - internal static dynamic UpdatePassword(Newtonsoft.Json.Linq.JObject userInfo) | |
133 | + internal static dynamic UpdatePassword(Newtonsoft.Json.Linq.JObject userInfo, string sLoginId, string sEmailId) | |
91 | 134 | { |
92 | 135 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
93 | - var client = new MongoClient(); | |
136 | + //var client = new MongoClient(); | |
94 | 137 | try |
95 | 138 | { |
96 | - var db = client.GetDatabase(Settings.Default.database); | |
97 | - var collection = db.GetCollection<BsonDocument>("Users"); | |
98 | - var filter = Builders<BsonDocument>.Filter.Eq("emailId", userInfo["emailId"].ToString()); | |
99 | - var update = Builders<BsonDocument>.Update.Set("password", userInfo["newPassword"].ToString()).CurrentDate("modifiedDate"); | |
100 | - | |
101 | - var result = collection.UpdateOne(filter, update); | |
139 | + //var db = client.GetDatabase(Settings.Default.database); | |
140 | + //var collection = db.GetCollection<BsonDocument>("Users"); | |
141 | + //var filter = Builders<BsonDocument>.Filter.Eq("emailId", userInfo["emailId"].ToString()); | |
142 | + //var update = Builders<BsonDocument>.Update.Set("password", userInfo["newPassword"].ToString()).CurrentDate("modifiedDate"); | |
143 | + | |
144 | + //var result = collection.UpdateOne(filter, update); | |
145 | + | |
146 | + int result = DBModel.UpdateUserPassword(userInfo, sLoginId, sEmailId); | |
102 | 147 | |
103 | 148 | if (result != null) |
104 | 149 | return result; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Web.config
... | ... | @@ -10,26 +10,26 @@ |
10 | 10 | <section name="AIAHTML5.API.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> |
11 | 11 | </sectionGroup> |
12 | 12 | </configSections> |
13 | - | |
14 | - <log4net debug="true"> | |
15 | -<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> | |
16 | - <file value="Logs\AIALogs.log" /> | |
17 | - <appendToFile value="true" /> | |
18 | - <rollingStyle value="Size" /> | |
19 | - <maxSizeRollBackups value="10" /> | |
20 | - <maximumFileSize value="10MB" /> | |
21 | - <staticLogFileName value="true" /> | |
22 | - <layout type="log4net.Layout.PatternLayout"> | |
23 | - <conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" /> | |
24 | - </layout> | |
25 | -</appender> | |
26 | 13 | |
27 | -<root> | |
28 | - <level value="DEBUG" /> | |
29 | - <appender-ref ref="RollingLogFileAppender" /> | |
30 | -</root> | |
31 | -</log4net> | |
32 | - | |
14 | + <log4net debug="true"> | |
15 | + <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> | |
16 | + <file value="Logs\AIALogs.log" /> | |
17 | + <appendToFile value="true" /> | |
18 | + <rollingStyle value="Size" /> | |
19 | + <maxSizeRollBackups value="10" /> | |
20 | + <maximumFileSize value="10MB" /> | |
21 | + <staticLogFileName value="true" /> | |
22 | + <layout type="log4net.Layout.PatternLayout"> | |
23 | + <conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" /> | |
24 | + </layout> | |
25 | + </appender> | |
26 | + | |
27 | + <root> | |
28 | + <level value="DEBUG" /> | |
29 | + <appender-ref ref="RollingLogFileAppender" /> | |
30 | + </root> | |
31 | + </log4net> | |
32 | + | |
33 | 33 | <appSettings> |
34 | 34 | <add key="SenderEmailAddress" value="support@interactiveanatomy.com" /> |
35 | 35 | <add key="ErrorNotificationEmailAddress" value="support@interactiveanatomy.com" /> |
... | ... | @@ -39,14 +39,17 @@ |
39 | 39 | <add key="EnableSSL" value="false" /> |
40 | 40 | <add key="Site_Url" value ="http://qa.beta.interactiveanatomy.com/"/> |
41 | 41 | <add key ="HostAddress" value="10.100.12.13" /> |
42 | - <add key="isUserAuthenticated" value="true"/> | |
42 | + <add key="isUserAuthenticated" value="false"/> | |
43 | 43 | <add key="AdminSupport" value="amrita.vishnoi@ebix.com,nikita.kulshreshtha@ebix.com"/> |
44 | - </appSettings> | |
44 | + <add key ="AIADatabaseV5Context" value="Data Source=192.168.90.53;Initial Catalog=AIADatabaseV5;User ID=AIA_Dev;Password=india123;"/> | |
45 | + <!--<add key ="AIADatabaseV5Context" value="Data Source=52.6.248.70;Initial Catalog=AIADatabase;User ID=amrita;Password=Ebix@2017;"/>--> | |
46 | + | |
47 | + </appSettings> | |
45 | 48 | <system.web> |
46 | 49 | <compilation debug="true" targetFramework="4.5" /> |
47 | 50 | <httpRuntime targetFramework="4.5" /> |
48 | 51 | </system.web> |
49 | - | |
52 | + | |
50 | 53 | <applicationSettings> |
51 | 54 | <AIAHTML5.API.Properties.Settings> |
52 | 55 | <setting name="AIAConnectionString" serializeAs="String"> |
... | ... | @@ -77,11 +80,12 @@ |
77 | 80 | </dependentAssembly> |
78 | 81 | </assemblyBinding> |
79 | 82 | </runtime> |
80 | -<system.webServer> | |
83 | + <system.webServer> | |
81 | 84 | <handlers> |
82 | 85 | <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> |
83 | 86 | <remove name="OPTIONSVerbHandler" /> |
84 | 87 | <remove name="TRACEVerbHandler" /> |
85 | 88 | <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> |
86 | 89 | </handlers> |
87 | - </system.webServer></configuration> | |
90 | + </system.webServer> | |
91 | +</configuration> | |
88 | 92 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll
No preview for this file type
400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll.config
... | ... | @@ -10,26 +10,26 @@ |
10 | 10 | <section name="AIAHTML5.API.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> |
11 | 11 | </sectionGroup> |
12 | 12 | </configSections> |
13 | - | |
14 | - <log4net debug="true"> | |
15 | -<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> | |
16 | - <file value="Logs\AIALogs.log" /> | |
17 | - <appendToFile value="true" /> | |
18 | - <rollingStyle value="Size" /> | |
19 | - <maxSizeRollBackups value="10" /> | |
20 | - <maximumFileSize value="10MB" /> | |
21 | - <staticLogFileName value="true" /> | |
22 | - <layout type="log4net.Layout.PatternLayout"> | |
23 | - <conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" /> | |
24 | - </layout> | |
25 | -</appender> | |
26 | 13 | |
27 | -<root> | |
28 | - <level value="DEBUG" /> | |
29 | - <appender-ref ref="RollingLogFileAppender" /> | |
30 | -</root> | |
31 | -</log4net> | |
32 | - | |
14 | + <log4net debug="true"> | |
15 | + <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> | |
16 | + <file value="Logs\AIALogs.log" /> | |
17 | + <appendToFile value="true" /> | |
18 | + <rollingStyle value="Size" /> | |
19 | + <maxSizeRollBackups value="10" /> | |
20 | + <maximumFileSize value="10MB" /> | |
21 | + <staticLogFileName value="true" /> | |
22 | + <layout type="log4net.Layout.PatternLayout"> | |
23 | + <conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" /> | |
24 | + </layout> | |
25 | + </appender> | |
26 | + | |
27 | + <root> | |
28 | + <level value="DEBUG" /> | |
29 | + <appender-ref ref="RollingLogFileAppender" /> | |
30 | + </root> | |
31 | + </log4net> | |
32 | + | |
33 | 33 | <appSettings> |
34 | 34 | <add key="SenderEmailAddress" value="support@interactiveanatomy.com" /> |
35 | 35 | <add key="ErrorNotificationEmailAddress" value="support@interactiveanatomy.com" /> |
... | ... | @@ -39,14 +39,17 @@ |
39 | 39 | <add key="EnableSSL" value="false" /> |
40 | 40 | <add key="Site_Url" value ="http://qa.beta.interactiveanatomy.com/"/> |
41 | 41 | <add key ="HostAddress" value="10.100.12.13" /> |
42 | - <add key="isUserAuthenticated" value="true"/> | |
42 | + <add key="isUserAuthenticated" value="false"/> | |
43 | 43 | <add key="AdminSupport" value="amrita.vishnoi@ebix.com,nikita.kulshreshtha@ebix.com"/> |
44 | - </appSettings> | |
44 | + <add key ="AIADatabaseV5Context" value="Data Source=192.168.90.53;Initial Catalog=AIADatabaseV5;User ID=AIA_Dev;Password=india123;"/> | |
45 | + <!--<add key ="AIADatabaseV5Context" value="Data Source=52.6.248.70;Initial Catalog=AIADatabase;User ID=amrita;Password=Ebix@2017;"/>--> | |
46 | + | |
47 | + </appSettings> | |
45 | 48 | <system.web> |
46 | 49 | <compilation debug="true" targetFramework="4.5" /> |
47 | 50 | <httpRuntime targetFramework="4.5" /> |
48 | 51 | </system.web> |
49 | - | |
52 | + | |
50 | 53 | <applicationSettings> |
51 | 54 | <AIAHTML5.API.Properties.Settings> |
52 | 55 | <setting name="AIAConnectionString" serializeAs="String"> |
... | ... | @@ -77,11 +80,12 @@ |
77 | 80 | </dependentAssembly> |
78 | 81 | </assemblyBinding> |
79 | 82 | </runtime> |
80 | -<system.webServer> | |
83 | + <system.webServer> | |
81 | 84 | <handlers> |
82 | 85 | <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> |
83 | 86 | <remove name="OPTIONSVerbHandler" /> |
84 | 87 | <remove name="TRACEVerbHandler" /> |
85 | 88 | <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> |
86 | 89 | </handlers> |
87 | - </system.webServer></configuration> | |
90 | + </system.webServer> | |
91 | +</configuration> | |
88 | 92 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb
No preview for this file type
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -22,7 +22,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
22 | 22 | |
23 | 23 | $scope.VocabTermTxt; |
24 | 24 | $scope.CommonData |
25 | - $rootScope.TermNumberData; | |
25 | + $rootScope.TermNumberData = null; | |
26 | 26 | $rootScope.BodySystemData |
27 | 27 | $scope.bodyViewId = 0; |
28 | 28 | $rootScope.bgartData; |
... | ... | @@ -2760,9 +2760,31 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2760 | 2760 | |
2761 | 2761 | else { |
2762 | 2762 | |
2763 | - var canvasDiv = document.getElementById('canvasDiv'); | |
2764 | - $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition); | |
2765 | - $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition); | |
2763 | + | |
2764 | + if ($rootScope.isZoomed) { | |
2765 | + var lastSelectedAnnotation; | |
2766 | + angular.forEach($rootScope.previousHighlightList, function (value, key) { | |
2767 | + var ActualTermNos = $scope.getActualTermNumber(value); | |
2768 | + lastSelectedAnnotation = ActualTermNos; | |
2769 | + }); | |
2770 | + | |
2771 | + $scope.TermList = $scope.getTermNumberList(lastSelectedAnnotation); | |
2772 | + $scope.termCoordinate = $scope.getTermCoordinate(lastSelectedAnnotation); | |
2773 | + | |
2774 | + console.log('last selected Annotation= ' + lastSelectedAnnotation); | |
2775 | + console.log('termListCount= ' + $scope.TermList.length); | |
2776 | + console.log('termCoordinate= ' + $scope.termCoordinate.x); | |
2777 | + | |
2778 | + | |
2779 | + | |
2780 | + $scope.aligneCanvasWithTerm(); | |
2781 | + } | |
2782 | + else { | |
2783 | + | |
2784 | + var canvasDiv = document.getElementById('canvasDiv'); | |
2785 | + $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition); | |
2786 | + $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition); | |
2787 | + } | |
2766 | 2788 | } |
2767 | 2789 | |
2768 | 2790 | $rootScope.isLoading = false; |
... | ... | @@ -2773,7 +2795,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2773 | 2795 | |
2774 | 2796 | } |
2775 | 2797 | } |
2776 | - $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2); | |
2798 | + | |
2777 | 2799 | |
2778 | 2800 | |
2779 | 2801 | }; |
... | ... | @@ -8273,7 +8295,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
8273 | 8295 | |
8274 | 8296 | |
8275 | 8297 | $('#termList').empty(); |
8276 | - $scope.loadListManger(); | |
8298 | + if ($rootScope.TermNumberData == null) { | |
8299 | + setTimeout(function () { $scope.loadListManger(); }, 3000); | |
8300 | + } | |
8301 | + else { | |
8302 | + $scope.loadListManger(); | |
8303 | + } | |
8277 | 8304 | $rootScope.islistManagerEventAlredayDispachted = false; |
8278 | 8305 | } |
8279 | 8306 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -40,6 +40,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
40 | 40 | modesty: null |
41 | 41 | }; |
42 | 42 | |
43 | + // on refersh this variable will also get null that is why we are only checking this variable on initialize that if it is null that means page gets refershed. | |
44 | + $rootScope.refreshcheck = null; | |
45 | + | |
46 | + | |
47 | + | |
43 | 48 | $rootScope.isModestyOn; |
44 | 49 | $rootScope.isModestyOff; |
45 | 50 | $rootScope.SetSettingActiveTab; |
... | ... | @@ -89,6 +94,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
89 | 94 | var isOutlineOptionChecked = ""; |
90 | 95 | $rootScope.forgotPwdModalShow = function () |
91 | 96 | { |
97 | + document.getElementById("forgetPwdForm").reset() | |
92 | 98 | $("#forgotPwdModal").modal("show"); |
93 | 99 | $(".modal-backdrop").css("opacity",".5"); |
94 | 100 | } |
... | ... | @@ -139,25 +145,70 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
139 | 145 | $("#messageModal").modal('show'); |
140 | 146 | } |
141 | 147 | else { |
142 | - if (result.loginId != undefined || result.loginId != "" || result.loginId != null) { | |
148 | + if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) { | |
143 | 149 | |
144 | 150 | if ($("#messageModal").length > 0){ |
145 | 151 | |
146 | 152 | $("#messageModal").modal('hide'); |
147 | - } | |
148 | - $rootScope.userData = result; | |
149 | - $rootScope.userModules = result.modules; | |
150 | - $rootScope.isVisibleLogin = false; | |
151 | - | |
152 | - localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | |
153 | - $('#dvUserModulesInfo').modal('show'); | |
154 | - | |
155 | - var userType = result.userType + ''; | |
156 | - | |
157 | - if (userType === UserTypeConstants.SUPER_ADMIN) | |
158 | - $rootScope.haveRoleAdmin = false; | |
159 | - else | |
160 | - $rootScope.haveRoleAdmin = true; | |
153 | + } | |
154 | + if (result == LoginMessageConstants.INVALID_USER) { | |
155 | + $rootScope.isVisibleLogin = true; | |
156 | + $rootScope.errorMessage = LoginMessageConstants.INVALID_USER; | |
157 | + $("#messageModal").modal('show'); | |
158 | + } | |
159 | + else { | |
160 | + if ((!result.IsSubscriptionExpired) && (result.UserType == UserTypeConstants.SUPER_ADMIN) || result.UserType == UserTypeConstants.GENERAL_ADMIN && result.IsActive) { | |
161 | + $rootScope.userData = result; | |
162 | + $rootScope.userModules = result.Modules; | |
163 | + $rootScope.isVisibleLogin = false; | |
164 | + $rootScope.haveRoleAdmin = false; | |
165 | + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | |
166 | + $('#dvUserModulesInfo').modal('show'); | |
167 | + } | |
168 | + //else if () | |
169 | + else if ((!result.IsSubscriptionExpired) && (result.License != null) && (result.License.IsActive) && result.IsActive) { | |
170 | + | |
171 | + $rootScope.userData = result; | |
172 | + $rootScope.userModules = result.Modules; | |
173 | + $rootScope.isVisibleLogin = false; | |
174 | + $rootScope.haveRoleAdmin = true; | |
175 | + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | |
176 | + $('#dvUserModulesInfo').modal('show'); | |
177 | + } | |
178 | + else if ((!result.IsSubscriptionExpired) && (result.License != null) && (result.License.IsActive) && !result.IsActive) { | |
179 | + $rootScope.isVisibleLogin = true; | |
180 | + $rootScope.errorMessage = LoginMessageConstants.USER_INACTIVE_MESSAGE; | |
181 | + $("#messageModal").modal('show'); | |
182 | + } | |
183 | + else if ((result.IsSubscriptionExpired) && (result.License != null) && (result.License.IsActive) && result.IsActive) { | |
184 | + $rootScope.isVisibleLogin = true; | |
185 | + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDateString + '.'; | |
186 | + $("#messageModal").modal('show'); | |
187 | + } | |
188 | + else if ((result.IsSubscriptionExpired) && (result.License != null) && (result.License.IsActive) && !result.IsActive) { | |
189 | + $rootScope.isVisibleLogin = true; | |
190 | + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDateString + '.'; | |
191 | + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | |
192 | + $("#messageModal").modal('show'); | |
193 | + } | |
194 | + else if ((result.IsSubscriptionExpired) && (result.License != null) && !(result.License.IsActive) && result.IsActive) { | |
195 | + $rootScope.isVisibleLogin = true; | |
196 | + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDateString + '.'; | |
197 | + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE; | |
198 | + $("#messageModal").modal('show'); | |
199 | + } | |
200 | + else if ((result.IsSubscriptionExpired) && (result.License != null) && !(result.License.IsActive) && !result.IsActive) { | |
201 | + $rootScope.isVisibleLogin = true; | |
202 | + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDateString + '.'; | |
203 | + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | |
204 | + $("#messageModal").modal('show'); | |
205 | + } | |
206 | + else if (result.License == null && !result.IsActive) { | |
207 | + $rootScope.isVisibleLogin = true; | |
208 | + $rootScope.errorMessage = LoginMessageConstants.USER_INACTIVE_MESSAGE; | |
209 | + $("#messageModal").modal('show'); | |
210 | + } | |
211 | + } | |
161 | 212 | } |
162 | 213 | |
163 | 214 | } |
... | ... | @@ -206,7 +257,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
206 | 257 | if (userInfo.loginId != undefined || userInfo.loginId != "" || userInfo.loginId != null) { |
207 | 258 | $rootScope.isVisibleLogin = false; |
208 | 259 | $rootScope.userData = userInfo; |
209 | - $rootScope.userModules = userInfo.modules; | |
260 | + $rootScope.userModules = userInfo.Modules; | |
261 | + if ($rootScope.refreshcheck == null) { | |
262 | + $location.path('/'); | |
263 | + } | |
210 | 264 | } |
211 | 265 | } |
212 | 266 | catch (e) { |
... | ... | @@ -241,7 +295,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
241 | 295 | $("#messageModal").modal('show'); |
242 | 296 | } |
243 | 297 | else { |
244 | - if (result.loginId != undefined || result.loginId != "" || result.loginId != null) { | |
298 | + if (result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) { | |
245 | 299 | var message; |
246 | 300 | if ($('.forgot-sm').length > 0) { |
247 | 301 | $('.forgot-sm').fadeOut(); |
... | ... | @@ -321,7 +375,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
321 | 375 | |
322 | 376 | } |
323 | 377 | else { |
324 | - if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { | |
378 | + //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { | |
379 | + if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) { | |
325 | 380 | // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); |
326 | 381 | $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; |
327 | 382 | $("#messageModal").modal('show'); |
... | ... | @@ -568,6 +623,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
568 | 623 | //jspanel functionality.. |
569 | 624 | |
570 | 625 | $rootScope.getModuleScrollPosition = function () { |
626 | + $rootScope.refreshcheck = "check"; | |
571 | 627 | $('.mCSB_container ul li').click(function () { |
572 | 628 | |
573 | 629 | $rootScope.scrollTopPosition = $(this).position().top; | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
... | ... | @@ -320,7 +320,13 @@ AIA.constant("LoginMessageConstants", { |
320 | 320 | "NEW_AND_OLD_PASSWORD_DONOT_MATCH": "Your new password and confirm password not matched!", |
321 | 321 | "USER_CREDENTIALS_MISSING": "Please Enter your credentials.", |
322 | 322 | "USER_NOT_FOUND": "User not found.", |
323 | - "NEW_PASSWORD_FIELD_IS_EMPTY": "Please enter new password to reset your password." | |
323 | + "NEW_PASSWORD_FIELD_IS_EMPTY": "Please enter new password to reset your password.", | |
324 | + "PASSWORD_UPDATE_SUCCESS": "Password updated successfully", | |
325 | + "PASSWORD_UPDATE_FAILED": "Password update failed", | |
326 | + "SUBSCRIPTION_EXPIRATION_MESSAGE": "Your license has been expired since ", | |
327 | + "LICENSE_INACTIVE_MESSAGE": "Your license is inactive.", | |
328 | + "INVALID_USER": "Invalid UserID", | |
329 | + "USER_INACTIVE_MESSAGE": "User ID is inactive." | |
324 | 330 | //"ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.", |
325 | 331 | //"MAIL_NOT_SENT": "Mail not sent." |
326 | 332 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/index.html
... | ... | @@ -263,7 +263,7 @@ |
263 | 263 | <h5 class="modal-title" id="exampleModalLabel">Enter your email id to recover Password</h5> |
264 | 264 | </div> |
265 | 265 | <div class="modal-body"> |
266 | - <form> | |
266 | + <form id="forgetPwdForm"> | |
267 | 267 | <div class="form-group"> |
268 | 268 | <div class="input-group"> |
269 | 269 | <span class="input-group-addon"><i class="fa fa-envelope"></i></span> |
... | ... | @@ -1237,7 +1237,7 @@ |
1237 | 1237 | <div class="col-sm-8">• Dissectible Anatomy</div> |
1238 | 1238 | </div> |
1239 | 1239 | <div class="form-group"> |
1240 | - <div class="col-sm-8"><i>• Atlas Anatomy (To be available by 06/30/2017)</i></div> | |
1240 | + <div class="col-sm-8">• Atlas Anatomy</div> | |
1241 | 1241 | </div> |
1242 | 1242 | <div class="form-group"> |
1243 | 1243 | <div class="col-sm-8">• Clinical Illustration</div> | ... | ... |