Commit cb5759e25f88b239aa866878925e7298a6b9cdca

Authored by Utkarsh Singh
1 parent 72beab83

Committing updated files

400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj
@@ -109,6 +109,7 @@ @@ -109,6 +109,7 @@
109 <Compile Include="Controllers\AdminAccessController.cs" /> 109 <Compile Include="Controllers\AdminAccessController.cs" />
110 <Compile Include="Controllers\AuthenticateController.cs" /> 110 <Compile Include="Controllers\AuthenticateController.cs" />
111 <Compile Include="Controllers\ForgotUserController.cs" /> 111 <Compile Include="Controllers\ForgotUserController.cs" />
  112 + <Compile Include="Controllers\LicenseTermConditionController.cs" />
112 <Compile Include="Controllers\ResetPasswordController.cs" /> 113 <Compile Include="Controllers\ResetPasswordController.cs" />
113 <Compile Include="Global.asax.cs"> 114 <Compile Include="Global.asax.cs">
114 <DependentUpon>Global.asax</DependentUpon> 115 <DependentUpon>Global.asax</DependentUpon>
400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs
@@ -21,5 +21,8 @@ namespace AIAHTML5.API.Constants @@ -21,5 +21,8 @@ namespace AIAHTML5.API.Constants
21 public const string PASSWORD_UPDATE_FAILED = "Password update failed"; 21 public const string PASSWORD_UPDATE_FAILED = "Password update failed";
22 22
23 public const string INVALID_USER = "Invalid UserID"; 23 public const string INVALID_USER = "Invalid UserID";
  24 +
  25 + public const string LICENSE_TERM_CONDITION_UPDATE_SUCCESS = "License Term Accepted field updated successfully.";
  26 + public const string LICENSE_TERM_CONDITION_UPDATE_FAILED = "License Term Accepted field update failed.";
