diff --git a/.gitignore b/.gitignore index 1a31643..c8f9f67 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,6 @@ $tf*/ 300-PROTOTYPES/POC/AIAHTML5 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js.orig 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js.orig -400-SOURCECODE/AIAHTML5.Web/index.html.orig \ No newline at end of file +400-SOURCECODE/AIAHTML5.Web/index.html.orig +400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll +400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb diff --git a/150-DOCUMENTATION/002-DBScripts/CreateContentTable.sql b/150-DOCUMENTATION/002-DBScripts/CreateContentTable.sql new file mode 100644 index 0000000..586d51f --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/CreateContentTable.sql @@ -0,0 +1,56 @@ +CREATE TABLE Content +( + Id INT NOT NULL, + Title VARCHAR(50) NOT NULL, + Content NVARCHAR(MAX) +) + +INSERT INTO Content VALUES (1, 'Terms of Service', 'END USER LICENSE AGREEMENT: A.D.A.M. INTERACTIVE ANATOMY
+YOU SHOULD CAREFULLY READ THE FOLLOWING TERMS AND CONDITIONS OF THIS END USER LICENSE AGREEMENT (THIS "AGREEMENT") BEFORE YOU USE THE WEB APPLICATION (AS DEFINED BELOW). THIS AGREEMENT IS A LEGALLY BINDING CONTRACT BETWEEN A.D.A.M. Education, a division of Ebix, Inc. ("ADAM") AND YOU. ADAM IS LICENSING THE WEB APPLICATION TO YOU FOR YOUR USE ONLY AS SET FORTH BELOW. BY USING ANY PART OF THE WEB APPLICATION, YOU ACCEPT AND AGREE TO ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT ACCEPT AND AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT, YOU SHOULD NOT REGISTER THIS LICENSE OR USE THE WEB APPLICATION AND SHOULD PROMPTLY CONTACT A.D.A.M. , WITHIN TEN DAYS AFTER YOU OBTAIN THE WEB APPLICATION ACCESS, FOR A REFUND OF YOUR MONEY.
+DEFINITIONS
The following definitions apply to the terms as they appear in this Agreement: +1. GRANT OF LICENSE
+Subject to the terms of this Agreement, ADAM grants You, and You accept from ADAM, a limited, personal, revocable, non-transferable, non-exclusive license to use the machine-readable, object code form of the Web Application and any accompanying documentation (the "Documentation") for personal use. The Web Application and Documentation are licensed (not sold) to you. You agree that ADAM does not transfer to you any of ADAM''s right, title, or interest in or to the Web Application or Documentation or any component part thereof except as expressly set forth herein, and under no circumstances shall this Agreement be considered a "sale" of the Web Application or Documentation or of any component part thereof to you. You agree that ADAM retains all right, title, and interest in and to the Web Application and Documentation and all component parts thereof and to all intellectual and industrial property rights therein, subject only to the limited right of use granted to you hereunder, which right of use ADAM may terminate or revoke in accordance with the terms of this Agreement. The Web Application contains components that actively monitor for license violations. In the event that a license violation is detected, the Web Application may be automatically disabled. You agree to allow for this monitoring to occur and for ADAM to disable the Web Application in the event that a license violation is detected.
+2. PERMITTED USES OF THE WEB APPLICATION
+(A) Single Computer Use: Student''s and Instructor''s Editions (each referring to the Web Application)
ADAM grants You a limited license to use the Web Application as follows. You may:

+(B) Concurrent License Use: Student/Library Patron Edition

ADAM also grants You a limited license to use the Web Application as follows. You may:

+(C) Site License Use: Student/Faculty and Library Patron Edition

ADAM also grants You a limited license to use the Web Application as follows. You may:


+3. PERMITTED USES OF THE A.D.A.M. CONTENT
+ADAM grants You a limited license to use the A.D.A.M. Content in accordance with this Agreement. The permitted uses of A.D.A.M. Content listed below do not apply to any commercial use of the A.D.A.M. Content. Commercial use (that is, use of A.D.A.M. Content in any other means not expressly granted herein would require an additional license from ADAM. + +All output and copies You make of A.D.A.M. Content, regardless of their form, must bear and prominently display ADAM''s copyright notice in the following form: © 2012 A.D.A.M., Education. ADAM reserves, and You hereby grant to ADAM the right to review all such copies to verify compliance with this Agreement. +The permitted uses described above are based in large part upon the Fair Use Guidelines for Educational Media published by the Consortium of College and University Media Centers. In the event of any discrepancies between the specific terms of this Agreement and the Guidelines, this Agreement will govern. The Guidelines may be found at http://www.ccumc.org/copyright/ccguides.html +If you would like to make any use of the A.D.A.M. Content not authorized under this Agreement, you should contact A.D.A.M. Education License Administrator at 800-755-2326.
+4. OWNERSHIP OF PROJECTS
+You retain ownership of (i) any electronic Educational Multimedia Project created using the A.D.A.M. Content, whether or not such project was created using Curriculum Builder, and any copies You make of such electronic Educational Multimedia Project and (ii) any intellectual properties related to such project. However, ADAM or its suppliers will retain ownership of (i) all A.D.A.M. Content, including the A.D.A.M. Images, used in any electronic Educational Multimedia Project and all A.D.A.M. Images that You alter or modify in the creation of such project and (ii) any intellectual properties related to the A.D.A.M. Content, including the A.D.A.M. Images, whether or not altered or modified.
+5. PRIVACY AND PRODUCT ACTIVATION
+When the Web Application is first used, it must be activated. A questionnaire is provided with information submitted to ADAM prior to the online activation process, along with the license data. The information may be used by ADAM for the purposes of developing marketing materials for future and existing products. +

In addition to the questionnaire, information, and license, certain identifying system information is encrypted via a one-way hash function and the result of this function is transmitted as well. This system information is used solely to uniquely identify the machine that the Web Application is access from, and the hash function prevents the retrieval of the original system information from the hashed result. The use of internet protocols necessitates that the program will also transmit the IP (internet protocol) address of the machine from which the Web Application is being used, and this information may be logged by ADAM''s servers as well. All information is transmitted via SSL (secure socket layer) to deter electronic eavesdropping.


+6. RESTRICTIONS
+You agree that the Web Application and Documentation and all component parts thereof contain copyrighted material, trademarks, trade secrets, and other proprietary material of ADAM protected under applicable U.S. and international intellectual and industrial property laws (regardless of whether such rights of ADAM are registered or unregistered). You agree that, except as provided for in Section 2 above, you will not: (i) copy, reproduce, modify, network, rent, loan, lease, re-sell, or otherwise distribute the Web Application or Documentation any of its or their components to any third-party; (ii) make the Web Application or Documentation available on any public Internet sites, by "bulletin boards," on-line services, remote dial-in, or network or telecommunications link of any kind; (iii) create derivative works or any other works that are based on or derived, in whole or in part, from the Web Application, A.D.A.M. Content, or Documentation or any of its or their components; (iv) assign, sublicense, transfer, pledge, or otherwise share your rights under this Agreement; or (v) decompile, reverse engineer, disassemble, or translate the Web Application or otherwise reduce the Web Application to a humanly perceivable form. The trademarks, service marks, and logos used on the Web Application and/or Documentation are owned by ADAM or third parties who have granted limited rights of use to ADAM, and all rights therein are reserved by the respective owners. You will not alter, remove, or obfuscate any trademarks, copyrights, or other proprietary rights notices contained on the Web Application or the Documentation.
+7. TRANSFER
+You may not permanently transfer all of Your rights under this Agreement.
+8. TERMINATION
+This Agreement and Your rights to use the Web Application and Documentation terminate automatically if You violate any part of this Agreement or the Guidelines. In the event of termination, You must immediately remove all access of the Web Application and Documentation.
+9. DISCLAIMER OF WARRANTY
+THE WEB APPLICATION AND DOCUMENTATION IS PROVIDED ON AN "AS-IS" BASIS WITHOUT WARRANTY OF ANY KIND AND ADAM DISCLAIMS ANY WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ALL WARRANTIES AGAINST INFRINGEMENT ARE HEREBY DISCLAIMED EXCEPT ADAM REPRESENTS THAT IT HAS SUFFICIENT AUTHORIZATION TO LICENSE THE WEB APPLICATION AND DOCUMENTATION TO YOU. ADAM DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE WEB APPLICATION MEET YOUR REQUIREMENTS OR THAT THE USE OF THE WEB APPLICATION WILL BE UNINTERRUPTED OR ERROR FREE. ADAM MAKES NO REPRESENTATION OR WARRANTY THAT ITS WEB APPLICATION WILL WORK IN COMBINATION WITH ANY HARDWARE APPLICATIONS OR WEB APPLICATION OF THIRD PARTIES, OR THAT ALL DEFECTS IN THE WEB APPLICATION WILL BE CORRECTED. THE WEB APPLICATION MAY INCLUDE OR BE BUNDLED WITH THIRD-PARTY WEB APPLICATION, THE USE OF WHICH IS GOVERNED BY A SEPARATE END-USER LICENSE AGREEMENT. THIS WARRANTY DOES NOT APPLY TO SUCH THIRD PARTY WEB APPLICATION. FOR APPLICABLE WARRANTY INFORMATION FOR SUCH THIRD PARTY WEB APPLICATION, PLEASE REFER TO THE END USER LICENSE AGREEMENT GOVERNING THE USE OF SUCH THIRD PARTY WEB APPLICATION OR THE ACCOMPANYING DOCUMENTATION RELATING TO SUCH THIRD PARTY WEB APPLICATION. +If the Web Application fails to comply with these limited warranties, at A.D.A.M. Education, a division of Ebix, Inc. option, make a reasonable effort to correct any nonconformities in the Web Application. +If ADAM is unable to correct defective media or nonconformities in the Web Application, ADAM will refund the price You paid for this subscription. The refund will fully satisfy all of Your claims under this limited warranty. This limited warranty shall continue for any replacement Web Application for the rest of the original 90-day warranty period or for 30 days from the date You receive the replacement license, whichever is longer. ADAM ''s liability to You for actual damages for any cause whatsoever, and regardless of the form of the action, will be limited to the money paid for the Web Application Subscription.
+10. DISCLAIMER OF MEDICAL WARRANTY
+ADAM MAKES NO REPRESENTATION OR WARRANTY TO YOU OR ANY OTHER PARTY REGARDING THE ACCURACY OF ANY MEDICAL INFORMATION MADE AVAILABLE THROUGH THE WEB APPLICATION. YOU AGREE THAT THE WEB APPLICATION IS MADE AVAILABLE TO YOU ONLY FOR GENERAL EDUCATION AND ENTERTAINMENT PURPOSES. YOU SHOULD NOT USE ANY INFORMATION MADE AVAILABLE THROUGH THE WEB APPLICATION TO DIAGNOSE OR TREAT ANY MEDICAL CONDITION. YOU SHOULD CONSULT A LICENSED PHYSICIAN TO DIAGNOSE AND TREAT ANY MEDICAL CONDITION.
+11. LIMITATION OF LIABILITY
+(a) IN NO EVENT SHALL ADAM''S CUMULATIVE LIABILITY TO YOU OR ANY OTHER PARTY FOR ANY LOSS OR DAMAGES RESULTING FROM ANY CLAIMS, DEMANDS, OR ACTIONS (WHETHER IN CONTRACT, TORT, OR OTHERWISE) ARISING OUT OF OR RELATED TO THIS AGREEMENT OR THE USE OF (OR THE INABILITY TO USE) THE WEB APPLICATION AND DOCUMENTATION EXCEED THE AMOUNT OF LICENSE FEES ACTUALLY PAID BY YOU TO ADAM FOR THE WEB APPLICATION AND DOCUMENTATION. +(b) IN NO EVENT SHALL ADAM BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL, OR EXEMPLARY DAMAGES, OR LOST PROFITS, EVEN IF ADAM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATION OR EXCLUSION MAY NOT APPLY TO YOU.
+12. EXPORT CONTROLS
+The Web Application and Documentation and every component part thereof are subject to the export controls of the United States of America (including, without limitation, the U.S. Export Administration Act and any regulations thereto). No portion of the Web Application may be downloaded, exported, or re-exported: (i) into (or to a national or resident of) Cuba, Iraq, Libya, Sudan, North Korea, Iran, Syria, or any country to which the United States of America has embargoed goods; or (ii) to anyone on the U. S. Treasury Department''s list of Specially Designated Nationals or the U. S. Commerce Department''s Table of Denial Orders. By using the Web Application, you are agreeing to the foregoing and you are warranting that you are not located in, under the control of, or a national or resident of any such country on any such list.
+13. U.S. GOVERNMENT RESTRICTED RIGHTS
+The Web Application and Documentation are provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at D.F.A.R.S. 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights at 48 C.F.R. 52.227-19, as applicable. The manufacturer for such purpose is A.D.A.M., Inc., 10 10th Street, Suite 500, Atlanta, Georgia 30309.
+14. MISCELLANEOUS
+This Agreement shall be governed by the laws of the State of Georgia, United States of America, excluding the application of its conflicts of law provisions. You agree that all legal proceedings arising out of or in connection with this Agreement shall be brought exclusively in the state courts of Georgia located in Fulton County, Georgia, or the U.S. District Court located in the Northern District of Georgia - Atlanta Division, and You expressly submit to the jurisdiction and venue of such courts and consent to extra-territorial service of process, should a dispute arise. Should any provision of this Agreement be declared invalid or unenforceable by any court of competent jurisdiction, such provision shall be deemed severable from this Agreement and shall not affect the validity and enforceability of the remaining provisions of this Agreement. If any action is brought by either party to this Agreement against the other party regarding the subject matter of this Agreement, the prevailing party shall be entitled to recover, in addition to any other relief granted, reasonable attorneys'' fees and expenses of such action. The failure or delay at any time of either party to this Agreement to require performance by the other party of any responsibility or obligation provided for in this Agreement shall in no way affect the full right of such party to require such performance at any time thereafter, nor shall the waiver by either such party of a breach of any provision of this Agreement by the other party constitute a waiver of any succeeding breach of the same or any other provisions, nor constitute a waiver of the responsibility or obligation itself. This Agreement constitutes the entire agreement between You and ADAM relating to the subject matter herein and shall not be modified except in writing signed by both you and ADAM. You agree that any violation by You of the provisions of this Agreement would cause ADAM irreparable harm for which ADAM would have no adequate remedy at law. Therefore, in addition to other remedies, which may be available to ADAM, ADAM will be entitled to seek injunctive relief, without the necessity of posting bond, against any such violation or threatened violation. +

Copyright © 2012 A.D.A.M. Education, Ebix, Inc.. All rights reserved.
+A.D.A.M. Interactive Anatomy requires Adobe Flash™ Player software by Adobe, Inc., Copyright © 2012 Abode, Inc. All rights reserved. Adobe, and Flash are trademarks of Adobe, Inc.
+A.D.A.M. Interactive Anatomy requires Unity Pro™ Player software by Unity Technologies, Copyright © 2012 Unity Technologies. All rights reserved. Unity Pro and Unity Technologies are trademarks of Unity Technologies.

+') \ No newline at end of file diff --git a/150-DOCUMENTATION/002-DBScripts/GetTermsOfServiceText.sql b/150-DOCUMENTATION/002-DBScripts/GetTermsOfServiceText.sql new file mode 100644 index 0000000..af21104 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/GetTermsOfServiceText.sql @@ -0,0 +1,33 @@ +-- ================================================ +-- Template generated from Template Explorer using: +-- Create Procedure (New Menu).SQL +-- +-- Use the Specify Values for Template Parameters +-- command (Ctrl-Shift-M) to fill in the parameter +-- values below. +-- +-- This block of comments will not be included in +-- the definition of the procedure. +-- ================================================ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +-- ============================================= +-- Author: +-- Create date: +-- Description: +-- ============================================= +CREATE PROCEDURE GetTermsOfServiceText + -- Add the parameters for the stored procedure here + +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + + -- Insert statements for procedure here + SELECT Content.Title, Content.Content FROM Content WHERE ID = 1 +END +GO diff --git a/400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj b/400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj index fea8783..75def72 100644 --- a/400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj +++ b/400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj @@ -106,7 +106,7 @@ - + @@ -143,6 +143,7 @@ + 10.0 diff --git a/400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs b/400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs index b04f4bb..d23a28a 100644 --- a/400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs +++ b/400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs @@ -21,5 +21,8 @@ namespace AIAHTML5.API.Constants public const string PASSWORD_UPDATE_FAILED = "Password update failed"; public const string INVALID_USER = "Invalid UserID"; + + public const string LICENSE_TERM_CONDITION_UPDATE_SUCCESS = "License Term Accepted field updated successfully."; + public const string LICENSE_TERM_CONDITION_UPDATE_FAILED = "License Term Accepted field update failed."; } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/LicenseTermConditionController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/LicenseTermConditionController.cs new file mode 100644 index 0000000..88e9042 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/LicenseTermConditionController.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using log4net; +using AIAHTML5.API.Constants; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace AIAHTML5.API.Controllers +{ + public class LicenseTermConditionController : ApiController + { + // GET api/licensetermcondition + public IEnumerable Get() + { + return new string[] { "value1", "value2" }; + } + + // GET api/licensetermcondition/5 + public string Get(int id) + { + return "value"; + } + + // POST api/licensetermcondition + public HttpResponseMessage Post([FromBody]string licenseeAccountNumber) + { + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); + logger.Debug("inside POST"); + HttpResponseMessage response = null; + + int result = AIAHTML5.API.Models.Users.UpdateLicenseTerm(licenseeAccountNumber); + if (result > 0) + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.LICENSE_TERM_CONDITION_UPDATE_SUCCESS) }; + else + response = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.LICENSE_TERM_CONDITION_UPDATE_FAILED) }; + + return response; + } + + + // PUT api/licensetermcondition/5 + public void Put(int id, [FromBody]string value) + { + } + + // DELETE api/licensetermcondition/5 + public void Delete(int id) + { + } + } +} diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/ResetPasswordController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/ResetPasswordController.cs index c3b537a..24ede3d 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/ResetPasswordController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/ResetPasswordController.cs @@ -42,7 +42,7 @@ namespace AIAHTML5.API.Controllers int result = 0; if (!String.IsNullOrEmpty(userInfo["newPassword"].ToString())) { - result = AIAHTML5.API.Models.Users.UpdatePassword(userInfo, userData.LoginId, userData.EmailId); + result = AIAHTML5.API.Models.Users.UpdatePassword(userInfo); if (result > 0) response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.PASSWORD_UPDATE_SUCCESS) }; else diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index a663e70..c7a1be5 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -32,20 +32,30 @@ namespace AIAHTML5.API.Models protected static DataSet GetSQLData(string commandText, bool isSp) { - conn = new SqlConnection(dbConnectionString); - if (isSp) + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); + logger.Debug(" inside GetSQLData for command text = " + commandText); + DataSet ds= null; + try { - cmd = new SqlCommand(commandText, conn); - cmd.CommandType = CommandType.StoredProcedure; + conn = new SqlConnection(dbConnectionString); + if (isSp) + { + cmd = new SqlCommand(commandText, conn); + cmd.CommandType = CommandType.StoredProcedure; + } + else + { + cmd = new SqlCommand(commandText, conn); + } + SqlDataAdapter da = new SqlDataAdapter(); + da.SelectCommand = cmd; + ds = new DataSet(); + da.Fill(ds); } - else + catch (SqlException ex) { - cmd = new SqlCommand(commandText, conn); + logger.Fatal("Exception in GetSQLData for command text =" + commandText + ", Exception= " + ex.Message); } - SqlDataAdapter da = new SqlDataAdapter(); - da.SelectCommand = cmd; - DataSet ds = new DataSet(); - da.Fill(ds); return ds; } @@ -202,6 +212,16 @@ namespace AIAHTML5.API.Models ArrayList userModuleList = objModel.GetUserModulesList(allModulesList, licensedModulesList); objUser.Modules = userModuleList; + + if (!objUser.License.IsTermAccepted) + { + ArrayList termsList = DBModel.GetTermsOfServiceText(); + foreach(Hashtable item in termsList) + { + objUser.TermsOfServiceTitle = item["title"].ToString(); + objUser.TermsOfServiceText = item["content"].ToString(); + } + } } else { @@ -431,7 +451,7 @@ namespace AIAHTML5.API.Models return objUser; } - public static int UpdateUserPassword(dynamic userInfo, string loginId, string emailId) + public static int UpdateUserPassword(dynamic userInfo) { int result = 0; conn = new SqlConnection(dbConnectionString); @@ -440,8 +460,8 @@ namespace AIAHTML5.API.Models conn.Open(); cmd.CommandText = "UpdateUserPassword"; cmd.CommandType = CommandType.StoredProcedure; - cmd.Parameters.AddWithValue("@sLoginId", loginId); - cmd.Parameters.AddWithValue("@sEmailId", emailId); + cmd.Parameters.AddWithValue("@sLoginId", userInfo["loginId"].ToString()); + cmd.Parameters.AddWithValue("@sEmailId", userInfo["emailId"].ToString()); cmd.Parameters.AddWithValue("@sNewPassword", userInfo["newPassword"].ToString()); result = cmd.ExecuteNonQuery(); conn.Close(); @@ -576,9 +596,9 @@ namespace AIAHTML5.API.Models lic.LicenseTypeId = Convert.ToInt32(dr[dc]); if (dc.ColumnName == "InstitutionName") lic.InstitutionName = dr[dc].ToString(); - if (dc.ColumnName == "Adress1") + if (dc.ColumnName == "Address1") lic.Address1 = dr[dc].ToString(); - if (dc.ColumnName == "Adress2") + if (dc.ColumnName == "Address2") lic.Address2 = dr[dc].ToString(); if (dc.ColumnName == "CountryId") lic.CountryId = Convert.ToInt32(dr[dc]); @@ -592,7 +612,7 @@ namespace AIAHTML5.API.Models lic.Phone = dr[dc].ToString(); if (dc.ColumnName == "EmailId") lic.EmailId = dr[dc].ToString(); - if (dc.ColumnName == "TotalLogin") + if (dc.ColumnName == "TotalLogins") lic.TotalLogins = Convert.ToInt32(dr[dc]); if (dc.ColumnName == "AccountTypeId") lic.AccountTypeId = Convert.ToInt32(dr[dc]); @@ -614,7 +634,7 @@ namespace AIAHTML5.API.Models } if (dc.ColumnName == "NoOfRenewals") lic.NoOfRenewals = Convert.ToInt32(dr[dc]); - if (dc.ColumnName == "IsTermAccepted") + if (dc.ColumnName == "IsTermsAccepted") lic.IsTermAccepted = Convert.ToBoolean(dr[dc]); if (dc.ColumnName == "ProductId") lic.ProductId = dr[dc].ToString(); @@ -628,5 +648,49 @@ namespace AIAHTML5.API.Models return lic; } + + public static int UpdateLicenseTermStatus(string accountNumber) + { + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); + logger.Debug(" inside UpdateTermAcceptedStatus for AccountNumber = " + accountNumber); + int result = 0; + try + { + conn = new SqlConnection(dbConnectionString); + cmd = new SqlCommand(); + cmd.Connection = conn; + conn.Open(); + cmd.CommandText = "UpdateLicenseTermAcceptedStatus"; + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.AddWithValue("@sAccountNumber", accountNumber); + result = cmd.ExecuteNonQuery(); + conn.Close(); + } + catch (SqlException ex) + { + conn.Close(); + logger.Fatal("Exception in UpdateLicenseTermStatus for AccountNumber =" + accountNumber + ", Exception= " + ex.Message); + } + return result; + } + + protected static ArrayList GetTermsOfServiceText() + { + ArrayList arrTermsOfService = new ArrayList(); + Hashtable contentHash = null; + string str = string.Empty; + string spName = "GetTermsOfServiceText"; + DataSet ds = DBModel.GetSQLData(spName, true); + DataTable dt = ds.Tables[0]; + + foreach (DataRow dr in dt.Rows) + { + contentHash = new Hashtable(); + contentHash.Add(AIAConstants.KEY_TITLE, dr["Title"]); + contentHash.Add(AIAConstants.KEY_CONTENT, dr["Content"]); + arrTermsOfService.Add(contentHash); + } + return arrTermsOfService; + } } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs b/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs index c27ca51..e4b2562 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs @@ -9,17 +9,18 @@ namespace AIAHTML5.API.Models { public class PixelLocator { - - internal static dynamic GetBodyRegionsPixelData(string layerNumber, string bodyViewIndex, string systemNumber, string zoom) - { - try + + internal static dynamic GetBodyRegionsPixelData(string layerNumber, string bodyViewIndex, string systemNumber, string zoom) { - var client = new MongoClient(); - var db = client.GetDatabase("AIAHTML5"); + try + { + //var client = new MongoClient("mongodb://192.168.90.43:27017"); + var client = new MongoClient(); + var db = client.GetDatabase("AIAHTML5"); - var col = db.GetCollection("DAImages"); + var col = db.GetCollection("DAImages"); - var pipeline = new BsonDocument[] + var pipeline = new BsonDocument[] { new BsonDocument{{"$unwind", "$terms"}}, new BsonDocument{ { "$match", new BsonDocument("terms.SystemNumbers", Convert.ToInt32(systemNumber)).Add("bodyViewIndex", Convert.ToInt32(bodyViewIndex)).Add("layerNumber", Convert.ToInt32(layerNumber)).Add("zoom", Convert.ToInt32(zoom)) }}, @@ -31,15 +32,15 @@ namespace AIAHTML5.API.Models }; - var pixelData = col.Aggregate(pipeline).ToList(); + var pixelData = col.Aggregate(pipeline).ToList(); - return pixelData.ToJson(); - } - catch (Exception e) - { - string error = e.Message+"..STACKTRACE: "+e.StackTrace; - return error; + return pixelData.ToJson(); + } + catch (Exception e) + { + string error = e.Message + "..STACKTRACE: " + e.StackTrace; + return error; + } } } -} -} +} \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Models/User.cs b/400-SOURCECODE/AIAHTML5.API/Models/User.cs index b67ae98..7746e48 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/User.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/User.cs @@ -30,6 +30,8 @@ namespace AIAHTML5.API.Models public LicenseSubscriptionDetails LicenseSubscriptions { get; set; } public bool IsSubscriptionExpired { get; set; } public string SubscriptionExpirationDateString { get; set; } + public string TermsOfServiceTitle { get; set; } + public string TermsOfServiceText { get; set; } public const string SUPER_ADMIN = "Super Admin"; public const string GENERAL_ADMIN = "General Admin"; diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 567c6ab..b8d4022 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -131,7 +131,7 @@ namespace AIAHTML5.API.Models } - internal static dynamic UpdatePassword(Newtonsoft.Json.Linq.JObject userInfo, string sLoginId, string sEmailId) + internal static dynamic UpdatePassword(Newtonsoft.Json.Linq.JObject userInfo) { ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); //var client = new MongoClient(); @@ -144,7 +144,7 @@ namespace AIAHTML5.API.Models //var result = collection.UpdateOne(filter, update); - int result = DBModel.UpdateUserPassword(userInfo, sLoginId, sEmailId); + int result = DBModel.UpdateUserPassword(userInfo); if (result != null) return result; @@ -157,5 +157,12 @@ namespace AIAHTML5.API.Models return AIAConstants.ERROR_IN_FECTHING_DETAILS; } } + + internal static dynamic UpdateLicenseTerm(string accNumber) + { + int result = DBModel.UpdateLicenseTermStatus(accNumber); + + return result; + } } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll deleted file mode 100644 index 4ab72ce..0000000 --- a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll +++ /dev/null diff --git a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb deleted file mode 100644 index 0067eb3..0000000 --- a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb +++ /dev/null diff --git a/400-SOURCECODE/AIAHTML5.API/content/AIAConstants.cs b/400-SOURCECODE/AIAHTML5.API/content/AIAConstants.cs new file mode 100644 index 0000000..93891e5 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.API/content/AIAConstants.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace AIAHTML5.API.Constants +{ + public class AIAConstants + { + public const string ERROR_IN_FECTHING_DETAILS = "Error in fecthing details."; + public const string USER_NOT_FOUND = "User not found."; + public const string MAIL_NOT_SENT = "Mail not sent."; + public const string MAIL_SENT = "Mail sent."; + + public const string KEY_ID = "id"; + public const string KEY_TITLE = "title"; + public const string KEY_NAME = "name"; + public const string KEY_SLUG = "slug"; + + public const string PASSWORD_UPDATE_SUCCESS = "Password updated successfully"; + public const string PASSWORD_UPDATE_FAILED = "Password update failed"; + + public const string INVALID_USER = "Invalid UserID"; + + public const string LICENSE_TERM_CONDITION_UPDATE_SUCCESS = "License Term Accepted field updated successfully."; + public const string LICENSE_TERM_CONDITION_UPDATE_FAILED = "License Term Accepted field update failed."; + + public const string KEY_CONTENT = "content"; + } +} \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js index b6c6639..6c83fcd 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js @@ -6,6 +6,9 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $scope.threeDAnatomyData; $scope.Id; $scope.$on('$viewContentLoaded', function (event) { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } $scope.scroll(); var promise = DataService.getJson('~/../content/data/json/3da/3da_dat_contentlist.json') promise.then( @@ -86,7 +89,9 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } $scope.Open3DModelBody = function () { - + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); //alert(localStorage.getItem("currentBodyViewId")); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/ADAMImgController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/ADAMImgController.js index 534d59f..d44bcaf 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/ADAMImgController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/ADAMImgController.js @@ -12,6 +12,9 @@ function ($scope, $rootScope, pages, log, $location) { //alert("scroll"); } $scope.$on('$viewContentLoaded', function (event) { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } // code that will be executed ... // every time this view is loaded diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js index 720cff7..981a878 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js @@ -19,6 +19,9 @@ function ($scope, $rootScope, pages, log, $location) { //$rootScope.currentActiveModuleTitle = pages[10].name; $scope.$on('$viewContentLoaded', function (event) { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } // code that will be executed ... // every time this view is loaded diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js index f1fde94..0f90b7d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js @@ -13,6 +13,9 @@ function ($scope, $rootScope, pages, log, $location) { } $scope.$on('$viewContentLoaded', function (event) { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } // code that will be executed ... // every time this view is loaded diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 493a81f..33cf1da 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -27,6 +27,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }; $scope.$on('$viewContentLoaded', function (event) { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } + // code that will be executed ... // every time this view is loaded @@ -173,7 +177,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }); }); - + $('#' + localStorage.getItem("currentBodyViewId")).find('.thumbnail').addClass('HightLightThumbnail'); }, function (error) { // handle errors here @@ -460,7 +464,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.openBodyView = function () { - + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } if ($rootScope.disableAnnotationTB == true) { $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').attr('disabled', 'disabled'); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index 0d6f826..f2600fe 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -32,6 +32,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }; $scope.$on('$viewContentLoaded', function (event) { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } // code that will be executed ... // every time this view is loaded @@ -197,7 +200,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout // }); //}); - + $timeout(function () { $('#' + localStorage.getItem("currentBodyViewId")).find('.thumbnail').addClass('HightLightThumbnail'); }, 100); + + $timeout(function () { $('#ciSpinner').css('visibility', 'hidden'); }, 300); }, function (error) { @@ -528,7 +533,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.openBodyView = function () { - + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); $scope.voId = localStorage.getItem("currentBodyViewId"); @@ -626,16 +633,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout "slug": $rootScope.currentSlug }); + + $("#ciImagePanel .img-thumbnail").css("height", $("#ciImagePanel .jsPanel-content").height()); var jspContentHeight = $('.jsPanel-content').height(); - var imgHeight = $('.img-thumbnail').find('img').height(); - if (imgHeight <= 0) - imgHeight = 320; - var textH = $('.img-subtitle').height(); - textH = textH + 40; - var blackBorderHeight = jspContentHeight - (imgHeight + textH); - if ($('.jsPanel-content').length > 0) { - $('.img-subtitle').css('margin-bottom', blackBorderHeight); - } + //var imgHeight = $('.img-thumbnail').find('img').height(); + //if (imgHeight <= 0) + // imgHeight = 320; + //var textH = $('.img-subtitle').height(); + //textH = textH + 40; + //var blackBorderHeight = jspContentHeight - (imgHeight + textH); + //if ($('.jsPanel-content').length > 0) { + // $('.img-subtitle').css('margin-bottom', blackBorderHeight); + //} } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 5dc50cd..35d4e9b 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -19,7 +19,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) { } //load json data $scope.loadCurriculumBuiderData = function () { - + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } //get current path var currentURL = $location.path(); var selectedModuleName = ''; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 510b42f..c0c1995 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -376,7 +376,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //load json data for body view $scope.loadDissectibleAnatomyData = function () { - + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } //get current path var currentURL = $location.path(); var selectedModuleName = ''; @@ -2845,193 +2847,202 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l .then( function (result) { - console.log('1. HighlightBodyByTermListForBodySystem is called'); - $rootScope.macthedTermList = result; - var termNo = 0; - var pixcelLocation = 0; - var prevBRID = 0; - if ($rootScope.macthedTermList.length > 0) { - console.log('2. HighlightBodyByTermListForBodySystem is called'); - //remove existing data and draw fresh data - for(var i=0; i<$rootScope.grayImageDataList.length;i++){ - var grayCanvasID = 'imageCanvas' + parseInt(i+1); - var grayCanvas = document.getElementById(grayCanvasID); - - if (grayCanvas != null) { - var grayCanvasContext = grayCanvas.getContext("2d"); - - var canvasHeight = grayCanvas.height; - var canvasWidth = grayCanvas.width; - grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth) - grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0); + + if (result.length == 0) + { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + + } + else { + console.log('1. HighlightBodyByTermListForBodySystem is called'); + $rootScope.macthedTermList = result; + var termNo = 0; + var pixcelLocation = 0; + var prevBRID = 0; + if ($rootScope.macthedTermList.length > 0) { + console.log('2. HighlightBodyByTermListForBodySystem is called'); + //remove existing data and draw fresh data + for (var i = 0; i < $rootScope.grayImageDataList.length; i++) { + var grayCanvasID = 'imageCanvas' + parseInt(i + 1); + var grayCanvas = document.getElementById(grayCanvasID); + + if (grayCanvas != null) { + var grayCanvasContext = grayCanvas.getContext("2d"); + + var canvasHeight = grayCanvas.height; + var canvasWidth = grayCanvas.width; + grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth) + grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0); + } } - } - for (var i = 4; i <= $rootScope.grayImageMRDataList.length; i++) { - var grayCanvasMRID = 'imageCanvas' + i+'_MR'; - var grayCanvasMR = document.getElementById(grayCanvasMRID); + for (var i = 4; i <= $rootScope.grayImageMRDataList.length; i++) { + var grayCanvasMRID = 'imageCanvas' + i + '_MR'; + var grayCanvasMR = document.getElementById(grayCanvasMRID); - if (grayCanvasMR != null) { - var grayCanvasContextMR = grayCanvasMR.getContext("2d"); + if (grayCanvasMR != null) { + var grayCanvasContextMR = grayCanvasMR.getContext("2d"); - var canvasHeight = grayCanvasMR.height; - var canvasWidth = grayCanvasMR.width; - grayCanvasContextMR.clearRect(0, 0, canvasHeight, canvasWidth) - grayCanvasContextMR.putImageData($rootScope.grayImageMRDataList[parseInt(i)], 0, 0); + var canvasHeight = grayCanvasMR.height; + var canvasWidth = grayCanvasMR.width; + grayCanvasContextMR.clearRect(0, 0, canvasHeight, canvasWidth) + grayCanvasContextMR.putImageData($rootScope.grayImageMRDataList[parseInt(i)], 0, 0); + } } - } - angular.forEach($rootScope.macthedTermList, function (value, key) { + angular.forEach($rootScope.macthedTermList, function (value, key) { - var TermExistInBodyRegionId = value.bodyRegionId; - console.log('3. HighlightBodyByTermListForBodySystem is called TermExistInBodyRegionId=' + TermExistInBodyRegionId); - if (TermExistInBodyRegionId != undefined) { - if (prevBRID != TermExistInBodyRegionId) { + var TermExistInBodyRegionId = value.bodyRegionId; + console.log('3. HighlightBodyByTermListForBodySystem is called TermExistInBodyRegionId=' + TermExistInBodyRegionId); + if (TermExistInBodyRegionId != undefined) { + if (prevBRID != TermExistInBodyRegionId) { - var grayCanvasID = 'imageCanvas' + TermExistInBodyRegionId; - var grayCanvas = document.getElementById(grayCanvasID); + var grayCanvasID = 'imageCanvas' + TermExistInBodyRegionId; + var grayCanvas = document.getElementById(grayCanvasID); - if (grayCanvas != null) { + if (grayCanvas != null) { - var grayCanvasContext = grayCanvas.getContext("2d"); + var grayCanvasContext = grayCanvas.getContext("2d"); - var canvasHeight = grayCanvas.height; - var canvasWidth = grayCanvas.width; - var canvasX = grayCanvas.style.left; - var canvasY = grayCanvas.style.top; + var canvasHeight = grayCanvas.height; + var canvasWidth = grayCanvas.width; + var canvasX = grayCanvas.style.left; + var canvasY = grayCanvas.style.top; - grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth) - grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(TermExistInBodyRegionId) - 1], 0, 0); + grayCanvasContext.clearRect(0, 0, canvasHeight, canvasWidth) + grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(TermExistInBodyRegionId) - 1], 0, 0); - var gData = grayCanvasContext.getImageData(0, 0, canvasWidth, canvasHeight); + var gData = grayCanvasContext.getImageData(0, 0, canvasWidth, canvasHeight); - //for mirror images - var grayCanvasMRID = 'imageCanvas' + TermExistInBodyRegionId + '_MR'; - var grayCanvasMR = document.getElementById(grayCanvasMRID); - var grayCanvasMRX; - var grayCanvasMRY; + //for mirror images + var grayCanvasMRID = 'imageCanvas' + TermExistInBodyRegionId + '_MR'; + var grayCanvasMR = document.getElementById(grayCanvasMRID); + var grayCanvasMRX; + var grayCanvasMRY; - //draw a canvas for same bodyregion wich will be flipped after coloring the body system - if (TermExistInBodyRegionId == 4 || TermExistInBodyRegionId == 5 || TermExistInBodyRegionId == 6) { + //draw a canvas for same bodyregion wich will be flipped after coloring the body system + if (TermExistInBodyRegionId == 4 || TermExistInBodyRegionId == 5 || TermExistInBodyRegionId == 6) { - var grayCanvasMRID = 'imageCanvas' + TermExistInBodyRegionId + '_MR'; - var grayCanvasMR = document.getElementById(grayCanvasMRID); - grayCanvasMRX = grayCanvasMR.style.left; - grayCanvasMRY = grayCanvasMR.style.top; + var grayCanvasMRID = 'imageCanvas' + TermExistInBodyRegionId + '_MR'; + var grayCanvasMR = document.getElementById(grayCanvasMRID); + grayCanvasMRX = grayCanvasMR.style.left; + grayCanvasMRY = grayCanvasMR.style.top; - var FlipedImgCanvas = document.createElement('canvas'); - FlipedImgCanvas.height = canvasHeight; - FlipedImgCanvas.width = canvasWidth; - FlipedImgCanvas.setAttribute("data-IsMirrored", "Y") - FlipedImgCanvas.style.position = "absolute"; - FlipedImgCanvas.style.left = canvasX + "px"; - FlipedImgCanvas.style.top = canvasY + "px"; - FlipedImgCanvas.style.visibility = 'hidden'; - FlipedImgCanvas.id = 'imageCanvas' + TermExistInBodyRegionId + '_MR'; + var FlipedImgCanvas = document.createElement('canvas'); + FlipedImgCanvas.height = canvasHeight; + FlipedImgCanvas.width = canvasWidth; + FlipedImgCanvas.setAttribute("data-IsMirrored", "Y") + FlipedImgCanvas.style.position = "absolute"; + FlipedImgCanvas.style.left = canvasX + "px"; + FlipedImgCanvas.style.top = canvasY + "px"; + FlipedImgCanvas.style.visibility = 'hidden'; + FlipedImgCanvas.id = 'imageCanvas' + TermExistInBodyRegionId + '_MR'; - //remove previous canavs - $('#' + grayCanvasMRID).remove(); + //remove previous canavs + $('#' + grayCanvasMRID).remove(); - //add new canvas on same location and after flipping it will be added to mirrored position - document.getElementById('canvasDiv').appendChild(FlipedImgCanvas); - //put grayData + //add new canvas on same location and after flipping it will be added to mirrored position + document.getElementById('canvasDiv').appendChild(FlipedImgCanvas); + //put grayData - var filppedCanvasContx = FlipedImgCanvas.getContext("2d"); - filppedCanvasContx.putImageData(gData, 0, 0); + var filppedCanvasContx = FlipedImgCanvas.getContext("2d"); + filppedCanvasContx.putImageData(gData, 0, 0); - } + } - grayImageDataVar = null; - var macthedData = new jinqJs() - .from($rootScope.macthedTermList) - .where('bodyRegionId == ' + TermExistInBodyRegionId) - .select(); + grayImageDataVar = null; + var macthedData = new jinqJs() + .from($rootScope.macthedTermList) + .where('bodyRegionId == ' + TermExistInBodyRegionId) + .select(); - var coloredImageDataVar = $rootScope.coloredImageCanvasList[parseInt(TermExistInBodyRegionId) - 1]; + var coloredImageDataVar = $rootScope.coloredImageCanvasList[parseInt(TermExistInBodyRegionId) - 1]; - var grayImageDataValue = gData.data; - var coloredImageDataValue = coloredImageDataVar.data; + var grayImageDataValue = gData.data; + var coloredImageDataValue = coloredImageDataVar.data; - angular.forEach(macthedData, function (value2, key) { + angular.forEach(macthedData, function (value2, key) { - $rootScope.termListWithLocation = value2.terms; + $rootScope.termListWithLocation = value2.terms; - //pick the color from coloredImage data and put on gray imagedata - angular.forEach($rootScope.termListWithLocation.PixelLocations, function (value1, key1) { + //pick the color from coloredImage data and put on gray imagedata + angular.forEach($rootScope.termListWithLocation.PixelLocations, function (value1, key1) { - var RED = coloredImageDataValue[value1]; - var GREEN = coloredImageDataValue[value1 + 1]; - var BLUE = coloredImageDataValue[value1 + 2]; + var RED = coloredImageDataValue[value1]; + var GREEN = coloredImageDataValue[value1 + 1]; + var BLUE = coloredImageDataValue[value1 + 2]; - grayImageDataValue[value1] = RED; - grayImageDataValue[value1 + 1] = GREEN; - grayImageDataValue[value1 + 2] = BLUE; - }) + grayImageDataValue[value1] = RED; + grayImageDataValue[value1 + 1] = GREEN; + grayImageDataValue[value1 + 2] = BLUE; + }) - //for non mirrored bpdy regions - var grayCanvasID = 'imageCanvas' + TermExistInBodyRegionId; - var grayCanvas = document.getElementById(grayCanvasID); + //for non mirrored bpdy regions + var grayCanvasID = 'imageCanvas' + TermExistInBodyRegionId; + var grayCanvas = document.getElementById(grayCanvasID); - if (grayCanvas != null) { + if (grayCanvas != null) { - var grayCanvasContext = grayCanvas.getContext("2d"); + var grayCanvasContext = grayCanvas.getContext("2d"); - grayCanvasContext.putImageData(gData, 0, 0); + grayCanvasContext.putImageData(gData, 0, 0); - } + } - //for mirror body regions - if (TermExistInBodyRegionId == 4 || TermExistInBodyRegionId == 5 || TermExistInBodyRegionId == 6) { + //for mirror body regions + if (TermExistInBodyRegionId == 4 || TermExistInBodyRegionId == 5 || TermExistInBodyRegionId == 6) { - var grayCanvasMRID = 'imageCanvas' + TermExistInBodyRegionId + '_MR'; + var grayCanvasMRID = 'imageCanvas' + TermExistInBodyRegionId + '_MR'; - var grayCanvasMR = document.getElementById(grayCanvasMRID); + var grayCanvasMR = document.getElementById(grayCanvasMRID); - if (grayCanvasMR != null) { + if (grayCanvasMR != null) { - var grayCanvasMRContext = grayCanvasMR.getContext("2d"); + var grayCanvasMRContext = grayCanvasMR.getContext("2d"); - grayCanvasMRContext.save(); - grayCanvasMRContext.translate(canvasWidth, 0); - grayCanvasMRContext.scale(-1, 1); - //flip does not work with putImageData, that is why we used drawImage - grayCanvasMRContext.drawImage(grayCanvas, 0, 0, canvasWidth, canvasHeight, 0, 0, canvasWidth, canvasHeight); - grayCanvasMRContext.restore(); + grayCanvasMRContext.save(); + grayCanvasMRContext.translate(canvasWidth, 0); + grayCanvasMRContext.scale(-1, 1); + //flip does not work with putImageData, that is why we used drawImage + grayCanvasMRContext.drawImage(grayCanvas, 0, 0, canvasWidth, canvasHeight, 0, 0, canvasWidth, canvasHeight); + grayCanvasMRContext.restore(); - //set this canavs on the actual posution of mirror image - grayCanvasMR.style.left = grayCanvasMRX; - grayCanvasMR.style.top = grayCanvasMRY; - grayCanvasMR.style.visibility = 'visible'; + //set this canavs on the actual posution of mirror image + grayCanvasMR.style.left = grayCanvasMRX; + grayCanvasMR.style.top = grayCanvasMRY; + grayCanvasMR.style.visibility = 'visible'; + } } - } - $('#spinner').css('visibility', 'hidden') - $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden') + $rootScope.isLoading = false; - prevBRID = TermExistInBodyRegionId; - }) + prevBRID = TermExistInBodyRegionId; + }) + } } } - } - else { - $('#spinner').css('visibility', 'hidden') - $rootScope.isLoading = false; - } + else { + $('#spinner').css('visibility', 'hidden') + $rootScope.isLoading = false; + } - }) + }) + + } - } - + } }, function (error) { console.log(' Error in getting term data = ' + error.statusText); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index c80cb4d..e1e571a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -90,6 +90,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.passwordMismatchMessage; $rootScope.isVisibleLogin; $rootScope.haveRoleAdmin; + $rootScope.checked = false; + $rootScope.licenseeAccountNumber = null; var isfilloptionChecked = ""; var isOutlineOptionChecked = ""; $rootScope.forgotPwdModalShow = function () @@ -127,8 +129,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic function (result) { if (result == 'true') { + $rootScope.userModules = UserModules; $rootScope.isVisibleLogin = false; + $location.path('/'); } else { if (result == LoginConstants.USER_NOT_FOUND) { @@ -147,8 +151,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic else { if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) { - if ($("#messageModal").length > 0){ - + if ($("#messageModal").length > 0){ $("#messageModal").modal('hide'); } if (result == LoginMessageConstants.INVALID_USER) { @@ -164,16 +167,43 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.haveRoleAdmin = false; localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); $('#dvUserModulesInfo').modal('show'); + $location.path('/'); } - //else if () - else if ((!result.IsSubscriptionExpired) && (result.License != null) && (result.License.IsActive) && result.IsActive) { + //else if ((!result.IsSubscriptionExpired) && (result.UserType== UserTypeConstants.CLIENT_ADMIN || result.UserType== UserTypeConstants.DISTRICT_ADMIN || result.UserType== UserTypeConstants.SINGLE_USER ||result.UserType== UserTypeConstants.RESELLER) && result.License.IsTermAccepted) {} - $rootScope.userData = result; - $rootScope.userModules = result.Modules; - $rootScope.isVisibleLogin = false; - $rootScope.haveRoleAdmin = true; - localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); - $('#dvUserModulesInfo').modal('show'); + else if ((!result.IsSubscriptionExpired) && (result.License != null) && (result.License.IsActive) && result.IsActive) { + if (result.UserType == UserTypeConstants.CLIENT_ADMIN || result.UserType == UserTypeConstants.DISTRICT_ADMIN || result.UserType == UserTypeConstants.SINGLE_USER || result.UserType == UserTypeConstants.RESELLER) { + if (result.License.IsTermAccepted) { + $rootScope.userData = result; + $rootScope.userModules = result.Modules; + $rootScope.isVisibleLogin = false; + $rootScope.haveRoleAdmin = true; + $rootScope.licenseeAccountNumber = result.License.AccountNumber; + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); + $('#dvUserModulesInfo').modal('show'); + $location.path('/'); + } + else { + if ($('#dvTerms').length > 0) { + $('#dvTerms').html(result.TermsOfServiceText); + } + $rootScope.isVisibleLogin = true; + $('#dvTermCondition').fadeIn(); + $rootScope.userData = result; + $rootScope.userModules = result.Modules; + $rootScope.haveRoleAdmin = true; + $rootScope.licenseeAccountNumber = result.License.AccountNumber; + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); + } + } + else { + $rootScope.userData = result; + $rootScope.userModules = result.Modules; + $rootScope.isVisibleLogin = false; + $rootScope.haveRoleAdmin = true; + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); + $('#dvUserModulesInfo').modal('show'); + } } else if ((!result.IsSubscriptionExpired) && (result.License != null) && (result.License.IsActive) && !result.IsActive) { $rootScope.isVisibleLogin = true; @@ -209,8 +239,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $("#messageModal").modal('show'); } } - } - + } } } }, @@ -224,6 +253,31 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } } + $rootScope.UpdateLicenseTermStatus = function () { + $('#dvTermCondition').fadeOut(); + if($rootScope.licenseeAccountNumber !=null) { + + AuthenticationService.UpdateLicenseTerm($rootScope.licenseeAccountNumber) + .then(function (result) { + console.log(' Term and Condition acceptance status updated successfully.'); + + }, + function (error) { + console.log(' Error in Term and Condition acceptance status update = ' + error);//.statusText + }); + } + var currentUserDetails = localStorage.getItem('loggedInUserDetails'); + if (currentUserDetails) { + var userInfo = JSON.parse(currentUserDetails); + + if (userInfo.loginId != undefined || userInfo.loginId != "" || userInfo.loginId != null) { + $rootScope.isVisibleLogin = false; + $rootScope.userData = userInfo; + $rootScope.userModules = userInfo.Modules; + $('#dvUserModulesInfo').modal('show'); + } + } + }; function VerifyUrlForQuerystring() { var url = $location.url(); @@ -247,8 +301,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.isVisibleLogin = true; } - function getUserDetails() { - //Retain logged in user details + function getUserDetails() { //Retain logged in user details var currentUserDetails = localStorage.getItem('loggedInUserDetails'); if (currentUserDetails) { try { @@ -3234,7 +3287,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $("#optionsListManagerTab").removeClass("active"); console.log('close'); $rootScope.disableAnnotationtoolOnListManager = false; - if ($rootScope.MenuModuleName == "DA") { + if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "AA") { $("#annotationpaintbrushsize").attr("href", "#canvasPaint"); $("#annotationpainteraser").attr("href", "#canvasPaint"); if ($rootScope.disableAnnotationtoolOnListManager == false) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 035f97e..467b1bb 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -13,6 +13,9 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $scope.dragableId = ""; $scope.blReviewAttempt = false; $scope.$on('$viewContentLoaded', function (event) { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } // code that will be executed ... // every time this view is loaded @@ -88,6 +91,9 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $scope.GetQuizByTopic = function () { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } var keywords = $location.search(); $scope.LabExerciseName = keywords.labexercise; $scope.LabExerciseModules = null; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js index c493351..6669f06 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js @@ -1,7 +1,7 @@ 'use strict'; -AIA.controller("LinkController", ["$scope", "$rootScope","$log", "pages", "$routeParams", -function ($scope, $rootScope, log, pages, $routeParams) { +AIA.controller("LinkController", ["$scope", "$rootScope", "$log", "$location", "pages", "$routeParams", +function ($scope, $rootScope, log, $location, pages, $routeParams) { //$rootScope.currentActiveModuleTitle = Modules[10].Name; //$rootScope.currentActiveModuleTitle = $routeParams.modname; @@ -17,6 +17,10 @@ function ($scope, $rootScope, log, pages, $routeParams) { ]; $scope.$on('$viewContentLoaded', function (event) { + + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } // code that will be executed ... // every time this view is loaded diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index a93eb57..48bbd55 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -86,13 +86,28 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var moduleItemDataToBeSavedID = localStorage.getItem("listViewSelectedID"); $("#list-view table tbody #" + moduleItemDataToBeSavedID).addClass("active"); $scope.isListViewButtonClicked = true; + var curAAListViewScroll = localStorage.getItem("AAListViewScroll"); + + if (typeof (curAAListViewScroll) !== "undefined" && curAAListViewScroll !== null && curAAListViewScroll !== '') { + if (typeof InstallTrigger !== 'undefined') { + + $('#list-view table tbody').animate({ scrollTop: localStorage.getItem("AAListViewScroll") }); + } + else { + + $('#list-view table tbody').scrollTop(localStorage.getItem("AAListViewScroll")); + } + + } // } }, 2000); } }; $scope.loadForModuleById = function (moduleId) { - + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } $scope.moduleId = moduleId; $scope.activeTab = 1; console.log('loadForModuleById is called') @@ -107,7 +122,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou function (result) { $scope.moduleLandingData = result; - + // setTimeout(function () { $('#' + $rootScope.highlightid).find('.thumbnail').addClass('hightlightstate'); }, 100); + if (localStorage.getItem('AAGridViewHighlightThumbnail') !== null) { + setTimeout(function () { $('#' + localStorage.getItem("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail'); }, 100); + } //console.log(JSON.stringify(result, null, 4)); }, function (error) { @@ -127,8 +145,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //}); $scope.isOpenBtnClicked = false; $scope.openModuleItemView = function (event) { - - localStorage.setItem("activeTab", $scope.activeTab); + $rootScope.MenuModuleName = "AA"; + localStorage.setItem("activeTab", $scope.activeTab); //0. Get selected Image Id if ($scope.isListViewButtonClicked == true) { if ($scope.isOpenBtnClicked == true) { @@ -163,6 +181,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //3. set opened module item ti localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]); localStorage.setItem("AAGridViewScroll", $($window).scrollTop()); + localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); + //3. Navigate to the Module-item-view var u = $location.url(); $location.url('/module-item-view'); @@ -176,6 +196,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $("#list-view table tbody tr").removeClass("active"); localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID); $("#list-view table tbody #" + moduleItemDataToBeSavedID).addClass("active"); + localStorage.setItem("AAListViewScroll", $("#list-view table tbody").scrollTop()); var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text(); $rootScope.OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData); $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3]; @@ -186,6 +207,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.openModuleItem = function () { + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } var jsContentURL; var moduleItemViewDivId; @@ -247,9 +271,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if (document.getElementById('aaDetailPageDiv') != null) { //0.4 added some stylesheets - $('.aaBodyView').css("height", $(window).outerHeight() - $('.navbar-fixed-top').height()); - $('.aaBodyView').css("width", $(window).outerWidth()); - $rootScope.canvasDivHeight = $('.aaBodyView').height(); + + $rootScope.canvasDivHeight = $('.jsPanel-content').height() - $('.main2 .stickey-area').height(); $('.canvasDivClass').css("height", $rootScope.canvasDivHeight); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js index 05e1c3b..5b8918f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js @@ -54,5 +54,23 @@ return deferred.promise; }, + UpdateLicenseTerm: function (licenseeAccountNumber) { + var deferred = $q.defer(); + + $http.post('/API/api/LicenseTermCondition', JSON.stringify(licenseeAccountNumber), { + headers: { + 'Content-Type': 'application/json' + } + }) + .success(function (data, status, headers, config) { + console.log('success') + deferred.resolve(data); + }).error(function (data, status, headers, config) { + console.log('error') + deferred.reject(status); + }); + return deferred.promise; + } + } }); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html index 18ebf96..6990188 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html @@ -2,7 +2,7 @@ .canvas-annotationStyle { display: none; background-color: transparent; - z-index: 12000; + z-index: 12001; position: absolute; left: 0; right: 0; diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 1d46045..69dafd1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -1298,6 +1298,32 @@ + +