24 } 27 }
25 } 28 }
26 \ No newline at end of file 29 \ No newline at end of file
400-SOURCECODE/AIAHTML5.API/Controllers/LicenseTermConditionController.cs 0 → 100644
  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 log4net;
  8 +using AIAHTML5.API.Constants;
  9 +using Newtonsoft.Json;
  10 +using Newtonsoft.Json.Linq;
  11 +
  12 +namespace AIAHTML5.API.Controllers
  13 +{
  14 + public class LicenseTermConditionController : ApiController
  15 + {
  16 + // GET api/licensetermcondition
  17 + public IEnumerable<string> Get()
  18 + {
  19 + return new string[] { "value1", "value2" };
  20 + }
  21 +
  22 + // GET api/licensetermcondition/5
  23 + public string Get(int id)
  24 + {
  25 + return "value";
  26 + }
  27 +
  28 + // POST api/licensetermcondition
  29 + public HttpResponseMessage Post([FromBody]string licenseeAccountNumber)
  30 + {
  31 + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType));
  32 + logger.Debug("inside POST");
  33 + HttpResponseMessage response = null;
  34 +
  35 + int result = AIAHTML5.API.Models.Users.UpdateLicenseTerm(licenseeAccountNumber);
  36 + if (result > 0)
  37 + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.LICENSE_TERM_CONDITION_UPDATE_SUCCESS) };
  38 + else
  39 + response = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.LICENSE_TERM_CONDITION_UPDATE_FAILED) };
  40 +
  41 + return response;
  42 + }
  43 +
  44 +
  45 + // PUT api/licensetermcondition/5
  46 + public void Put(int id, [FromBody]string value)
  47 + {
  48 + }
  49 +
  50 + // DELETE api/licensetermcondition/5
  51 + public void Delete(int id)
  52 + {
  53 + }
  54 + }
  55 +}
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
@@ -576,9 +576,9 @@ namespace AIAHTML5.API.Models @@ -576,9 +576,9 @@ namespace AIAHTML5.API.Models
576 lic.LicenseTypeId = Convert.ToInt32(dr[dc]); 576 lic.LicenseTypeId = Convert.ToInt32(dr[dc]);
577 if (dc.ColumnName == "InstitutionName") 577 if (dc.ColumnName == "InstitutionName")
578 lic.InstitutionName = dr[dc].ToString(); 578 lic.InstitutionName = dr[dc].ToString();
579 - if (dc.ColumnName == "Adress1") 579 + if (dc.ColumnName == "Address1")
580 lic.Address1 = dr[dc].ToString(); 580 lic.Address1 = dr[dc].ToString();
581 - if (dc.ColumnName == "Adress2") 581 + if (dc.ColumnName == "Address2")
582 lic.Address2 = dr[dc].ToString(); 582 lic.Address2 = dr[dc].ToString();
583 if (dc.ColumnName == "CountryId") 583 if (dc.ColumnName == "CountryId")
584 lic.CountryId = Convert.ToInt32(dr[dc]); 584 lic.CountryId = Convert.ToInt32(dr[dc]);
@@ -592,7 +592,7 @@ namespace AIAHTML5.API.Models @@ -592,7 +592,7 @@ namespace AIAHTML5.API.Models
592 lic.Phone = dr[dc].ToString(); 592 lic.Phone = dr[dc].ToString();
593 if (dc.ColumnName == "EmailId") 593 if (dc.ColumnName == "EmailId")
594 lic.EmailId = dr[dc].ToString(); 594 lic.EmailId = dr[dc].ToString();
595 - if (dc.ColumnName == "TotalLogin") 595 + if (dc.ColumnName == "TotalLogins")
596 lic.TotalLogins = Convert.ToInt32(dr[dc]); 596 lic.TotalLogins = Convert.ToInt32(dr[dc]);
597 if (dc.ColumnName == "AccountTypeId") 597 if (dc.ColumnName == "AccountTypeId")
598 lic.AccountTypeId = Convert.ToInt32(dr[dc]); 598 lic.AccountTypeId = Convert.ToInt32(dr[dc]);
@@ -614,7 +614,7 @@ namespace AIAHTML5.API.Models @@ -614,7 +614,7 @@ namespace AIAHTML5.API.Models
614 } 614 }
615 if (dc.ColumnName == "NoOfRenewals") 615 if (dc.ColumnName == "NoOfRenewals")
616 lic.NoOfRenewals = Convert.ToInt32(dr[dc]); 616 lic.NoOfRenewals = Convert.ToInt32(dr[dc]);
617 - if (dc.ColumnName == "IsTermAccepted") 617 + if (dc.ColumnName == "IsTermsAccepted")
618 lic.IsTermAccepted = Convert.ToBoolean(dr[dc]); 618 lic.IsTermAccepted = Convert.ToBoolean(dr[dc]);
619 if (dc.ColumnName == "ProductId") 619 if (dc.ColumnName == "ProductId")
620 lic.ProductId = dr[dc].ToString(); 620 lic.ProductId = dr[dc].ToString();
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
@@ -157,14 +157,11 @@ namespace AIAHTML5.API.Models @@ -157,14 +157,11 @@ namespace AIAHTML5.API.Models
157 } 157 }
158 } 158 }
159 159
160 - internal static dynamic UpdateLicenseTerm(Newtonsoft.Json.Linq.JObject accNumber) 160 + internal static dynamic UpdateLicenseTerm(string accNumber)
161 { 161 {
162 - int result = DBModel.UpdateUserPassword(userInfo); 162 + int result = DBModel.UpdateLicenseTermStatus(accNumber);
163 163
164 - if (result != null)  
165 - return result;  
166 - else  
167 - return AIAConstants.USER_NOT_FOUND; 164 + return result;
168 } 165 }
169 } 166 }
170 } 167 }
171 \ No newline at end of file 168 \ 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.pdb
No preview for this file type
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -86,6 +86,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -86,6 +86,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
86 $rootScope.isVisibleLogin; 86 $rootScope.isVisibleLogin;
87 $rootScope.haveRoleAdmin; 87 $rootScope.haveRoleAdmin;
88 $rootScope.checked = false; 88 $rootScope.checked = false;
  89 + $rootScope.licenseeAccountNumber = null;
89 var isfilloptionChecked = ""; 90 var isfilloptionChecked = "";
90 var isOutlineOptionChecked = ""; 91 var isOutlineOptionChecked = "";
91 $rootScope.forgotPwdModalShow = function () 92 $rootScope.forgotPwdModalShow = function ()
@@ -169,6 +170,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -169,6 +170,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
169 $rootScope.userModules = result.Modules; 170 $rootScope.userModules = result.Modules;
170 $rootScope.isVisibleLogin = false; 171 $rootScope.isVisibleLogin = false;
171 $rootScope.haveRoleAdmin = true; 172 $rootScope.haveRoleAdmin = true;
  173 + $rootScope.licenseeAccountNumber = result.License.AccountNumber;
172 localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); 174 localStorage.setItem('loggedInUserDetails', JSON.stringify(result));
173 $('#dvUserModulesInfo').modal('show'); 175 $('#dvUserModulesInfo').modal('show');
174 //} 176 //}
@@ -193,8 +195,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -193,8 +195,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
193 195
194 //} 196 //}
195 197
196 - if (!result.License.IsTermAccepted) {  
197 - $('#dvTermCondition').modal('show'); 198 + if (!result.License.IsTermAccepted) {
  199 + $('#dvTermCondition').fadeIn();
  200 + //$('#dvTermCondition').modal('show');
198 } 201 }
199 } 202 }
200 else { 203 else {
@@ -254,15 +257,19 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic @@ -254,15 +257,19 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
254 } 257 }
255 258
256 } 259 }
257 - function UpdateUserTermAndCondition(accountNumber) { 260 + $rootScope.UpdateLicenseTermStatus = function () {
  261 + $('#dvTermCondition').fadeOut();
  262 + if($rootScope.licenseeAccountNumber !=null) {
258 263
259 - AuthenticationService.UpdateTermAndConditionAcceptanceStatus(accountNumber) 264 + AuthenticationService.UpdateLicenseTerm($rootScope.licenseeAccountNumber)
260 .then(function (result) { 265 .then(function (result) {
261 console.log(' Term and Condition acceptance status updated successfully.'); 266 console.log(' Term and Condition acceptance status updated successfully.');
  267 +
262 }, 268 },
263 function (error) { 269 function (error) {
264 - console.log(' Error in Term and Condition acceptance status update = ' + error.statusText); 270 + console.log(' Error in Term and Condition acceptance status update = ' + error);//.statusText
265 }); 271 });
  272 + }
266 }; 273 };
267 function VerifyUrlForQuerystring() { 274 function VerifyUrlForQuerystring() {
268 var url = $location.url(); 275 var url = $location.url();
400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js
@@ -54,10 +54,10 @@ @@ -54,10 +54,10 @@
54 return deferred.promise; 54 return deferred.promise;
55 }, 55 },
56 56
57 - UpdateTermAndConditionAcceptanceStatus: function (accountNumber) { 57 + UpdateLicenseTerm: function (licenseeAccountNumber) {
58 var deferred = $q.defer(); 58 var deferred = $q.defer();
59 59
60 - $http.put('/API/api/Authenticate', JSON.stringify(accountNumber), { 60 + $http.post('/API/api/LicenseTermCondition', JSON.stringify(licenseeAccountNumber), {
61 headers: { 61 headers: {
62 'Content-Type': 'application/json' 62 'Content-Type': 'application/json'
63 } 63 }
400-SOURCECODE/AIAHTML5.Web/index.html
@@ -1302,7 +1302,8 @@ @@ -1302,7 +1302,8 @@
1302 <div class=" fade ui-draggable in" id="dvTermCondition" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; left: 0px !important; z-index: 111111; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; right: 0px; bottom: 0px; "> 1302 <div class=" fade ui-draggable in" id="dvTermCondition" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; left: 0px !important; z-index: 111111; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; right: 0px; bottom: 0px; ">
1303 <div class="modal-dialog" role="document"> 1303 <div class="modal-dialog" role="document">
1304 <div class="modal-content"> 1304 <div class="modal-content">
1305 - <div class="modal-header ui-draggable-handle " style="color: #ffffff; background-color: #0095da; border-color: #007ab3;cursor:default;"><!--color: #e5e5e5;--> 1305 + <div class="modal-header ui-draggable-handle " style="color: #ffffff; background-color: #0095da; border-color: #007ab3;cursor:default;">
  1306 + <!--color: #e5e5e5;-->
1306 <h6 class="text-left lhgt19 padd5" style="color:#fff; text-align:left;">Terms of Service</h6> 1307 <h6 class="text-left lhgt19 padd5" style="color:#fff; text-align:left;">Terms of Service</h6>
1307 </div> 1308 </div>
1308 1309
@@ -1312,15 +1313,15 @@ @@ -1312,15 +1313,15 @@
1312 <form class="form-horizontal"> 1313 <form class="form-horizontal">
1313 <div class="form-group"> 1314 <div class="form-group">
1314 <input type="checkbox" id="chkAccept" ng-model="checked" />I accept 1315 <input type="checkbox" id="chkAccept" ng-model="checked" />I accept
1315 - <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#mymodal" ng-disabled="!checked" data-dismiss="modal"><i class="fa fa-check"></i> Next</button> 1316 + <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#mymodal" ng-disabled="!checked" data-dismiss="modal" ng-click="UpdateLicenseTermStatus()"><i class="fa fa-check"></i> Next</button>
1316 </div> 1317 </div>
1317 - </form> 1318 + </form>
  1319 + </div>
1318 </div> 1320 </div>
1319 - </div>  
1320 1321
  1322 + </div>
1321 </div> 1323 </div>
1322 </div> 1324 </div>
1323 -</div>  
1324 <script> 1325 <script>
1325 1326
1326 function enableDisableFillOption() { 1327 function enableDisableFillOption() {