Commit e6b869b17d236ce9e6bbe393e73c3c005cc596eb

Authored by Gagandeep
1 parent d3c881ae

Bug Fixing

Showing 60 changed files with 2192 additions and 747 deletions
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs
... ... @@ -57,7 +57,7 @@ namespace AIAHTML5.ADMIN.API.Controllers
57 57 public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength)
58 58 {
59 59 var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
60   - var lstExpiringSubscriptionReport = dbContext.GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList();
  60 + var lstExpiringSubscriptionReport = dbContext.usp_GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList();
61 61 return Ok(new { Subscription = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value });
62 62 }
63 63 [Route("GetSubscriptionCancellationReport")]
... ... @@ -93,7 +93,7 @@ namespace AIAHTML5.ADMIN.API.Controllers
93 93 try
94 94 {
95 95 var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
96   - var lstSiteLicenseUsageReport = dbContext.usp_GetSiteLicenseUsageReport(sFromDate, sToDate, sAccountNumber, (byte)iEdition, pageNo, pageLength, spRecordCount).ToList();
  96 + var lstSiteLicenseUsageReport = dbContext.usp_GetSiteLicenseUsageReports(sFromDate, sToDate, sAccountNumber, (byte)iEdition, pageNo, pageLength, spRecordCount).ToList();
97 97 return Ok(new { SiteLicenseUsageList = lstSiteLicenseUsageReport, RecordCount = spRecordCount.Value });
98 98 }
99 99 catch (Exception ex)
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
... ... @@ -8333,7 +8333,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]</Definin
8333 8333 <Property Type="String" Name="Title" Nullable="false" MaxLength="100" />
8334 8334 </ComplexType>
8335 8335 <ComplexType Name="usp_GetCancelledLicenses_Result">
8336   - <Property Type="Int64" Name="RowNum" Nullable="true" />
8337 8336 <Property Type="String" Name="AccountNumber" Nullable="true" MaxLength="50" />
8338 8337 <Property Type="String" Name="LicenseeName" Nullable="true" MaxLength="100" />
8339 8338 <Property Type="String" Name="LicenseType" Nullable="true" MaxLength="50" />
... ... @@ -8345,9 +8344,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8345 8344 <Property Type="String" Name="LicenseCreationDate" Nullable="true" MaxLength="30" />
8346 8345 <Property Type="Decimal" Name="SubscriptionPrice" Nullable="true" Precision="14" Scale="2" />
8347 8346 <Property Type="Int32" Name="CardNumber" Nullable="true" />
  8347 + <Property Type="Int64" Name="Serial_No" Nullable="true" />
8348 8348 </ComplexType>
8349 8349 <ComplexType Name="usp_GetCustomerSummary_Result">
8350   - <Property Type="Int64" Name="RowNum" Nullable="true" />
8351 8350 <Property Type="String" Name="AccountNumber" Nullable="true" MaxLength="50" />
8352 8351 <Property Type="String" Name="LicenseeName" Nullable="true" MaxLength="100" />
8353 8352 <Property Type="String" Name="LicenseType" Nullable="true" MaxLength="50" />
... ... @@ -8363,7 +8362,8 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8363 8362 <Property Type="String" Name="LicenseCountry" Nullable="true" MaxLength="50" />
8364 8363 <Property Type="String" Name="InstitutionName" Nullable="true" MaxLength="100" />
8365 8364 <Property Type="String" Name="LicenseCreationDate" Nullable="true" MaxLength="30" />
8366   - <Property Type="Int32" Name="CardNumber" Nullable="true" />
  8365 + <Property Type="Int32" Name="CardNumber" Nullable="false" />
  8366 + <Property Type="Int64" Name="Serial_No" Nullable="true" />
8367 8367 </ComplexType>
8368 8368 <ComplexType Name="usp_GetDiscountReport_Result">
8369 8369 <Property Type="Int64" Name="RowNum" Nullable="true" />
... ... @@ -8375,7 +8375,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8375 8375 <Property Type="Int32" Name="TotalLicenses" Nullable="true" />
8376 8376 </ComplexType>
8377 8377 <ComplexType Name="usp_GetExpiringLicenses_Result">
8378   - <Property Type="Int64" Name="RowNum" Nullable="true" />
8379 8378 <Property Type="String" Name="AccountNumber" Nullable="true" MaxLength="50" />
8380 8379 <Property Type="String" Name="LicenseeName" Nullable="true" MaxLength="100" />
8381 8380 <Property Type="String" Name="LicenseType" Nullable="true" MaxLength="50" />
... ... @@ -8388,6 +8387,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8388 8387 <Property Type="String" Name="AccountType" Nullable="true" MaxLength="50" />
8389 8388 <Property Type="Int32" Name="DaysRemaining" Nullable="true" />
8390 8389 <Property Type="Int32" Name="CardNumber" Nullable="true" />
  8390 + <Property Type="Int64" Name="Serial_No" Nullable="true" />
8391 8391 </ComplexType>
8392 8392 <ComplexType Name="usp_GetExportedImageDetails_Result">
8393 8393 <Property Type="Int64" Name="RowNum" Nullable="true" />
... ... @@ -8403,7 +8403,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8403 8403 <Property Type="Int32" Name="imageCount" Nullable="true" />
8404 8404 </ComplexType>
8405 8405 <ComplexType Name="usp_GetNetAdSummaryReport_Result">
8406   - <Property Type="Int64" Name="RowNum" Nullable="true" />
8407 8406 <Property Type="String" Name="LicenseType" Nullable="true" MaxLength="50" />
8408 8407 <Property Type="String" Name="AccountType" Nullable="true" MaxLength="50" />
8409 8408 <Property Type="String" Name="InstitutionName" Nullable="true" MaxLength="100" />
... ... @@ -8412,6 +8411,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8412 8411 <Property Type="Int32" Name="RenewSubscription" Nullable="true" />
8413 8412 <Property Type="Int32" Name="InActiveSubscription" Nullable="true" />
8414 8413 <Property Type="Int32" Name="NetAdSubscription" Nullable="true" />
  8414 + <Property Type="Int64" Name="Serial_No" Nullable="true" />
8415 8415 </ComplexType>
8416 8416 <ComplexType Name="usp_GetSiteLicenseUsageReport_Result">
8417 8417 <Property Type="Int64" Name="RowNum" Nullable="true" />
... ... @@ -8424,12 +8424,11 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8424 8424 <Property Type="String" Name="LastLogin" Nullable="true" MaxLength="30" />
8425 8425 </ComplexType>
8426 8426 <ComplexType Name="usp_GetUsageReport_Result">
8427   - <Property Type="Int64" Name="RowNum" Nullable="true" />
8428 8427 <Property Type="String" Name="LoginId" Nullable="true" MaxLength="50" />
8429 8428 <Property Type="String" Name="FirstName" Nullable="true" MaxLength="100" />
8430 8429 <Property Type="String" Name="LastName" Nullable="true" MaxLength="100" />
8431   - <Property Type="String" Name="AccountNumber" Nullable="true" MaxLength="50" />
8432   - <Property Type="Int32" Name="CardNumber" Nullable="true" />
  8430 + <Property Type="String" Name="AccountNumber" Nullable="false" MaxLength="50" />
  8431 + <Property Type="Int32" Name="CardNumber" Nullable="false" />
8433 8432 <Property Type="String" Name="UserType" Nullable="true" MaxLength="50" />
8434 8433 <Property Type="String" Name="LicenseCreationDate" Nullable="true" MaxLength="30" />
8435 8434 <Property Type="String" Name="LicenseZip" Nullable="true" MaxLength="20" />
... ... @@ -8438,6 +8437,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8438 8437 <Property Type="String" Name="InstitutionName" Nullable="true" MaxLength="100" />
8439 8438 <Property Type="Int32" Name="TotalLogins" Nullable="true" />
8440 8439 <Property Type="String" Name="LastLogin" Nullable="true" MaxLength="30" />
  8440 + <Property Type="Int64" Name="Serial_No" Nullable="true" />
8441 8441 </ComplexType>
8442 8442 <ComplexType Name="usp_GetSearchUsers_Result">
8443 8443 <Property Type="Int64" Name="RowNum" Nullable="true" />
... ... @@ -8458,7 +8458,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8458 8458 <Property Type="Int32" Name="EditionTypeId" Nullable="true" />
8459 8459 </ComplexType>
8460 8460 <ComplexType Name="usp_GetSiteLicenseUsageReports_Result">
8461   - <Property Type="Int64" Name="RowNum" Nullable="true" />
8462 8461 <Property Type="String" Name="AccountNumber" Nullable="false" MaxLength="50" />
8463 8462 <Property Type="String" Name="EditionTitle" Nullable="false" MaxLength="50" />
8464 8463 <Property Type="String" Name="ReferalUrl" Nullable="true" MaxLength="100" />
... ... @@ -8466,13 +8465,13 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8466 8465 <Property Type="String" Name="LicenseCreationDate" Nullable="true" MaxLength="30" />
8467 8466 <Property Type="Int32" Name="TotalLogins" Nullable="true" />
8468 8467 <Property Type="String" Name="LastLogin" Nullable="true" MaxLength="30" />
  8468 + <Property Type="Int64" Name="Serial_No" Nullable="true" />
8469 8469 </ComplexType>
8470 8470 <ComplexType Name="usp_GetUserTyeByAccountNumber_Result">
8471 8471 <Property Type="Byte" Name="Id" Nullable="true" />
8472 8472 <Property Type="String" Name="Title" Nullable="true" MaxLength="50" />
8473 8473 </ComplexType>
8474 8474 <ComplexType Name="usp_GetSubscribedLicenses_Result">
8475   - <Property Type="Int64" Name="RowNum" Nullable="true" />
8476 8475 <Property Type="String" Name="AccountNumber" Nullable="true" MaxLength="50" />
8477 8476 <Property Type="String" Name="LicenseeName" Nullable="true" MaxLength="100" />
8478 8477 <Property Type="String" Name="LicenseType" Nullable="true" MaxLength="50" />
... ... @@ -8483,7 +8482,8 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
8483 8482 <Property Type="String" Name="EndDate" Nullable="true" MaxLength="30" />
8484 8483 <Property Type="String" Name="LicenseCreationDate" Nullable="true" MaxLength="30" />
8485 8484 <Property Type="Decimal" Name="SubscriptionPrice" Nullable="true" Precision="14" Scale="2" />
8486   - <Property Type="Int32" Name="CardNumber" Nullable="true" />
  8485 + <Property Type="Int32" Name="CardNumber" Nullable="false" />
  8486 + <Property Type="Int64" Name="Serial_No" Nullable="true" />
8487 8487 </ComplexType>
8488 8488 <ComplexType Name="usp_GetBlockedUserByAccNoAndType_Result">
8489 8489 <Property Type="Int32" Name="Id" Nullable="false" />
... ... @@ -11170,7 +11170,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11170 11170 <FunctionImportMapping FunctionImportName="usp_GetCancelledLicenses" FunctionName="AIADatabaseV5Model.Store.usp_GetCancelledLicenses">
11171 11171 <ResultMapping>
11172 11172 <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetCancelledLicenses_Result">
11173   - <ScalarProperty Name="RowNum" ColumnName="RowNum" />
11174 11173 <ScalarProperty Name="AccountNumber" ColumnName="AccountNumber" />
11175 11174 <ScalarProperty Name="LicenseeName" ColumnName="LicenseeName" />
11176 11175 <ScalarProperty Name="LicenseType" ColumnName="LicenseType" />
... ... @@ -11182,13 +11181,13 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11182 11181 <ScalarProperty Name="LicenseCreationDate" ColumnName="LicenseCreationDate" />
11183 11182 <ScalarProperty Name="SubscriptionPrice" ColumnName="SubscriptionPrice" />
11184 11183 <ScalarProperty Name="CardNumber" ColumnName="CardNumber" />
  11184 + <ScalarProperty Name="Serial_No" ColumnName="Serial_No" />
11185 11185 </ComplexTypeMapping>
11186 11186 </ResultMapping>
11187 11187 </FunctionImportMapping>
11188 11188 <FunctionImportMapping FunctionImportName="usp_GetCustomerSummary" FunctionName="AIADatabaseV5Model.Store.usp_GetCustomerSummary">
11189 11189 <ResultMapping>
11190 11190 <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetCustomerSummary_Result">
11191   - <ScalarProperty Name="RowNum" ColumnName="RowNum" />
11192 11191 <ScalarProperty Name="AccountNumber" ColumnName="AccountNumber" />
11193 11192 <ScalarProperty Name="LicenseeName" ColumnName="LicenseeName" />
11194 11193 <ScalarProperty Name="LicenseType" ColumnName="LicenseType" />
... ... @@ -11205,6 +11204,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11205 11204 <ScalarProperty Name="InstitutionName" ColumnName="InstitutionName" />
11206 11205 <ScalarProperty Name="LicenseCreationDate" ColumnName="LicenseCreationDate" />
11207 11206 <ScalarProperty Name="CardNumber" ColumnName="CardNumber" />
  11207 + <ScalarProperty Name="Serial_No" ColumnName="Serial_No" />
11208 11208 </ComplexTypeMapping>
11209 11209 </ResultMapping>
11210 11210 </FunctionImportMapping>
... ... @@ -11224,7 +11224,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11224 11224 <FunctionImportMapping FunctionImportName="usp_GetExpiringLicenses" FunctionName="AIADatabaseV5Model.Store.usp_GetExpiringLicenses">
11225 11225 <ResultMapping>
11226 11226 <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetExpiringLicenses_Result">
11227   - <ScalarProperty Name="RowNum" ColumnName="RowNum" />
11228 11227 <ScalarProperty Name="AccountNumber" ColumnName="AccountNumber" />
11229 11228 <ScalarProperty Name="LicenseeName" ColumnName="LicenseeName" />
11230 11229 <ScalarProperty Name="LicenseType" ColumnName="LicenseType" />
... ... @@ -11237,6 +11236,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11237 11236 <ScalarProperty Name="AccountType" ColumnName="AccountType" />
11238 11237 <ScalarProperty Name="DaysRemaining" ColumnName="DaysRemaining" />
11239 11238 <ScalarProperty Name="CardNumber" ColumnName="CardNumber" />
  11239 + <ScalarProperty Name="Serial_No" ColumnName="Serial_No" />
11240 11240 </ComplexTypeMapping>
11241 11241 </ResultMapping>
11242 11242 </FunctionImportMapping>
... ... @@ -11260,7 +11260,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11260 11260 <FunctionImportMapping FunctionImportName="usp_GetNetAdSummaryReport" FunctionName="AIADatabaseV5Model.Store.usp_GetNetAdSummaryReport">
11261 11261 <ResultMapping>
11262 11262 <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetNetAdSummaryReport_Result">
11263   - <ScalarProperty Name="RowNum" ColumnName="RowNum" />
11264 11263 <ScalarProperty Name="LicenseType" ColumnName="LicenseType" />
11265 11264 <ScalarProperty Name="AccountType" ColumnName="AccountType" />
11266 11265 <ScalarProperty Name="InstitutionName" ColumnName="InstitutionName" />
... ... @@ -11269,6 +11268,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11269 11268 <ScalarProperty Name="RenewSubscription" ColumnName="RenewSubscription" />
11270 11269 <ScalarProperty Name="InActiveSubscription" ColumnName="InActiveSubscription" />
11271 11270 <ScalarProperty Name="NetAdSubscription" ColumnName="NetAdSubscription" />
  11271 + <ScalarProperty Name="Serial_No" ColumnName="Serial_No" />
11272 11272 </ComplexTypeMapping>
11273 11273 </ResultMapping>
11274 11274 </FunctionImportMapping>
... ... @@ -11289,7 +11289,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11289 11289 <FunctionImportMapping FunctionImportName="usp_GetUsageReport" FunctionName="AIADatabaseV5Model.Store.usp_GetUsageReport">
11290 11290 <ResultMapping>
11291 11291 <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetUsageReport_Result">
11292   - <ScalarProperty Name="RowNum" ColumnName="RowNum" />
11293 11292 <ScalarProperty Name="LoginId" ColumnName="LoginId" />
11294 11293 <ScalarProperty Name="FirstName" ColumnName="FirstName" />
11295 11294 <ScalarProperty Name="LastName" ColumnName="LastName" />
... ... @@ -11303,6 +11302,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11303 11302 <ScalarProperty Name="InstitutionName" ColumnName="InstitutionName" />
11304 11303 <ScalarProperty Name="TotalLogins" ColumnName="TotalLogins" />
11305 11304 <ScalarProperty Name="LastLogin" ColumnName="LastLogin" />
  11305 + <ScalarProperty Name="Serial_No" ColumnName="Serial_No" />
11306 11306 </ComplexTypeMapping>
11307 11307 </ResultMapping>
11308 11308 </FunctionImportMapping>
... ... @@ -11331,7 +11331,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11331 11331 <FunctionImportMapping FunctionImportName="usp_GetSiteLicenseUsageReports" FunctionName="AIADatabaseV5Model.Store.usp_GetSiteLicenseUsageReports">
11332 11332 <ResultMapping>
11333 11333 <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetSiteLicenseUsageReports_Result">
11334   - <ScalarProperty Name="RowNum" ColumnName="RowNum" />
11335 11334 <ScalarProperty Name="AccountNumber" ColumnName="AccountNumber" />
11336 11335 <ScalarProperty Name="EditionTitle" ColumnName="EditionTitle" />
11337 11336 <ScalarProperty Name="ReferalUrl" ColumnName="ReferalUrl" />
... ... @@ -11339,6 +11338,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11339 11338 <ScalarProperty Name="LicenseCreationDate" ColumnName="LicenseCreationDate" />
11340 11339 <ScalarProperty Name="TotalLogins" ColumnName="TotalLogins" />
11341 11340 <ScalarProperty Name="LastLogin" ColumnName="LastLogin" />
  11341 + <ScalarProperty Name="Serial_No" ColumnName="Serial_No" />
11342 11342 </ComplexTypeMapping>
11343 11343 </ResultMapping>
11344 11344 </FunctionImportMapping>
... ... @@ -11353,7 +11353,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11353 11353 <FunctionImportMapping FunctionImportName="usp_GetSubscribedLicenses" FunctionName="AIADatabaseV5Model.Store.usp_GetSubscribedLicenses">
11354 11354 <ResultMapping>
11355 11355 <ComplexTypeMapping TypeName="AIADatabaseV5Model.usp_GetSubscribedLicenses_Result">
11356   - <ScalarProperty Name="RowNum" ColumnName="RowNum" />
11357 11356 <ScalarProperty Name="AccountNumber" ColumnName="AccountNumber" />
11358 11357 <ScalarProperty Name="LicenseeName" ColumnName="LicenseeName" />
11359 11358 <ScalarProperty Name="LicenseType" ColumnName="LicenseType" />
... ... @@ -11365,6 +11364,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
11365 11364 <ScalarProperty Name="LicenseCreationDate" ColumnName="LicenseCreationDate" />
11366 11365 <ScalarProperty Name="SubscriptionPrice" ColumnName="SubscriptionPrice" />
11367 11366 <ScalarProperty Name="CardNumber" ColumnName="CardNumber" />
  11367 + <ScalarProperty Name="Serial_No" ColumnName="Serial_No" />
11368 11368 </ComplexTypeMapping>
11369 11369 </ResultMapping>
11370 11370 </FunctionImportMapping>
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs
... ... @@ -13,7 +13,6 @@ namespace AIAHTML5.ADMIN.API.Entity
13 13  
14 14 public partial class usp_GetCancelledLicenses_Result
15 15 {
16   - public Nullable<long> RowNum { get; set; }
17 16 public string AccountNumber { get; set; }
18 17 public string LicenseeName { get; set; }
19 18 public string LicenseType { get; set; }
... ... @@ -25,5 +24,6 @@ namespace AIAHTML5.ADMIN.API.Entity
25 24 public string LicenseCreationDate { get; set; }
26 25 public Nullable<decimal> SubscriptionPrice { get; set; }
27 26 public Nullable<int> CardNumber { get; set; }
  27 + public Nullable<long> Serial_No { get; set; }
28 28 }
29 29 }
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs
... ... @@ -13,7 +13,6 @@ namespace AIAHTML5.ADMIN.API.Entity
13 13  
14 14 public partial class usp_GetCustomerSummary_Result
15 15 {
16   - public Nullable<long> RowNum { get; set; }
17 16 public string AccountNumber { get; set; }
18 17 public string LicenseeName { get; set; }
19 18 public string LicenseType { get; set; }
... ... @@ -29,6 +28,7 @@ namespace AIAHTML5.ADMIN.API.Entity
29 28 public string LicenseCountry { get; set; }
30 29 public string InstitutionName { get; set; }
31 30 public string LicenseCreationDate { get; set; }
32   - public Nullable<int> CardNumber { get; set; }
  31 + public int CardNumber { get; set; }
  32 + public Nullable<long> Serial_No { get; set; }
33 33 }
34 34 }
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs
... ... @@ -13,7 +13,6 @@ namespace AIAHTML5.ADMIN.API.Entity
13 13  
14 14 public partial class usp_GetExpiringLicenses_Result
15 15 {
16   - public Nullable<long> RowNum { get; set; }
17 16 public string AccountNumber { get; set; }
18 17 public string LicenseeName { get; set; }
19 18 public string LicenseType { get; set; }
... ... @@ -26,5 +25,6 @@ namespace AIAHTML5.ADMIN.API.Entity
26 25 public string AccountType { get; set; }
27 26 public Nullable<int> DaysRemaining { get; set; }
28 27 public Nullable<int> CardNumber { get; set; }
  28 + public Nullable<long> Serial_No { get; set; }
29 29 }
30 30 }
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs
... ... @@ -13,7 +13,6 @@ namespace AIAHTML5.ADMIN.API.Entity
13 13  
14 14 public partial class usp_GetNetAdSummaryReport_Result
15 15 {
16   - public Nullable<long> RowNum { get; set; }
17 16 public string LicenseType { get; set; }
18 17 public string AccountType { get; set; }
19 18 public string InstitutionName { get; set; }
... ... @@ -22,5 +21,6 @@ namespace AIAHTML5.ADMIN.API.Entity
22 21 public Nullable<int> RenewSubscription { get; set; }
23 22 public Nullable<int> InActiveSubscription { get; set; }
24 23 public Nullable<int> NetAdSubscription { get; set; }
  24 + public Nullable<long> Serial_No { get; set; }
25 25 }
26 26 }
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs
... ... @@ -13,7 +13,6 @@ namespace AIAHTML5.ADMIN.API.Entity
13 13  
14 14 public partial class usp_GetSiteLicenseUsageReports_Result
15 15 {
16   - public Nullable<long> RowNum { get; set; }
17 16 public string AccountNumber { get; set; }
18 17 public string EditionTitle { get; set; }
19 18 public string ReferalUrl { get; set; }
... ... @@ -21,5 +20,6 @@ namespace AIAHTML5.ADMIN.API.Entity
21 20 public string LicenseCreationDate { get; set; }
22 21 public Nullable<int> TotalLogins { get; set; }
23 22 public string LastLogin { get; set; }
  23 + public Nullable<long> Serial_No { get; set; }
24 24 }
25 25 }
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs
... ... @@ -13,7 +13,6 @@ namespace AIAHTML5.ADMIN.API.Entity
13 13  
14 14 public partial class usp_GetSubscribedLicenses_Result
15 15 {
16   - public Nullable<long> RowNum { get; set; }
17 16 public string AccountNumber { get; set; }
18 17 public string LicenseeName { get; set; }
19 18 public string LicenseType { get; set; }
... ... @@ -24,6 +23,7 @@ namespace AIAHTML5.ADMIN.API.Entity
24 23 public string EndDate { get; set; }
25 24 public string LicenseCreationDate { get; set; }
26 25 public Nullable<decimal> SubscriptionPrice { get; set; }
27   - public Nullable<int> CardNumber { get; set; }
  26 + public int CardNumber { get; set; }
  27 + public Nullable<long> Serial_No { get; set; }
28 28 }
29 29 }
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs
... ... @@ -13,12 +13,11 @@ namespace AIAHTML5.ADMIN.API.Entity
13 13  
14 14 public partial class usp_GetUsageReport_Result
15 15 {
16   - public Nullable<long> RowNum { get; set; }
17 16 public string LoginId { get; set; }
18 17 public string FirstName { get; set; }
19 18 public string LastName { get; set; }
20 19 public string AccountNumber { get; set; }
21   - public Nullable<int> CardNumber { get; set; }
  20 + public int CardNumber { get; set; }
22 21 public string UserType { get; set; }
23 22 public string LicenseCreationDate { get; set; }
24 23 public string LicenseZip { get; set; }
... ... @@ -27,5 +26,6 @@ namespace AIAHTML5.ADMIN.API.Entity
27 26 public string InstitutionName { get; set; }
28 27 public Nullable<int> TotalLogins { get; set; }
29 28 public string LastLogin { get; set; }
  29 + public Nullable<long> Serial_No { get; set; }
30 30 }
31 31 }
... ...
400-SOURCECODE/Admin/src/app/app.component.ts
1 1 import { Component, OnInit } from '@angular/core';
2   -import { UserService } from './components/UserEntity/user.service';
3   -import { ManageDiscountCodeService } from './components/ManageDiscountCode/managediscountcode.service';
4   -import { SubscriptionPriceService } from './components/SubscriptionPrice/subscriptionprice.service';
5   -import { LicenseService } from './components/LicenseEntity/license.service';
6   -import { ReportService } from './components/Reports/report.service';
  2 +import { UserService } from './components/userentity/user.service';
  3 +import { ManageDiscountCodeService } from './components/managediscountcode/managediscountcode.service';
  4 +import { SubscriptionPriceService } from './components/subscriptionprice/subscriptionprice.service';
  5 +import { LicenseService } from './components/licenseentity/license.service';
  6 +import { ReportService } from './components/reports/report.service';
7 7 //import { MyAuthService } from './shared/my-auth.service';
8   -import { GlobalService } from './Shared/global';
  8 +import { GlobalService } from './shared/global';
9 9 import { Router, NavigationEnd } from '@angular/router';
10 10 //import { HttpClient } from '@angular/common/http';
11 11 //import { HttpErrorResponse } from '@angular/common/http';
... ... @@ -22,21 +22,23 @@ export class AppComponent implements OnInit {
22 22 public objMenu: any;
23 23 public menustaus: string;
24 24 public submenustaus: string;
25   -
  25 + public UpdateProfileVisible: boolean;
26 26 constructor(private userservice: UserService, public global: GlobalService, private router: Router
27 27 ) { }
28 28 ngOnInit(): void {
29   - this.menustaus = "True";
  29 + this.menustaus = "True";
30 30 this.global.getJSON().subscribe(data => {
31 31 this.obj = data["AdminSections"]
32 32 for (let i = 0; i < 7; i++) {
33 33  
34   - if (this.obj[i].Id == this.global.UserType) {
35   - this.objMenu = this.obj[i].HeaderMenu;
  34 + if (this.obj[i].Id == this.global.UserType) {
  35 + this.objMenu = this.obj[i].HeaderMenu;
  36 + this.router.navigate(['/updateuserprofile']);
36 37 }
37 38 }
38 39 }, error => console.log(error));
39   - this.router.navigate(['/updateuserprofile']);
  40 +
  41 +
40 42 }
41 43 logout() {
42 44 localStorage.removeItem('loggedInUserDetails');
... ...
400-SOURCECODE/Admin/src/app/app.module.ts
... ... @@ -5,49 +5,54 @@ import { RouterModule, Routes } from &#39;@angular/router&#39;;
5 5 import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
6 6 import { APP_BASE_HREF } from '@angular/common';
7 7 import { HttpModule } from '@angular/http';
  8 +//import { Ng2SmartTableModule } from 'ng2-smart-table';
8 9 import { Ng2Bs3ModalModule } from 'ng2-bs3-modal/ng2-bs3-modal';
9 10 import { CsvService } from "angular2-json2csv";
  11 +import { BsDatepickerModule, ModalModule } from 'ngx-bootstrap';
  12 +import { BsModalService } from 'ngx-bootstrap/modal';
  13 +import { BsDropdownModule } from 'ngx-bootstrap';
  14 +import { Ng2OrderModule } from 'ng2-order-pipe'; //importing the module
  15 +
10 16 //import { ModalModule } from 'ngx-bootstrap/modal';
11   -import { UpdateUserProfile } from './components/UserEntity/updateuserprofile.component';
12   -import { ChangeUserPassword } from './components/UserEntity/changeuserpassword.component';
13   -import { ChangeUserID } from './components/UserEntity/changeuserid.component';
14   -import { UsersList } from './components/UserEntity/users.component';
15   -import { AddUser } from './components/UserEntity/adduser.component';
16   -import { UnblockUser } from './components/UserEntity/unblockuser.component';
17   -import { ManageDiscountCode } from './components/ManageDiscountCode/managediscountcode.component';
18   -import { SubscriptionPrice } from './components/SubscriptionPrice/subscriptionprice.component';
19   -import { SearchLicense } from './components/LicenseEntity/searchlicense.component';
20   -import { AddLicense } from './components/LicenseEntity/addlicense.component';
21   -import { UsageReport } from './components/Reports/usagereport.component';
22   -import { CustomerSummaryReport } from './components/Reports/customersummaryreport.component';
23   -import { ExpiringSubscriptionReport } from './components/Reports/expiringsubscriptionreport.component';
24   -import { SubscriptionReport } from './components/Reports/subscriptionreport.component';
25   -import { SubscriptionCancellationReport } from './components/Reports/subscriptioncancellationreport.component';
26   -import { NetAdSubscriptionReport } from './components/Reports/netadsubscriptionreport.component';
27   -import { SiteLicenseUsageReport } from './components/Reports/sitelicenseusagereport.component';
28   -import { DiscountCodeReport } from './components/Reports/discountcodereport.component';
29   -import { ImageExportReport } from './components/Reports/imageexportreport.component';
30   -import { EditLicenseBasicSettings } from './components/LicenseEntity/editlicensebasicsettings.component';
31   -import { LicenseModestySettings } from './components/LicenseEntity/licensemodestysettings.component';
32   -import { LicenseModuleSettings } from './components/LicenseEntity/licensemodulesettings.component';
33   -import { SiteLicenseAccount } from './components/LicenseEntity/sitelicenseaccount.component';
34   -import { UserGroup } from './components/UserEntity/usergroup.component';
  17 +import { UpdateUserProfile } from './components/userentity/updateuserprofile.component';
  18 +import { ChangeUserPassword } from './components/userentity/changeuserpassword.component';
  19 +import { ChangeUserID } from './components/userentity/changeuserid.component';
  20 +import { UsersList } from './components/userentity/users.component';
  21 +import { AddUser } from './components/userentity/adduser.component';
  22 +import { UnblockUser } from './components/userentity/unblockuser.component';
  23 +import { ManageDiscountCode } from './components/managediscountcode/managediscountcode.component';
  24 +import { SubscriptionPrice } from './components/subscriptionprice/subscriptionprice.component';
  25 +import { SearchLicense } from './components/licenseentity/searchlicense.component';
  26 +import { AddLicense } from './components/licenseentity/addlicense.component';
  27 +import { UsageReport } from './components/reports/usagereport.component';
  28 +import { CustomerSummaryReport } from './components/reports/customersummaryreport.component';
  29 +import { ExpiringSubscriptionReport } from './components/reports/expiringsubscriptionreport.component';
  30 +import { SubscriptionReport } from './components/reports/subscriptionreport.component';
  31 +import { SubscriptionCancellationReport } from './components/reports/subscriptioncancellationreport.component';
  32 +import { NetAdSubscriptionReport } from './components/reports/netadsubscriptionreport.component';
  33 +import { SiteLicenseUsageReport } from './components/reports/sitelicenseusagereport.component';
  34 +import { DiscountCodeReport } from './components/reports/discountcodereport.component';
  35 +import { ImageExportReport } from './components/reports/imageexportreport.component';
  36 +import { EditLicenseBasicSettings } from './components/licenseentity/editlicensebasicsettings.component';
  37 +import { LicenseModestySettings } from './components/licenseentity/licensemodestysettings.component';
  38 +import { LicenseModuleSettings } from './components/licenseentity/licensemodulesettings.component';
  39 +import { SiteLicenseAccount } from './components/licenseentity/sitelicenseaccount.component';
  40 +import { UserGroup } from './components/userentity/usergroup.component';
35 41 import { AppComponent } from './app.component';
36 42 import { AppRoutingModule } from './app.routing.module';
37 43 //import { AuthGuard } from '../app/authguard.service';
38 44 //import { AuthService } from '../app/auth.service';
39 45 //import { MyInterceptor } from '../app/token.interceptor';
40   -import { GlobalService } from './Shared/global';
41   -import { ConfirmService } from './Shared/Confirm/confirm.service';
42   -import { ConfirmComponent } from "./Shared/Confirm/confirm.component"
43   -import { BsDatepickerModule, ModalModule } from 'ngx-bootstrap';
44   -import { BsModalService } from 'ngx-bootstrap/modal';
  46 +import { GlobalService } from './shared/global';
  47 +import { ConfirmService } from './shared/confirm/confirm.service';
  48 +import { ConfirmComponent } from "./shared/confirm/confirm.component"
  49 +
45 50 import { ContenteditableModelDirective } from './shared/contenteditabledirective';
46 51 import { LoadingService } from './shared/loading.service';
47   -import { PagerComponent } from './shared/Pager/pager.component';
  52 +import { PagerComponent } from './shared/pager/pager.component';
48 53 import { NumberOnlyDirective } from './shared/numberonlydirective';
49 54 import { MyFilterPipe } from './shared/my-filter.pipe';
50   -import { BsDropdownModule } from 'ngx-bootstrap';
  55 +
51 56 //import { MyAuthService } from './shared/my-auth.service';
52 57 //import { AngularFireAuth } from 'angularfire2/auth';
53 58 //import { FirebaseApp, AngularFireModule } from 'angularfire2';
... ... @@ -78,7 +83,8 @@ import { BsDropdownModule } from &#39;ngx-bootstrap&#39;;
78 83 ],
79 84 imports: [
80 85 BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule,
81   - BsDatepickerModule.forRoot(), ModalModule.forRoot(), BsDropdownModule.forRoot()//ModalModule.forRoot()
  86 + BsDatepickerModule.forRoot(), ModalModule.forRoot(), BsDropdownModule.forRoot(), Ng2OrderModule
  87 + //ModalModule.forRoot()
82 88 // , AngularFireModule.initializeApp(firebaseConfig),
83 89 ],
84 90 providers: [GlobalService, ConfirmService, BsModalService, LoadingService, CsvService,
... ...
400-SOURCECODE/Admin/src/app/app.routing.module.ts
1 1 import { NgModule } from '@angular/core';
2 2 import { RouterModule, Routes } from '@angular/router';
3   -import { UpdateUserProfile } from './components/UserEntity/updateuserprofile.component';
4   -import { ChangeUserPassword } from './components/UserEntity/changeuserpassword.component';
5   -import { ChangeUserID } from './components/UserEntity/changeuserid.component';
6   -import { UsersList } from './components/UserEntity/users.component';
7   -import { UnblockUser } from './components/UserEntity/unblockuser.component';
8   -import { ManageDiscountCode } from './components/ManageDiscountCode/managediscountcode.component';
9   -import { SubscriptionPrice } from './components/SubscriptionPrice/subscriptionprice.component';
10   -import { AddUser } from './components/UserEntity/adduser.component';
11   -import { SearchLicense } from './components/LicenseEntity/searchlicense.component';
12   -import { AddLicense } from './components/LicenseEntity/addlicense.component';
13   -import { UsageReport } from './components/Reports/usagereport.component';
14   -import { CustomerSummaryReport } from './components/Reports/customersummaryreport.component';
15   -import { ExpiringSubscriptionReport } from './components/Reports/expiringsubscriptionreport.component';
16   -import { SubscriptionReport } from './components/Reports/subscriptionreport.component';
17   -import { SubscriptionCancellationReport } from './components/Reports/subscriptioncancellationreport.component';
18   -import { NetAdSubscriptionReport } from './components/Reports/netadsubscriptionreport.component';
19   -import { SiteLicenseUsageReport } from './components/Reports/sitelicenseusagereport.component';
20   -import { DiscountCodeReport } from './components/Reports/discountcodereport.component';
21   -import { ImageExportReport } from './components/Reports/imageexportreport.component';
22   -import { EditLicenseBasicSettings } from './components/LicenseEntity/editlicensebasicsettings.component';
23   -import { LicenseModestySettings } from './components/LicenseEntity/licensemodestysettings.component';
24   -import { LicenseModuleSettings } from './components/LicenseEntity/licensemodulesettings.component';
25   -import { SiteLicenseAccount } from './components/LicenseEntity/sitelicenseaccount.component';
26   -import { UserGroup } from './components/UserEntity/usergroup.component';
  3 +import { UpdateUserProfile } from './components/userentity/updateuserprofile.component';
  4 +import { ChangeUserPassword } from './components/userentity/changeuserpassword.component';
  5 +import { ChangeUserID } from './components/userentity/changeuserid.component';
  6 +import { UsersList } from './components/userentity/users.component';
  7 +import { UnblockUser } from './components/userentity/unblockuser.component';
  8 +import { ManageDiscountCode } from './components/managediscountcode/managediscountcode.component';
  9 +import { SubscriptionPrice } from './components/subscriptionprice/subscriptionprice.component';
  10 +import { AddUser } from './components/userentity/adduser.component';
  11 +import { SearchLicense } from './components/licenseentity/searchlicense.component';
  12 +import { AddLicense } from './components/licenseentity/addlicense.component';
  13 +import { UsageReport } from './components/reports/usagereport.component';
  14 +import { CustomerSummaryReport } from './components/reports/customersummaryreport.component';
  15 +import { ExpiringSubscriptionReport } from './components/reports/expiringsubscriptionreport.component';
  16 +import { SubscriptionReport } from './components/reports/subscriptionreport.component';
  17 +import { SubscriptionCancellationReport } from './components/reports/subscriptioncancellationreport.component';
  18 +import { NetAdSubscriptionReport } from './components/reports/netadsubscriptionreport.component';
  19 +import { SiteLicenseUsageReport } from './components/reports/sitelicenseusagereport.component';
  20 +import { DiscountCodeReport } from './components/reports/discountcodereport.component';
  21 +import { ImageExportReport } from './components/reports/imageexportreport.component';
  22 +import { EditLicenseBasicSettings } from './components/licenseentity/editlicensebasicsettings.component';
  23 +import { LicenseModestySettings } from './components/licenseentity/licensemodestysettings.component';
  24 +import { LicenseModuleSettings } from './components/licenseentity/licensemodulesettings.component';
  25 +import { SiteLicenseAccount } from './components/licenseentity/sitelicenseaccount.component';
  26 +import { UserGroup } from './components/userentity/usergroup.component';
27 27 const appRoutes: Routes = [
28 28 //{ path: '', redirectTo:'updateuserprofile',pathMatch }
29 29 { path: 'updateuserprofile', component: UpdateUserProfile },
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/addlicense.component.ts
1 1 import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core';
2 2 import { LicenseService } from './license.service';
3   -import { GlobalService } from '../../Shared/global';
  3 +import { GlobalService } from '../../shared/global';
4 4 import { Router, ActivatedRoute } from '@angular/router';
5 5 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
6   -import { License } from '../UserEntity/datamodel';
  6 +import { License } from '../userentity/datamodel';
7 7 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
8 8 import { Http, Response } from '@angular/http';
9 9 import { DatePipe } from '@angular/common';
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html
... ... @@ -43,7 +43,7 @@
43 43  
44 44 <div class="form-group">
45 45 <label for="inputEmail3" class="col-sm-4 control-label">Account Number :</label>
46   - <div class="col-sm-7" dropdown (isOpenChange)="onOpenChange($event)">
  46 + <div class="col-sm-7" dropdown (isOpenChange)="onOpenChange($event)" (keyup)="onKeyPress($event)">
47 47 <button id="button-basic" dropdownToggle type="button" class="btn btn-primary dropdown-toggle col-sm-12 col-xs-12"
48 48 aria-controls="dropdown-basic" style="height: 30px;">
49 49 <span class="pull-left" style="margin-top: -1px;">{{accountDropDownText}}</span>
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts
1 1 import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core';
2 2 import { LicenseService } from './license.service';
3   -import { GlobalService } from '../../Shared/global';
  3 +import { GlobalService } from '../../shared/global';
4 4 import { Router, ActivatedRoute } from '@angular/router';
5 5 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
6   -import { License } from '../UserEntity/datamodel';
  6 +import { License } from '../userentity/datamodel';
7 7 import { BsDatepickerModule } from 'ngx-bootstrap';
8 8 import { Http, Response } from '@angular/http';
9 9 import { DatePipe } from '@angular/common';
10 10 import { BsModalService } from 'ngx-bootstrap/modal';
11 11 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
12 12 import { ContenteditableModelDirective } from '../../shared/contenteditabledirective'
13   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  13 +import { ConfirmService } from '../../shared/confirm/confirm.service';
14 14 @Component({
15   - templateUrl: './editlicensebasicsettings.component.html'
  15 + templateUrl: './editlicensebasicsettings.component.html'
16 16 })
17 17  
18 18 export class EditLicenseBasicSettings implements OnInit {
19 19  
20   - lstAccountNumbers: any;
21   - tempLstAccountNumbers: any;
22   - lstCountry: any;
23   - lstState: any;
24   - license: License;
25   - updateLicenseBasicSettingsFrm: FormGroup;
26   - error: any;
27   - alerts: string;
28   - modalAlerts: string;
29   - modalRef: BsModalRef;
30   - ConvertedPhoneno: string;
31   - MinusCharater: number;
32   - accountDropDownText: string;
33   - loopIdx: number;
34   -
35   - constructor(private licenseService: LicenseService,
36   - private globalService: GlobalService, private router: Router,
37   - private activeRoute: ActivatedRoute, private fb: FormBuilder,
38   - private modalService: BsModalService, private _confirmService: ConfirmService) { }
39   -
40   - ngOnInit(): void
41   - {
42   - this.license = new License();
43   - this.alerts = '';
44   - this.accountDropDownText = 'Select';
45   - this.loopIdx = 0;
46   - this.updateLicenseBasicSettingsFrm = this.fb.group({
47   - licenseId: [0],
48   - accountNumber: ['', Validators.required],
49   - licenseeFirstName: ['', Validators.required],
50   - licenseeLastName: ['', Validators.required],
51   - institutionName: ['', Validators.required],
52   - address1: ['', Validators.required],
53   - address2: [''],
54   - city: ['', Validators.required],
55   - stateId: [0],
56   - countryId: [0],
57   - zip: ['', Validators.required],
58   - emailId: ['', [Validators.required, Validators.email]],
59   - phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]],
60   - });
61   - this.GetCountry();
62   - this.GetState();
63   - this.GetLicenseAccounts();
64   - }
65   -
66   - openModal(template: TemplateRef<any>) {
67   - this.modalRef = this.modalService.show(template);
68   - }
69   -
70   - GetCountry() {
71   - this.licenseService.GetCountry()
72   - .subscribe(y => { this.lstCountry = y; }, error => this.error = <any>error);
73   - }
74   -
75   - GetState() {
76   - this.licenseService.GetState()
77   - .subscribe(st => { this.lstState = st; }, error => this.error = <any>error);
  20 + lstAccountNumbers: any;
  21 + tempLstAccountNumbers: any;
  22 + lstCountry: any;
  23 + lstState: any;
  24 + license: License;
  25 + updateLicenseBasicSettingsFrm: FormGroup;
  26 + error: any;
  27 + alerts: string;
  28 + modalAlerts: string;
  29 + modalRef: BsModalRef;
  30 + ConvertedPhoneno: string;
  31 + MinusCharater: number;
  32 + accountDropDownText: string;
  33 + loopIdx1: number;
  34 + loopIdx2: number;
  35 + lastScrollPos: number;
  36 +
  37 + constructor(private licenseService: LicenseService,
  38 + private globalService: GlobalService, private router: Router,
  39 + private activeRoute: ActivatedRoute, private fb: FormBuilder,
  40 + private modalService: BsModalService, private _confirmService: ConfirmService) { }
  41 +
  42 + ngOnInit(): void {
  43 + this.license = new License();
  44 + this.alerts = '';
  45 + this.accountDropDownText = 'Select';
  46 + this.loopIdx1 = 0;
  47 + this.loopIdx2 = 0;
  48 + this.lastScrollPos = 0;
  49 + this.updateLicenseBasicSettingsFrm = this.fb.group({
  50 + licenseId: [0],
  51 + accountNumber: ['', Validators.required],
  52 + licenseeFirstName: ['', Validators.required],
  53 + licenseeLastName: ['', Validators.required],
  54 + institutionName: ['', Validators.required],
  55 + address1: ['', Validators.required],
  56 + address2: [''],
  57 + city: ['', Validators.required],
  58 + stateId: [0],
  59 + countryId: [0],
  60 + zip: ['', Validators.required],
  61 + emailId: ['', [Validators.required, Validators.email]],
  62 + phone: ['', [Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$')]],
  63 + });
  64 + this.GetCountry();
  65 + this.GetState();
  66 + this.GetLicenseAccounts();
  67 + }
  68 +
  69 + openModal(template: TemplateRef<any>) {
  70 + this.modalRef = this.modalService.show(template);
  71 + }
  72 +
  73 + GetCountry() {
  74 + this.licenseService.GetCountry()
  75 + .subscribe(y => { this.lstCountry = y; }, error => this.error = <any>error);
  76 + }
  77 +
  78 + GetState() {
  79 + this.licenseService.GetState()
  80 + .subscribe(st => { this.lstState = st; }, error => this.error = <any>error);
  81 + }
  82 +
  83 + GetLicenseAccounts() {
  84 + this.licenseService.GetLicenseAccounts(0)
  85 + .subscribe(st => {
  86 + this.lstAccountNumbers = st;
  87 + this.tempLstAccountNumbers = [];
  88 + this.loopIdx1 = 0;
  89 + this.loopIdx2 = 0;
  90 + this.lastScrollPos = 0;
  91 + this.tempLstAccountNumbers = [];
  92 + for (var i = 0; i < 50; i++) {
  93 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
  94 + }
  95 + },
  96 + error => this.error = <any>error);
  97 + }
  98 +
  99 + GetLicenseById() {
  100 + if (this.license.LicenseId != 0) {
  101 + this.licenseService.GetLicenseById(this.license.LicenseId)
  102 + .subscribe(st => {
  103 + this.license = st;
  104 +
  105 + this.updateLicenseBasicSettingsFrm.controls['licenseId'].setValue(this.license.LicenseId);
  106 + this.updateLicenseBasicSettingsFrm.controls['accountNumber'].setValue(this.license.AccountNumber);
  107 + this.updateLicenseBasicSettingsFrm.controls['licenseeFirstName'].setValue(this.license.LicenseeFirstName);
  108 + this.updateLicenseBasicSettingsFrm.controls['licenseeLastName'].setValue(this.license.LicenseeLastName);
  109 + this.updateLicenseBasicSettingsFrm.controls['institutionName'].setValue(this.license.InstitutionName);
  110 + this.updateLicenseBasicSettingsFrm.controls['address1'].setValue(this.license.Address1);
  111 + this.updateLicenseBasicSettingsFrm.controls['address2'].setValue(this.license.Address2);
  112 + this.updateLicenseBasicSettingsFrm.controls['city'].setValue(this.license.City);
  113 + this.updateLicenseBasicSettingsFrm.controls['stateId'].setValue(this.license.StateId);
  114 + this.updateLicenseBasicSettingsFrm.controls['countryId'].setValue(this.license.CountryId);
  115 + this.updateLicenseBasicSettingsFrm.controls['zip'].setValue(this.license.Zip);
  116 + this.updateLicenseBasicSettingsFrm.controls['emailId'].setValue(this.license.EmailId);
  117 + //this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(this.license.Phone);
  118 + var str = this.license.Phone;
  119 + var origPh = this.license.Phone;
  120 + str = str.replace(" ", "");
  121 + str = str.replace("-", "").replace("-", "");
  122 + if (str.length >= 10) {
  123 + origPh = str.substr(0, 3) + "-" + str.substr(3, 3) + "-" + str.substr(5, 4)
  124 + }
  125 + else {
  126 + this.MinusCharater = 10 - str.length;
  127 + this.AddZeroInPhoneNo(this.MinusCharater, str);
  128 + origPh = this.ConvertedPhoneno.substr(0, 2) + "-" + this.ConvertedPhoneno.substr(2, 5) + "-" + this.ConvertedPhoneno.substr(5, 9)
  129 +
  130 +
  131 + }
  132 + this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(origPh);
  133 + //if (str.search("-") == -1) {
  134 + // alert(str);
  135 + //}
  136 + //else {
  137 + // var splitted = str.split("-");
  138 + // if (splitted.length >= 2) {
  139 +
  140 + // }
  141 + //}
  142 + },
  143 + error => this.error = <any>error);
78 144 }
79   -
80   - GetLicenseAccounts() {
81   - this.licenseService.GetLicenseAccounts(0)
82   - .subscribe(st => {
83   - this.lstAccountNumbers = st;
84   - this.tempLstAccountNumbers = [];
85   - this.loopIdx = 0;
86   - for (var i = 0; i < 1000; i++) {
87   - if(this.loopIdx < this.lstAccountNumbers.length){
88   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
89   - this.loopIdx++;
90   - }
91   - }
92   - },
93   - error => this.error = <any>error);
  145 + }
  146 +
  147 + AccountNumberChanged(LicenseId: number, SelectText: string) {
  148 + this.accountDropDownText = SelectText;
  149 + if (LicenseId == 0) {
  150 + this.updateLicenseBasicSettingsFrm.reset();
  151 + this.updateLicenseBasicSettingsFrm.controls['licenseId'].setValue(0);
  152 + this.updateLicenseBasicSettingsFrm.controls['countryId'].setValue(0);
  153 + this.updateLicenseBasicSettingsFrm.controls['stateId'].setValue(0);
  154 + return;
94 155 }
95   -
96   - GetLicenseById() {
97   - if(this.license.LicenseId != 0)
98   - {
99   - this.licenseService.GetLicenseById(this.license.LicenseId)
100   - .subscribe(st => {
101   - this.license = st;
102   -
103   - this.updateLicenseBasicSettingsFrm.controls['licenseId'].setValue(this.license.LicenseId);
104   - this.updateLicenseBasicSettingsFrm.controls['accountNumber'].setValue(this.license.AccountNumber);
105   - this.updateLicenseBasicSettingsFrm.controls['licenseeFirstName'].setValue(this.license.LicenseeFirstName);
106   - this.updateLicenseBasicSettingsFrm.controls['licenseeLastName'].setValue(this.license.LicenseeLastName);
107   - this.updateLicenseBasicSettingsFrm.controls['institutionName'].setValue(this.license.InstitutionName);
108   - this.updateLicenseBasicSettingsFrm.controls['address1'].setValue(this.license.Address1);
109   - this.updateLicenseBasicSettingsFrm.controls['address2'].setValue(this.license.Address2);
110   - this.updateLicenseBasicSettingsFrm.controls['city'].setValue(this.license.City);
111   - this.updateLicenseBasicSettingsFrm.controls['stateId'].setValue(this.license.StateId);
112   - this.updateLicenseBasicSettingsFrm.controls['countryId'].setValue(this.license.CountryId);
113   - this.updateLicenseBasicSettingsFrm.controls['zip'].setValue(this.license.Zip);
114   - this.updateLicenseBasicSettingsFrm.controls['emailId'].setValue(this.license.EmailId);
115   - //this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(this.license.Phone);
116   - var str = this.license.Phone;
117   - var origPh = this.license.Phone;
118   - str = str.replace(" ", "");
119   - str = str.replace("-", "").replace("-", "");
120   - if (str.length >= 10) {
121   - origPh = str.substr(0, 3) + "-" + str.substr(3, 3) + "-" + str.substr(5, 4)
122   - }
123   - else {
124   - this.MinusCharater = 10 - str.length;
125   - this.AddZeroInPhoneNo(this.MinusCharater, str);
126   - origPh = this.ConvertedPhoneno.substr(0, 2) + "-" + this.ConvertedPhoneno.substr(2, 5) + "-" + this.ConvertedPhoneno.substr(5, 9)
127   -
128   -
129   - }
130   - this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(origPh);
131   - //if (str.search("-") == -1) {
132   - // alert(str);
133   - //}
134   - //else {
135   - // var splitted = str.split("-");
136   - // if (splitted.length >= 2) {
137   -
138   - // }
139   - //}
140   - },
141   - error => this.error = <any>error);
142   - }
  156 + this.license.LicenseId = LicenseId;
  157 + this.GetLicenseById();
  158 + }
  159 +
  160 + onScroll($event) {
  161 + if (this.lastScrollPos > $event.target.scrollTop) {
  162 + for (var i = 0; i < 1000; i++) {
  163 + if (this.loopIdx1 > 0)
  164 + this.tempLstAccountNumbers.unshift(this.lstAccountNumbers[this.loopIdx1--]);
  165 + }
143 166 }
144   -
145   - AccountNumberChanged(LicenseId: number, SelectText: string){
146   - this.accountDropDownText = SelectText;
147   - if (LicenseId == 0) {
148   - this.updateLicenseBasicSettingsFrm.reset();
149   - this.updateLicenseBasicSettingsFrm.controls['licenseId'].setValue(0);
150   - this.updateLicenseBasicSettingsFrm.controls['countryId'].setValue(0);
151   - this.updateLicenseBasicSettingsFrm.controls['stateId'].setValue(0);
152   - return;
153   - }
154   - this.license.LicenseId = LicenseId;
155   - this.GetLicenseById();
  167 + else {
  168 + for (var i = 0; i < 1000; i++) {
  169 + if (this.loopIdx2 < this.lstAccountNumbers.length)
  170 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
  171 + }
156 172 }
157   -
158   - onScroll($event){
159   - if($event.target.scrollTop >= ($event.target.scrollHeight/2)){
160   - for (var i = 0; i < 5000; i++) {
161   - if(this.loopIdx < this.lstAccountNumbers.length){
162   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
163   - this.loopIdx++;
164   - }
165   - }
166   - }
  173 + this.lastScrollPos = $event.target.scrollTop;
  174 + }
  175 +
  176 + onOpenChange(data: boolean): void {
  177 + if (!data) {
  178 + this.loopIdx1 = 0;
  179 + this.loopIdx2 = 0;
  180 + this.tempLstAccountNumbers = [];
  181 + for (var i = 0; i < 50; i++) {
  182 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
  183 + }
167 184 }
168   -
169   - onOpenChange(data: boolean): void {
170   - if(!data){
171   - this.loopIdx = 0;
172   - this.tempLstAccountNumbers = [];
173   - for (var i = 0; i < 1000; i++) {
174   - if(this.loopIdx < this.lstAccountNumbers.length){
175   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
176   - this.loopIdx++;
177   - }
178   - }
  185 + }
  186 +
  187 + onKeyPress($event) {
  188 + let FindItem = this.lstAccountNumbers.find(C => (C.m_Item2.toLowerCase().indexOf($event.key) == 0));
  189 + let prevIdx = 0;
  190 + if (FindItem != null) {
  191 + for (var i = 0; i < this.lstAccountNumbers.length; i++) {
  192 + if (FindItem.m_Item1 == this.lstAccountNumbers[i].m_Item1) {
  193 + prevIdx = i;
  194 + break;
179 195 }
  196 + }
  197 + this.tempLstAccountNumbers = [];
  198 + this.loopIdx1 = prevIdx;
  199 + this.loopIdx2 = prevIdx;
  200 + for (var i = 0; i < 50; i++) {
  201 + if (this.loopIdx2 < this.lstAccountNumbers.length)
  202 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
  203 + }
  204 + this.lastScrollPos = 0;
  205 + $event.target.nextElementSibling.scrollTop = 0;
180 206 }
181   -
182   - AfterUpdateData(data, template) {
183   - if (data.Status == "false") {
184   - this.alerts = "<span>License profile update unsuccessfull.</span>";
185   - } else {
186   - //this.modalAlerts = "<p>License updated successfully</p>";
187   - this._confirmService.activate("License profile updated successfully.", "alertMsg");
188   - // this.modalRef = this.modalService.show(template);
189   - }
  207 + }
  208 +
  209 + AfterUpdateData(data, template) {
  210 + if (data.Status == "false") {
  211 + this.alerts = "<span>License profile update unsuccessfull.</span>";
  212 + } else {
  213 + //this.modalAlerts = "<p>License updated successfully</p>";
  214 + this._confirmService.activate("License profile updated successfully.", "alertMsg");
  215 + // this.modalRef = this.modalService.show(template);
190 216 }
191   -
192   - UpdateLicenseBasicSettings(template: TemplateRef<any>){
193   - this.alerts = '';
194   - if(this.alerts == ''){
195   - var obj = this.updateLicenseBasicSettingsFrm.value;
196   - return this.licenseService.UpdateLicenseBasicSettings(obj)
197   - .subscribe(
198   - n => (this.AfterUpdateData(n, template)),
199   - error => this.error = <any>error);
200   - }
201   -
  217 + }
  218 +
  219 + UpdateLicenseBasicSettings(template: TemplateRef<any>) {
  220 + this.alerts = '';
  221 + if (this.alerts == '') {
  222 + var obj = this.updateLicenseBasicSettingsFrm.value;
  223 + return this.licenseService.UpdateLicenseBasicSettings(obj)
  224 + .subscribe(
  225 + n => (this.AfterUpdateData(n, template)),
  226 + error => this.error = <any>error);
202 227 }
203   - AddZeroInPhoneNo(num: number,phone:string) {
204   - if (num = 1) { this.ConvertedPhoneno = phone + "0"; }
205   - if (num = 2) { this.ConvertedPhoneno = phone + "00"; }
206   - if (num = 3) { this.ConvertedPhoneno = phone + "000"; }
207   - if (num = 4) { this.ConvertedPhoneno = phone + "0000"; }
208   - if (num = 5) { this.ConvertedPhoneno = phone + "00000"; }
209   - if (num = 6) { this.ConvertedPhoneno = phone + "000000"; }
210   - if (num = 7) { this.ConvertedPhoneno = phone + "0000000"; }
211   - if (num = 8) { this.ConvertedPhoneno = phone + "00000000"; }
212   - if (num = 9) { this.ConvertedPhoneno = phone + "000000000"; }
213   - if (num = 10) { this.ConvertedPhoneno = phone +"0000000000"; }
214   -
215 228  
216   - }
  229 + }
  230 + AddZeroInPhoneNo(num: number, phone: string) {
  231 + if (num = 1) { this.ConvertedPhoneno = phone + "0"; }
  232 + if (num = 2) { this.ConvertedPhoneno = phone + "00"; }
  233 + if (num = 3) { this.ConvertedPhoneno = phone + "000"; }
  234 + if (num = 4) { this.ConvertedPhoneno = phone + "0000"; }
  235 + if (num = 5) { this.ConvertedPhoneno = phone + "00000"; }
  236 + if (num = 6) { this.ConvertedPhoneno = phone + "000000"; }
  237 + if (num = 7) { this.ConvertedPhoneno = phone + "0000000"; }
  238 + if (num = 8) { this.ConvertedPhoneno = phone + "00000000"; }
  239 + if (num = 9) { this.ConvertedPhoneno = phone + "000000000"; }
  240 + if (num = 10) { this.ConvertedPhoneno = phone + "0000000000"; }
  241 +
  242 +
  243 + }
217 244  
218 245 }
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts
... ... @@ -7,7 +7,7 @@ import &#39;rxjs/add/operator/catch&#39;;
7 7 import 'rxjs/add/observable/throw';
8 8 import 'rxjs/add/operator/do';
9 9 import { Observable } from 'rxjs/Observable';
10   -import { GlobalService } from '../../Shared/global';
  10 +import { GlobalService } from '../../shared/global';
11 11  
12 12 @Injectable()
13 13 export class LicenseService{
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.html
... ... @@ -9,8 +9,8 @@
9 9 <div class="modal-header">
10 10 <h4 class="modal-title pull-left">Confirmation</h4>
11 11 <button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()">
12   - <span aria-hidden="true">&times;</span>
13   - </button>
  12 + <span aria-hidden="true">&times;</span>
  13 + </button>
14 14 </div>
15 15 <div class="modal-body" [innerHTML]="modalAlerts">
16 16 </div>
... ... @@ -22,8 +22,8 @@
22 22 <div class="modal-header">
23 23 <h4 class="modal-title pull-left">Information</h4>
24 24 <button type="button" class="close pull-right" aria-label="Close" (click)="modalRef.hide()">
25   - <span aria-hidden="true">&times;</span>
26   - </button>
  25 + <span aria-hidden="true">&times;</span>
  26 + </button>
27 27 </div>
28 28 <div class="modal-body" [innerHTML]="modalMessage">
29 29 </div>
... ... @@ -44,21 +44,21 @@
44 44 <div class="form-group marginTop5">
45 45 <label for="Account Number" class="col-sm-6 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Account Number :</label>
46 46 </div>
47   - <div class="col-sm-6 col-lg-6 padd-left0 padd-right0" dropdown (isOpenChange)="onOpenChange($event)">
48   - <button id="button-basic" dropdownToggle type="button" class="btn btn-primary dropdown-toggle col-sm-12 col-xs-12"
49   - aria-controls="dropdown-basic" style="height: 30px;">
50   - <span class="pull-left" style="margin-top: -1px;">{{accountDropDownText}}</span>
51   - <span class="caret pull-right" style="margin-top: 6px;"></span>
52   - </button>
53   - <ul id="dropdown-basic" *dropdownMenu class="dropdown-menu" role="menu" aria-labelledby="button-basic" style="overflow: scroll; height: 200px;" (scroll)="onScroll($event)">
54   - <li role="menuitem">
55   - <a class="dropdown-item" href="#" (click)="AccountNumberChanged(0, 'Select')">Select</a>
56   - </li>
57   - <li role="menuitem" *ngFor="let item of tempLstAccountNumbers">
58   - <a class="dropdown-item" href="#" (click)="AccountNumberChanged(item.m_Item1, item.m_Item2)">{{item.m_Item2}}</a>
59   - </li>
60   - </ul>
61   - </div>
  47 + <div class="col-sm-6 col-lg-6 padd-left0 padd-right0" dropdown (isOpenChange)="onOpenChange($event)" (keyup)="onKeyPress($event)">
  48 + <button id="button-basic" dropdownToggle type="button" class="btn btn-primary dropdown-toggle col-sm-12 col-xs-12"
  49 + aria-controls="dropdown-basic" style="height: 30px;">
  50 + <span class="pull-left" style="margin-top: -1px;">{{accountDropDownText}}</span>
  51 + <span class="caret pull-right" style="margin-top: 6px;"></span>
  52 + </button>
  53 + <ul id="dropdown-basic" #dropdownul *dropdownMenu class="dropdown-menu" role="menu" aria-labelledby="button-basic" style="overflow: scroll; height: 200px;" (scroll)="onScroll($event)">
  54 + <li role="menuitem">
  55 + <a class="dropdown-item" href="#" (click)="AccountNumberChanged(0, 'Select')">Select</a>
  56 + </li>
  57 + <li role="menuitem" *ngFor="let item of tempLstAccountNumbers">
  58 + <a class="dropdown-item" href="#" (click)="AccountNumberChanged(item.m_Item1, item.m_Item2)">{{item.m_Item2}}</a>
  59 + </li>
  60 + </ul>
  61 + </div>
62 62 </div>
63 63 </div>
64 64 </div>
... ... @@ -68,12 +68,14 @@
68 68 <form class="form-inline marginTop10">
69 69 <div class="form-group">
70 70 <label class="radio-inline">
71   - <input name="inlineRadioOptions" id="inlineRadio1" [value]="false" [(ngModel)]="isBuildingLevel" type="radio"> License Account </label>
  71 + <input name="inlineRadioOptions" id="inlineRadio1" [value]="false" [(ngModel)]="isBuildingLevel" type="radio"> License Account
  72 + </label>
72 73 </div>
73 74  
74 75 <div class="form-group">
75 76 <label class="radio-inline mar-left0">
76   - <input name="inlineRadioOptions" id="inlineRadio2" [value]="true" [(ngModel)]="isBuildingLevel" type="radio"> Building Level Account </label>
  77 + <input name="inlineRadioOptions" id="inlineRadio2" [value]="true" [(ngModel)]="isBuildingLevel" type="radio"> Building Level Account
  78 + </label>
77 79 </div>
78 80  
79 81 <button class="btn btn-primary btn-sm" type="button" (click)="ShowModestyorSites(templateinfo)" [disabled]="license.LicenseId == 0">Go <i class="fa fa-arrow-right"></i></button>
... ... @@ -101,10 +103,10 @@
101 103 <label for="inputPassword3" class="col-sm-5 control-label">Building Level Account Name :</label>
102 104 <div class="col-sm-6">
103 105 <select class="form-control input-sm" id="SiteId" formControlName="siteId" (change)="LicenseSiteChanged($event.target.value)">
104   - <option value="0">Select</option>
105   - <option *ngFor="let item of lstLicenseSites" value="{{item.Id}}">
  106 + <option value="0">Select</option>
  107 + <option *ngFor="let item of lstLicenseSites" value="{{item.Id}}">
106 108 {{item.Title}}
107   - </option>
  109 + </option>
108 110 </select>
109 111 </div>
110 112 </div>
... ... @@ -119,10 +121,12 @@
119 121  
120 122 <div class="col-sm-4">
121 123 <label class="radio-inline">
122   - <input name="{{item.m_Item3}}" [value]="true" type="radio" [(ngModel)]="item.m_Item2" [ngModelOptions]="{standalone: true}"> On </label>
  124 + <input name="{{item.m_Item3}}" [value]="true" type="radio" [(ngModel)]="item.m_Item2" [ngModelOptions]="{standalone: true}"> On
  125 + </label>
123 126  
124 127 <label class="radio-inline">
125   - <input name="{{item.m_Item3}}" [value]="false" type="radio" [(ngModel)]="item.m_Item2" [ngModelOptions]="{standalone: true}"> Off </label>
  128 + <input name="{{item.m_Item3}}" [value]="false" type="radio" [(ngModel)]="item.m_Item2" [ngModelOptions]="{standalone: true}"> Off
  129 + </label>
126 130 </div>
127 131 </div>
128 132  
... ... @@ -177,7 +181,6 @@
177 181 </div>
178 182 </div>
179 183 <!-- main-heading -->
180   -
181 184 <!--container-->
182 185  
183 186 </div>
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts
1 1 import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core';
2 2 import { LicenseService } from './license.service';
3   -import { GlobalService } from '../../Shared/global';
  3 +import { GlobalService } from '../../shared/global';
4 4 import { Router, ActivatedRoute } from '@angular/router';
5 5 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
6   -import { License } from '../UserEntity/datamodel';
  6 +import { License } from '../userentity/datamodel';
7 7 import { BsDatepickerModule } from 'ngx-bootstrap';
8 8 import { Http, Response } from '@angular/http';
9 9 import { DatePipe } from '@angular/common';
10 10 import { BsModalService } from 'ngx-bootstrap/modal';
11 11 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
12 12 import { ContenteditableModelDirective } from '../../shared/contenteditabledirective'
13   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  13 +import { ConfirmService } from '../../shared/confirm/confirm.service';
14 14 @Component({
15   - templateUrl: './licensemodestysettings.component.html'
  15 + templateUrl: './licensemodestysettings.component.html'
16 16 })
17 17  
18 18 export class LicenseModestySettings implements OnInit {
19 19  
20   - lstAccountNumbers: any;
21   - tempLstAccountNumbers: any;
22   - lstLicenseSites: any;
23   - lstLicenseEditionModesty: any;
24   - license: License;
25   - updateModestySettingsFrm: FormGroup;
26   - error: any;
27   - alerts: string;
28   - modalAlerts: string;
29   - modalMessage: string;
30   - modalRef: BsModalRef;
31   - selectedSiteId: number = 0;
32   - isBuildingLevel: boolean = false;
33   - accountDropDownText: string;
34   - loopIdx: number;
35   -
36   - constructor(private licenseService: LicenseService, private globalService: GlobalService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder,
37   - private modalService: BsModalService, private _confirmService: ConfirmService) { }
38   -
39   - ngOnInit(): void
40   - {
41   - this.license = new License();
42   - this.license.LicenseId = 0;
43   - this.alerts = '';
44   - this.accountDropDownText = 'Select';
45   - this.loopIdx = 0;
46   - this.updateModestySettingsFrm = this.fb.group({
47   - licenseId: [0],
48   - accountNumber: ['', Validators.required],
49   - siteId: [0],
50   - lstModesty: [this.fb.array([])],
51   - });
52   - this.GetLicenseAccounts();
53   - }
  20 + lstAccountNumbers: any;
  21 + tempLstAccountNumbers: any;
  22 + lstLicenseSites: any;
  23 + lstLicenseEditionModesty: any;
  24 + license: License;
  25 + updateModestySettingsFrm: FormGroup;
  26 + error: any;
  27 + alerts: string;
  28 + modalAlerts: string;
  29 + modalMessage: string;
  30 + modalRef: BsModalRef;
  31 + selectedSiteId: number = 0;
  32 + isBuildingLevel: boolean = false;
  33 + accountDropDownText: string;
  34 + loopIdx1: number;
  35 + loopIdx2: number;
  36 + lastScrollPos: number;
54 37  
55   - openModal(template: TemplateRef<any>) {
56   - this.modalRef = this.modalService.show(template);
57   - }
  38 + constructor(private licenseService: LicenseService, private globalService: GlobalService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder,
  39 + private modalService: BsModalService, private _confirmService: ConfirmService) { }
58 40  
59   - GetLicenseAccounts() {
60   - this.licenseService.GetLicenseAccounts(0)
61   - .subscribe(st => {
62   - this.lstAccountNumbers = st;
63   - this.tempLstAccountNumbers = [];
64   - this.loopIdx = 0;
65   - for (var i = 0; i < 1000; i++) {
66   - if(this.loopIdx < this.lstAccountNumbers.length){
67   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
68   - this.loopIdx++;
69   - }
70   - }
71   - }, error => this.error = <any>error);
72   - }
  41 + ngOnInit(): void {
  42 + this.license = new License();
  43 + this.license.LicenseId = 0;
  44 + this.alerts = '';
  45 + this.accountDropDownText = 'Select';
  46 + this.loopIdx1 = 0;
  47 + this.loopIdx2 = 0;
  48 + this.lastScrollPos = 0;
  49 + this.updateModestySettingsFrm = this.fb.group({
  50 + licenseId: [0],
  51 + accountNumber: ['', Validators.required],
  52 + siteId: [0],
  53 + lstModesty: [this.fb.array([])],
  54 + });
  55 + this.GetLicenseAccounts();
  56 + }
73 57  
74   - ShowModestyorSites(template: TemplateRef<any>) {
75   - this.lstLicenseEditionModesty = null;
76   - this.lstLicenseSites = null;
77   - this.selectedSiteId = 0;
78   - if(!this.isBuildingLevel){
79   - this.GetLicenseEditionModesty();
80   - }
81   - else{
82   - this.licenseService.GetLicenseSites(this.license.AccountNumber, 1, 1000)
83   - .subscribe(st => {
84   - this.lstLicenseSites = st.LicenseSiteList;
85   - if(this.lstLicenseSites.length == 0){
86   - this.modalMessage = 'Account is not a building level account.';
87   - this.openModal(template);
88   - }
89   - }, error => this.error = <any>error);
  58 + openModal(template: TemplateRef<any>) {
  59 + this.modalRef = this.modalService.show(template);
  60 + }
  61 +
  62 + GetLicenseAccounts() {
  63 + this.licenseService.GetLicenseAccounts(0)
  64 + .subscribe(st => {
  65 + this.lstAccountNumbers = st;
  66 + this.loopIdx1 = 0;
  67 + this.loopIdx2 = 0;
  68 + this.lastScrollPos = 0;
  69 + this.tempLstAccountNumbers = [];
  70 + for (var i = 0; i < 50; i++) {
  71 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
90 72 }
91   - }
  73 + }, error => this.error = <any>error);
  74 + }
92 75  
93   - GetLicenseEditionModesty() {
94   - this.licenseService.GetLicenseModestySettings(this.license.LicenseId, this.selectedSiteId)
95   - .subscribe(st => {
96   - this.lstLicenseEditionModesty = st;
97   - this.updateModestySettingsFrm.setControl('lstModesty', this.fb.array(this.lstLicenseEditionModesty));
98   - }, error => this.error = <any>error);
  76 + ShowModestyorSites(template: TemplateRef<any>) {
  77 + this.lstLicenseEditionModesty = null;
  78 + this.lstLicenseSites = null;
  79 + this.selectedSiteId = 0;
  80 + if (!this.isBuildingLevel) {
  81 + this.GetLicenseEditionModesty();
99 82 }
  83 + else {
  84 + this.licenseService.GetLicenseSites(this.license.AccountNumber, 1, 1000)
  85 + .subscribe(st => {
  86 + this.lstLicenseSites = st.LicenseSiteList;
  87 + if (this.lstLicenseSites.length == 0) {
  88 + this.modalMessage = 'Account is not a building level account.';
  89 + this.openModal(template);
  90 + }
  91 + }, error => this.error = <any>error);
  92 + }
  93 + }
100 94  
101   - LicenseSiteChanged(siteId: number){
102   - this.selectedSiteId = siteId;
103   - if(this.selectedSiteId == 0) {
104   - this.lstLicenseEditionModesty = null;
105   - return;
106   - }
107   - this.GetLicenseEditionModesty();
  95 + GetLicenseEditionModesty() {
  96 + this.licenseService.GetLicenseModestySettings(this.license.LicenseId, this.selectedSiteId)
  97 + .subscribe(st => {
  98 + this.lstLicenseEditionModesty = st;
  99 + this.updateModestySettingsFrm.setControl('lstModesty', this.fb.array(this.lstLicenseEditionModesty));
  100 + }, error => this.error = <any>error);
  101 + }
  102 +
  103 + LicenseSiteChanged(siteId: number) {
  104 + this.selectedSiteId = siteId;
  105 + if (this.selectedSiteId == 0) {
  106 + this.lstLicenseEditionModesty = null;
  107 + return;
108 108 }
  109 + this.GetLicenseEditionModesty();
  110 + }
109 111  
110   - GetLicenseById() {
111   - if(this.license.LicenseId != 0)
112   - {
113   - this.licenseService.GetLicenseById(this.license.LicenseId)
114   - .subscribe(st => {
115   - this.license = st;
116   - this.updateModestySettingsFrm.controls['licenseId'].setValue(this.license.LicenseId);
117   - this.updateModestySettingsFrm.controls['accountNumber'].setValue(this.license.AccountNumber);
118   - },
119   - error => this.error = <any>error);
120   - }
  112 + GetLicenseById() {
  113 + if (this.license.LicenseId != 0) {
  114 + this.licenseService.GetLicenseById(this.license.LicenseId)
  115 + .subscribe(st => {
  116 + this.license = st;
  117 + this.updateModestySettingsFrm.controls['licenseId'].setValue(this.license.LicenseId);
  118 + this.updateModestySettingsFrm.controls['accountNumber'].setValue(this.license.AccountNumber);
  119 + },
  120 + error => this.error = <any>error);
121 121 }
  122 + }
122 123  
123   - AccountNumberChanged(LicenseId: number, SelectText: string){
124   - this.accountDropDownText = SelectText;
125   - this.license.LicenseId = LicenseId;
126   - this.lstLicenseEditionModesty = null;
127   - this.lstLicenseSites = null;
128   - this.selectedSiteId = 0;
129   - this.isBuildingLevel = false;
130   - this.GetLicenseById();
  124 + AccountNumberChanged(LicenseId: number, SelectText: string) {
  125 + this.accountDropDownText = SelectText;
  126 + this.license.LicenseId = LicenseId;
  127 + this.lstLicenseEditionModesty = null;
  128 + this.lstLicenseSites = null;
  129 + this.selectedSiteId = 0;
  130 + this.isBuildingLevel = false;
  131 + this.GetLicenseById();
  132 + }
  133 +
  134 + onScroll($event) {
  135 + if (this.lastScrollPos > $event.target.scrollTop) {
  136 + for (var i = 0; i < 1000; i++) {
  137 + if (this.loopIdx1 > 0)
  138 + this.tempLstAccountNumbers.unshift(this.lstAccountNumbers[this.loopIdx1--]);
  139 + }
  140 + }
  141 + else {
  142 + for (var i = 0; i < 1000; i++) {
  143 + if (this.loopIdx2 < this.lstAccountNumbers.length)
  144 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
  145 + }
131 146 }
  147 + this.lastScrollPos = $event.target.scrollTop;
  148 + }
132 149  
133   - onScroll($event){
134   - if($event.target.scrollTop >= ($event.target.scrollHeight/2)){
135   - for (var i = 0; i < 5000; i++) {
136   - if(this.loopIdx < this.lstAccountNumbers.length){
137   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
138   - this.loopIdx++;
139   - }
140   - }
141   - }
  150 + onOpenChange(data: boolean): void {
  151 + if (!data) {
  152 + this.loopIdx1 = 0;
  153 + this.loopIdx2 = 0;
  154 + this.tempLstAccountNumbers = [];
  155 + this.lastScrollPos = 0;
  156 + for (var i = 0; i < 50; i++) {
  157 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
  158 + }
142 159 }
  160 + }
143 161  
144   - onOpenChange(data: boolean): void {
145   - if(!data){
146   - this.loopIdx = 0;
147   - this.tempLstAccountNumbers = [];
148   - for (var i = 0; i < 1000; i++) {
149   - if(this.loopIdx < this.lstAccountNumbers.length){
150   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
151   - this.loopIdx++;
152   - }
153   - }
  162 + onKeyPress($event) {
  163 + let FindItem = this.lstAccountNumbers.find(C => (C.m_Item2.toLowerCase().indexOf($event.key) == 0));
  164 + let prevIdx = 0;
  165 + if (FindItem != null) {
  166 + this.tempLstAccountNumbers = [];
  167 + for (var i = 0; i < this.lstAccountNumbers.length; i++) {
  168 + if (FindItem.m_Item1 == this.lstAccountNumbers[i].m_Item1) {
  169 + prevIdx = i;
  170 + break;
154 171 }
  172 + }
  173 + this.loopIdx1 = prevIdx;
  174 + this.loopIdx2 = prevIdx;
  175 + for (var i = 0; i < 50; i++) {
  176 + if (this.loopIdx2 < this.lstAccountNumbers.length)
  177 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
  178 + }
  179 + this.lastScrollPos = 0;
  180 + $event.target.nextElementSibling.scrollTop = 0;
155 181 }
  182 + }
156 183  
157   - AfterUpdateData(data, template) {
158   - if (data.Status == "false") {
159   - this.alerts = "<span>License modesty settings update unsuccessfull.</span>";
160   - } else {
161   - this._confirmService.activate("License modesty settings updated successfully.", "alertMsg");
162   - // this.modalAlerts = "<p>License modesty setings updated successfully.</p>";
163   - // this.modalRef = this.modalService.show(template);
164   - }
  184 + AfterUpdateData(data, template) {
  185 + if (data.Status == "false") {
  186 + this.alerts = "<span>License modesty settings update unsuccessfull.</span>";
  187 + } else {
  188 + this._confirmService.activate("License modesty settings updated successfully.", "alertMsg");
  189 + // this.modalAlerts = "<p>License modesty setings updated successfully.</p>";
  190 + // this.modalRef = this.modalService.show(template);
165 191 }
  192 + }
166 193  
167   - UpdateLicenseModestySettings(template: TemplateRef<any>){
168   - this.alerts = '';
169   - if(this.alerts == ''){
170   - var obj = this.updateModestySettingsFrm.value;
171   - return this.licenseService.UpdateLicenseModestySettings(obj)
172   - .subscribe(
173   - n => (this.AfterUpdateData(n, template)),
174   - error => this.error = <any>error);
175   - }
  194 + UpdateLicenseModestySettings(template: TemplateRef<any>) {
  195 + this.alerts = '';
  196 + if (this.alerts == '') {
  197 + var obj = this.updateModestySettingsFrm.value;
  198 + return this.licenseService.UpdateLicenseModestySettings(obj)
  199 + .subscribe(
  200 + n => (this.AfterUpdateData(n, template)),
  201 + error => this.error = <any>error);
176 202 }
177   -
  203 + }
  204 +
178 205  
179 206 }
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.html
... ... @@ -32,7 +32,7 @@
32 32 <div class="form-group marginTop5">
33 33 <label for="Account Number" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Account Number :</label>
34 34 </div>
35   - <div class="col-sm-12 col-lg-6 padd-left0 padd-right0" dropdown (isOpenChange)="onOpenChange($event)">
  35 + <div class="col-sm-12 col-lg-6 padd-left0 padd-right0" dropdown (isOpenChange)="onOpenChange($event)" (keyup)="onKeyPress($event)">
36 36 <button id="button-basic" dropdownToggle type="button" class="btn btn-primary dropdown-toggle"
37 37 aria-controls="dropdown-basic" style="width: 200px; height: 30px;">
38 38 <span class="pull-left" style="margin-top: -1px;">{{accountDropDownText}}</span>
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.ts
1 1 import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core';
2 2 import { LicenseService } from './license.service';
3   -import { GlobalService } from '../../Shared/global';
  3 +import { GlobalService } from '../../shared/global';
4 4 import { Router, ActivatedRoute } from '@angular/router';
5 5 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
6   -import { License } from '../UserEntity/datamodel';
  6 +import { License } from '../userentity/datamodel';
7 7 import { BsDatepickerModule } from 'ngx-bootstrap';
8 8 import { Http, Response } from '@angular/http';
9 9 import { DatePipe } from '@angular/common';
10 10 import { BsModalService } from 'ngx-bootstrap/modal';
11 11 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
12 12 import { ContenteditableModelDirective } from '../../shared/contenteditabledirective'
13   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  13 +import { ConfirmService } from '../../shared/confirm/confirm.service';
14 14 @Component({
15 15 templateUrl: './licensemodulesettings.component.html'
16 16 })
... ... @@ -27,7 +27,9 @@ export class LicenseModuleSettings implements OnInit {
27 27 modalAlerts: string;
28 28 modalRef: BsModalRef;
29 29 accountDropDownText: string;
30   - loopIdx: number;
  30 + loopIdx1: number;
  31 + loopIdx2: number;
  32 + lastScrollPos: number;
31 33  
32 34 constructor(private licenseService: LicenseService,
33 35 private globalService: GlobalService,
... ... @@ -40,7 +42,9 @@ export class LicenseModuleSettings implements OnInit {
40 42 this.license.LicenseId = 0;
41 43 this.alerts = '';
42 44 this.accountDropDownText = 'Select';
43   - this.loopIdx = 0;
  45 + this.loopIdx1 = 0;
  46 + this.loopIdx2 = 0;
  47 + this.lastScrollPos = 0;
44 48 this.updateModuleSettingsFrm = this.fb.group({
45 49 licenseId: [0],
46 50 accountNumber: [''],
... ... @@ -58,12 +62,12 @@ export class LicenseModuleSettings implements OnInit {
58 62 .subscribe(st => {
59 63 this.lstAccountNumbers = st;
60 64 this.tempLstAccountNumbers = [];
61   - this.loopIdx = 0;
62   - for (var i = 0; i < 1000; i++) {
63   - if(this.loopIdx < this.lstAccountNumbers.length){
64   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
65   - this.loopIdx++;
66   - }
  65 + this.loopIdx1 = 0;
  66 + this.loopIdx2 = 0;
  67 + this.lastScrollPos = 0;
  68 + this.tempLstAccountNumbers = [];
  69 + for (var i = 0; i < 50; i++) {
  70 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
67 71 }
68 72 }, error => this.error = <any>error);
69 73 }
... ... @@ -98,26 +102,51 @@ export class LicenseModuleSettings implements OnInit {
98 102 }
99 103  
100 104 onScroll($event){
101   - if($event.target.scrollTop >= ($event.target.scrollHeight/2)){
102   - for (var i = 0; i < 5000; i++) {
103   - if(this.loopIdx < this.lstAccountNumbers.length){
104   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
105   - this.loopIdx++;
106   - }
  105 + if(this.lastScrollPos > $event.target.scrollTop){
  106 + for (var i = 0; i < 1000; i++) {
  107 + if(this.loopIdx1 > 0)
  108 + this.tempLstAccountNumbers.unshift(this.lstAccountNumbers[this.loopIdx1--]);
  109 + }
  110 + }
  111 + else{
  112 + for (var i = 0; i < 1000; i++) {
  113 + if(this.loopIdx2 < this.lstAccountNumbers.length)
  114 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
107 115 }
108 116 }
  117 + this.lastScrollPos = $event.target.scrollTop;
109 118 }
110 119  
111 120 onOpenChange(data: boolean): void {
112 121 if(!data){
113   - this.loopIdx = 0;
  122 + this.loopIdx1 = 0;
  123 + this.loopIdx2 = 0;
114 124 this.tempLstAccountNumbers = [];
115   - for (var i = 0; i < 1000; i++) {
116   - if(this.loopIdx < this.lstAccountNumbers.length){
117   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
118   - this.loopIdx++;
  125 + for (var i = 0; i < 50; i++) {
  126 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
  127 + }
  128 + }
  129 + }
  130 +
  131 + onKeyPress($event){
  132 + let FindItem = this.lstAccountNumbers.find(C => (C.m_Item2.toLowerCase().indexOf($event.key) == 0));
  133 + let prevIdx = 0;
  134 + if(FindItem != null){
  135 + for (var i = 0; i < this.lstAccountNumbers.length; i++) {
  136 + if(FindItem.m_Item1 == this.lstAccountNumbers[i].m_Item1){
  137 + prevIdx = i;
  138 + break;
119 139 }
120   - }
  140 + }
  141 + this.tempLstAccountNumbers = [];
  142 + this.loopIdx1 = prevIdx;
  143 + this.loopIdx2 = prevIdx;
  144 + for (var i = 0; i < 50; i++) {
  145 + if(this.loopIdx2 < this.lstAccountNumbers.length)
  146 + this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx2++]);
  147 + }
  148 + this.lastScrollPos = 0;
  149 + $event.target.nextElementSibling.scrollTop = 0;
121 150 }
122 151 }
123 152  
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.html
... ... @@ -220,6 +220,7 @@
220 220 <div class="well">
221 221 <table id="fixed_hdr2" class="table-hover ui-widget-header sorttable" style="width: 4032px;">
222 222 <thead>
  223 +
223 224 <tr>
224 225 <th style="width: 150px">Account No.</th>
225 226 <th style="width: 150px">Licensee Name</th>
... ... @@ -243,6 +244,10 @@
243 244 </tr>
244 245 </thead>
245 246 <tbody>
  247 + <tr *ngIf="NoRecord !== ''">
  248 +
  249 + <td colspan="10"><b style="color: red;text-align: center; padding-left: 606px;"><span [innerHTML]="NoRecord"></span></b></td>
  250 + </tr>
246 251 <tr class="ui-widget-content" *ngFor="let item of this.searchLicenseFrm.controls['licenses'].value; let i = index" (click)="SetClickedRow(i, item)"
247 252 [class.active]="i == selectedRow" [class.inactive]="i != selectedRow">
248 253 <td style="text-align: center; width: 150px">
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts
... ... @@ -2,16 +2,16 @@ import { Component, OnInit, AfterViewChecked, Input, Output, EventEmitter, Pipe,
2 2 import { LicenseService } from './license.service';
3 3 import { Router, ActivatedRoute } from '@angular/router';
4 4 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
5   -import { License } from '../UserEntity/datamodel';
  5 +import { License } from '../userentity/datamodel';
6 6 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
7 7 import { Http, Response } from '@angular/http';
8 8 import { DatePipe } from '@angular/common';
9 9 import { BsModalService } from 'ngx-bootstrap/modal';
10 10 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
11   -import { PagerComponent } from '../../shared/Pager/pager.component';
  11 +import { PagerComponent } from '../../shared/pager/pager.component';
12 12 import { LoadingService } from '../../shared/loading.service';
13   -import { GlobalService } from '../../Shared/global';
14   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  13 +import { GlobalService } from '../../shared/global';
  14 +import { ConfirmService } from '../../shared/confirm/confirm.service';
15 15 declare var $: any;
16 16  
17 17 @Component({
... ... @@ -51,7 +51,7 @@ export class SearchLicense implements OnInit, AfterViewChecked {
51 51 pageLength: number;
52 52 returnFrom: boolean;
53 53 dateStartInvalid: boolean = false;
54   - dateEndInvalid: boolean = false;
  54 + dateEndInvalid: boolean = false;
55 55  
56 56 constructor(private licenseService: LicenseService, private router: Router,
57 57 private activeRoute: ActivatedRoute, private fb: FormBuilder,
... ... @@ -63,6 +63,7 @@ export class SearchLicense implements OnInit, AfterViewChecked {
63 63 this.divClass = 'col-sm-12';
64 64 this.license = new License();
65 65 this.alerts = '';
  66 + this.NoRecord = this.global.NoRecords;
66 67 this.searchLicenseFrm = this.fb.group({
67 68 accountNumber: [''],
68 69 licenseeFirstName: [''],
... ...
400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts
... ... @@ -2,16 +2,16 @@ import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, Pi
2 2 import { LicenseService } from './license.service';
3 3 import { Router, ActivatedRoute } from '@angular/router';
4 4 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
5   -import { License } from '../UserEntity/datamodel';
  5 +import { License } from '../userentity/datamodel';
6 6 import { BsDatepickerModule } from 'ngx-bootstrap';
7 7 import { Http, Response } from '@angular/http';
8 8 import { DatePipe } from '@angular/common';
9 9 import { BsModalService } from 'ngx-bootstrap/modal';
10 10 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
11   -import { PagerComponent } from '../../shared/Pager/pager.component';
  11 +import { PagerComponent } from '../../shared/pager/pager.component';
12 12 import { LoadingService } from '../../shared/loading.service';
13   -import { GlobalService } from '../../Shared/global';
14   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  13 +import { GlobalService } from '../../shared/global';
  14 +import { ConfirmService } from '../../shared/confirm/confirm.service';
15 15 declare var $:any;
16 16  
17 17 @Component({
... ...
400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts
... ... @@ -2,16 +2,16 @@ import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, Pi
2 2 import { ManageDiscountCodeService } from './managediscountcode.service';
3 3 import { Router } from '@angular/router';
4 4 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
5   -import { DiscountCode } from '../UserEntity/datamodel';
  5 +import { DiscountCode } from '../userentity/datamodel';
6 6 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
7 7 import { Http, Response } from '@angular/http';
8 8 import { DatePipe } from '@angular/common';
9 9 import { BsModalService } from 'ngx-bootstrap/modal';
10 10 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
11   -import { PagerComponent } from '../../shared/Pager/pager.component';
  11 +import { PagerComponent } from '../../shared/pager/pager.component';
12 12 import { LoadingService } from '../../shared/loading.service';
13   -import { GlobalService } from '../../Shared/global';
14   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  13 +import { GlobalService } from '../../shared/global';
  14 +import { ConfirmService } from '../../shared/confirm/confirm.service';
15 15 declare var $:any;
16 16  
17 17 @Component({
... ...
400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts
... ... @@ -6,7 +6,7 @@ import &#39;rxjs/add/operator/catch&#39;;
6 6 import 'rxjs/add/observable/throw';
7 7 import 'rxjs/add/operator/do';
8 8 import { Observable } from 'rxjs/Observable';
9   -import { GlobalService } from '../../Shared/global';
  9 +import { GlobalService } from '../../shared/global';
10 10  
11 11 @Injectable()
12 12 export class ManageDiscountCodeService {
... ...
400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts
... ... @@ -7,16 +7,16 @@ import { Observable } from &#39;rxjs/Observable&#39;;
7 7 import 'rxjs/Rx';
8 8 import 'rxjs/add/operator/map';
9 9 import 'rxjs/add/operator/filter';
10   -import { CustomerSummaryReports } from '../Reports/reportdatamodel';
11   -import { ReportService } from '../Reports/report.service';
12   -import { GlobalService } from '../../Shared/global';
  10 +import { CustomerSummaryReports } from '../reports/reportdatamodel';
  11 +import { ReportService } from '../reports/report.service';
  12 +import { GlobalService } from '../../shared/global';
13 13 import { BsModalService } from 'ngx-bootstrap/modal';
14 14 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
15 15 import { DatePipe } from '@angular/common';
16 16 import { BsDatepickerModule } from 'ngx-bootstrap';
17 17 import { Http, Response } from '@angular/http';
18 18 import { LoadingService } from '../../shared/loading.service';
19   -import { PagerComponent } from '../../shared/Pager/pager.component';
  19 +import { PagerComponent } from '../../shared/pager/pager.component';
20 20 declare var $: any;
21 21  
22 22 @Component({
... ... @@ -156,6 +156,7 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked {
156 156  
157 157 }
158 158 SearchRecords() {
  159 + this.ExportingStart = false;
159 160 this.GetCustomerSummeryReport('1, ' + this.pageLength);
160 161 }
161 162 BindFormFields(data) {
... ... @@ -180,8 +181,9 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked {
180 181 }
181 182 }
182 183 ExportService(data: any) {
  184 + debugger;
183 185 this._loadingService.HideLoading("global-loading");
184   - this.global.ExportToCSV(data, "CustomerSummeryReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
  186 + this.global.ExportToCSV(data.CustomerSummery, "CustomerSummeryReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
185 187  
186 188 }
187 189 }
... ...
400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts
... ... @@ -7,17 +7,17 @@ import { Observable } from &#39;rxjs/Observable&#39;;
7 7 import 'rxjs/Rx';
8 8 import 'rxjs/add/operator/map';
9 9 import 'rxjs/add/operator/filter';
10   -import { DiscountCodeReports } from '../Reports/reportdatamodel';
11   -import { ReportService } from '../Reports/report.service';
12   -import { GlobalService } from '../../Shared/global';
  10 +import { DiscountCodeReports } from '../reports/reportdatamodel';
  11 +import { ReportService } from '../reports/report.service';
  12 +import { GlobalService } from '../../shared/global';
13 13 import { BsModalService } from 'ngx-bootstrap/modal';
14 14 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
15 15 import { DatePipe } from '@angular/common';
16 16 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
17 17 import { Http, Response } from '@angular/http';
18 18 import { LoadingService } from '../../shared/loading.service';
19   -import { PagerComponent } from '../../shared/Pager/pager.component';
20   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  19 +import { PagerComponent } from '../../shared/pager/pager.component';
  20 +import { ConfirmService } from '../../shared/confirm/confirm.service';
21 21 declare var $: any;
22 22  
23 23 @Component({
... ... @@ -149,6 +149,7 @@ export class DiscountCodeReport implements OnInit {
149 149 }
150 150  
151 151 SearchRecords() {
  152 + this.ExportingStart = false;
152 153 this.GetDiscountReport('1, ' + this.pageLength);
153 154 }
154 155  
... ...
400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html
  1 +<style>
  2 + :host /deep/ ng2-smart-table {
  3 + font-size: 12px;
  4 + }
  5 +</style>
1 6 <div class="row">
2 7 <div class="col-sm-12 pageHeading" style="margin-left: 15px;">
3 8 <h4>Expiring Subscription Report</h4>
... ... @@ -174,6 +179,9 @@
174 179 </div>
175 180  
176 181 <div class="well">
  182 + <!--<ng2-smart-table [settings]="settings" [source]="source">
  183 + <i class="fa fa-spinner fa-spin" style="font-size:24px"></i>
  184 + </ng2-smart-table>-->
177 185 <table id="fixed_hdr2" class="table-hover ">
178 186 <thead>
179 187 <tr>
... ... @@ -182,12 +190,12 @@
182 190 <th>License Type</th>
183 191 <th>Institution Name</th>
184 192 <th>Account Type</th>
185   - <!--<th>Edition</th>-->
  193 +
186 194 <th>Start Date</th>
187 195 <th>End Date</th>
188 196 <th>Original Entry Date</th>
189 197 <th>Subscription Price</th>
190   - <th>Time Period</th>
  198 + <th (click)="sort('TimePeriod')">Time Period</th>
191 199 <th>Credit Card Number</th>
192 200 </tr>
193 201 </thead>
... ... @@ -196,17 +204,17 @@
196 204  
197 205 <td colspan="6"><b style="color: red;text-align: center; padding-left: 606px;"><span [innerHTML]="NoRecord"></span></b></td>
198 206 </tr>
199   - <tr *ngFor="let esr of lstExpiringSubscriptionReport">
  207 + <tr *ngFor="let esr of lstExpiringSubscriptionReport | orderBy: key : reverse;">
200 208 <td>{{esr.AccountNumber}}</td>
201 209 <td>{{esr.LicenseeName}}</td>
202 210 <td>{{esr.LicenseType}}</td>
203 211 <td>{{esr.InstitutionName}}</td>
204 212 <td>{{esr.AccountType}}</td>
205   - <!--<td>{{esr.}}</td>-->
206   - <td>{{esr.SubscriptionValidFrom}}</td>
207   - <td>{{esr.SubscriptionValidThrough}}</td>
208   - <td>{{esr.CreationDate}}</td>
209   - <td>{{esr.TotalAmount}}</td>
  213 +
  214 + <td>{{esr.StartDate}}</td>
  215 + <td>{{esr.EndDate}}</td>
  216 + <td>{{esr.LicenseCreationDate}}</td>
  217 + <td>{{esr.SubscriptionPrice}}</td>
210 218 <td>{{esr.DaysRemaining}}</td>
211 219 <td>{{esr.CardNumber}}</td>
212 220 </tr>
... ...
400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts
... ... @@ -7,16 +7,18 @@ import { Observable } from &#39;rxjs/Observable&#39;;
7 7 import 'rxjs/Rx';
8 8 import 'rxjs/add/operator/map';
9 9 import 'rxjs/add/operator/filter';
10   -import { ExpiringSubscriptionReports } from '../Reports/reportdatamodel';
11   -import { ReportService } from '../Reports/report.service';
12   -import { GlobalService } from '../../Shared/global';
  10 +import { ExpiringSubscriptionReports } from '../reports/reportdatamodel';
  11 +import { ReportService } from '../reports/report.service';
  12 +import { GlobalService } from '../../shared/global';
13 13 import { BsModalService } from 'ngx-bootstrap/modal';
14 14 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
15 15 import { DatePipe } from '@angular/common';
16 16 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
17 17 import { Http, Response } from '@angular/http';
18 18 import { LoadingService } from '../../shared/loading.service';
19   -import { PagerComponent } from '../../shared/Pager/pager.component';
  19 +import { PagerComponent } from '../../shared/pager/pager.component';
  20 +//import { Ng2SmartTableModule, LocalDataSource } from 'ng2-smart-table';
  21 +
20 22 declare var $: any;
21 23  
22 24 @Component({
... ... @@ -56,6 +58,92 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked {
56 58 recordCount: number;
57 59 pageNo: number;
58 60 pageLength: number;
  61 + key: string = 'AccountNumber'; //set default
  62 + reverse: boolean = false;
  63 + //settings = {
  64 + // actions: { add: false, edit: false, delete: false },
  65 + // pager: {
  66 + // display: true,
  67 + // perPage: 5
  68 + // },
  69 + // attr: {
  70 + // class: 'table table-condensed table-bordered table-striped table-hover'
  71 + // },
  72 + // //hideSubHeader:true,
  73 + // //rowClassFunction: (row) => {
  74 + // // if (row.index == this.selectedRow) {
  75 + // // return 'ng2-smart-row selected';
  76 + // // }
  77 + // // else {
  78 + // // return 'ng2-smart-row';
  79 + // // }
  80 + // //},
  81 + // //noDataMessage:'Loading, Please wait...',
  82 + // columns: {
  83 + // AccountNumber: {
  84 + // title: 'Account Number',
  85 + // width: '140px',
  86 +
  87 +
  88 + // },
  89 + // LicenseeName: {
  90 + // title: 'Licensee Name',
  91 + // width: '140px'
  92 + // },
  93 + // LicenseType: {
  94 + // title: 'License Type',
  95 + // width: '140px'
  96 + // },
  97 + // InstitutionName: {
  98 + // title: 'Institution Name',
  99 + // width: '140px'
  100 + // }
  101 + // ,
  102 + // //Edition: {
  103 + // // title: 'Edition',
  104 + // // width: '140px'
  105 + // //}
  106 + // //,
  107 + // StartDate: {
  108 + // title: 'Start Date',
  109 + // width: '140px'
  110 + // },
  111 + // EndDate: {
  112 + // title: 'End Date',
  113 + // width: '140px'
  114 + // }
  115 + // ,
  116 + // LicenseCreationDate: {
  117 + // title: 'Original Entry Date',
  118 + // width: '140px'
  119 + // },
  120 + // SubscriptionPrice: {
  121 + // title: 'Subscription Price',
  122 + // width: '140px'
  123 + // },
  124 + // AccountType: {
  125 + // title: 'Account Type',
  126 + // width: '140px'
  127 + // }
  128 + // ,
  129 + // DaysRemaining: {
  130 + // title: 'Time Period',
  131 + // width: '140px'
  132 + // }
  133 + // ,
  134 + // CardNumber: {
  135 + // title: 'Credit Card Number',
  136 + // width: '140px'
  137 + // }
  138 + // //Serial_No: {
  139 + // // title: 'Serial_No'
  140 + // //}
  141 +
  142 +
  143 + // }
  144 + //};
  145 +
  146 + //source: LocalDataSource;
59 147 ExpiringSubscription = new ExpiringSubscriptionReports();
60 148 constructor(private router: Router, private reportservice: ReportService,
61 149 private fb: FormBuilder, private modalService: BsModalService,
... ... @@ -169,6 +257,7 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked {
169 257  
170 258 }
171 259 SearchRecords() {
  260 + this.ExportingStart = false;
172 261 this.GetExpiringSubscriptionReport('1, ' + this.pageLength);
173 262 }
174 263 ExportEvent() {
... ... @@ -182,6 +271,12 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked {
182 271 this.global.ExportToCSV(data.ExpiringSubscription, "ExpiringSubscriptionReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
183 272  
184 273 }
  274 +
  275 + sort(key) {
  276 + debugger;;
  277 + this.key = key;
  278 + this.reverse = !this.reverse;
  279 + }
185 280 //compareTwoDates() {
186 281  
187 282 // if (new Date(this.ExpiringSubscriptionReportForm.controls['sToDate'].value) < new Date(this.ExpiringSubscriptionReportForm.controls['sFromDate'].value)) {
... ... @@ -210,9 +305,13 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked {
210 305 // this.enableTextboxColor = true;
211 306 //}
212 307  
213   - BindFormFields(data) {
214   - this.recordCount = data.RecordCount;
215   - this.lstExpiringSubscriptionReport = data.ExpiringSubscription
  308 + BindFormFields(datas) {
  309 + this.recordCount = datas.RecordCount;
  310 + this.lstExpiringSubscriptionReport = datas.ExpiringSubscription;
  311 + //this.source = new LocalDataSource(this.lstExpiringSubscriptionReport);
  312 + //let data = datas.ExpiringSubscription;
  313 + //this.source = new LocalDataSource(data);
  314 +
216 315 this.numberOfExpiringSubscriptionReport = this.lstExpiringSubscriptionReport.length; this.limit = this.lstExpiringSubscriptionReport.length;
217 316 if (this.lstExpiringSubscriptionReport.length > 0) {
218 317 this.NoRecord = '';
... ...
400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts
... ... @@ -7,17 +7,17 @@ import { Observable } from &#39;rxjs/Observable&#39;;
7 7 import 'rxjs/Rx';
8 8 import 'rxjs/add/operator/map';
9 9 import 'rxjs/add/operator/filter';
10   -import { ImageExportReports } from '../Reports/reportdatamodel';
11   -import { ReportService } from '../Reports/report.service';
12   -import { GlobalService } from '../../Shared/global';
  10 +import { ImageExportReports } from '../reports/reportdatamodel';
  11 +import { ReportService } from '../reports/report.service';
  12 +import { GlobalService } from '../../shared/global';
13 13 import { BsModalService } from 'ngx-bootstrap/modal';
14 14 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
15 15 import { DatePipe } from '@angular/common';
16 16 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
17 17 import { Http, Response } from '@angular/http';
18 18 import { LoadingService } from '../../shared/loading.service';
19   -import { PagerComponent } from '../../shared/Pager/pager.component';
20   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  19 +import { PagerComponent } from '../../shared/pager/pager.component';
  20 +import { ConfirmService } from '../../shared/confirm/confirm.service';
21 21 declare var $: any;
22 22  
23 23 @Component({
... ... @@ -82,11 +82,11 @@ export class ImageExportReport implements OnInit {
82 82 { width: 150, align: 'Center' },
83 83 //{ width: 150, align: 'Center' },
84 84 { width: 350, align: 'Center' },
85   - { width: 500, align: 'Center' },
  85 + { width: 300, align: 'Center' },
86 86 { width: 130, align: 'Center' },
87 87 { width: 120, align: 'center' },
88 88 { width: 150, align: 'center' },
89   - { width: 110, align: 'center' },
  89 + { width: 180, align: 'center' },
90 90 ],
91 91 sort: true
92 92 });
... ... @@ -130,6 +130,7 @@ export class ImageExportReport implements OnInit {
130 130 }
131 131  
132 132 SearchRecords() {
  133 + this.ExportingStart = false;
133 134 this.GetImageExportReport('1, ' + this.pageLength);
134 135 }
135 136  
... ...
400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts
... ... @@ -7,17 +7,17 @@ import { Observable } from &#39;rxjs/Observable&#39;;
7 7 import 'rxjs/Rx';
8 8 import 'rxjs/add/operator/map';
9 9 import 'rxjs/add/operator/filter';
10   -import { NetAdSubscriptionReports } from '../Reports/reportdatamodel';
11   -import { ReportService } from '../Reports/report.service';
12   -import { GlobalService } from '../../Shared/global';
  10 +import { NetAdSubscriptionReports } from '../reports/reportdatamodel';
  11 +import { ReportService } from '../reports/report.service';
  12 +import { GlobalService } from '../../shared/global';
13 13 import { BsModalService } from 'ngx-bootstrap/modal';
14 14 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
15 15 import { DatePipe } from '@angular/common';
16 16 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
17 17 import { Http, Response } from '@angular/http';
18 18 import { LoadingService } from '../../shared/loading.service';
19   -import { PagerComponent } from '../../shared/Pager/pager.component';
20   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  19 +import { PagerComponent } from '../../shared/pager/pager.component';
  20 +import { ConfirmService } from '../../shared/confirm/confirm.service';
21 21 declare var $: any;
22 22  
23 23 @Component({
... ... @@ -84,8 +84,8 @@ export class NetAdSubscriptionReport implements OnInit {
84 84 { width: 150, align: 'Center' },
85 85 { width: 150, align: 'Center' },
86 86 { width: 350, align: 'Center' },
87   - { width: 500, align: 'Center' },
88   - { width: 130, align: 'Center' },
  87 + { width: 200, align: 'Center' },
  88 + { width: 200, align: 'Center' },
89 89 { width: 120, align: 'center' },
90 90 { width: 280, align: 'Center' },
91 91 { width: 180, align: 'center' },
... ... @@ -135,6 +135,7 @@ export class NetAdSubscriptionReport implements OnInit {
135 135 }
136 136  
137 137 SearchRecords() {
  138 + this.ExportingStart = false;
138 139 this.GetNetAdSummaryReport('1, ' + this.pageLength);
139 140 }
140 141  
... ...
400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts
... ... @@ -8,7 +8,7 @@ import { User } from &#39;../UserEntity/datamodel&#39;;
8 8 import { UsageReports } from '../Reports/reportdatamodel';
9 9 import 'rxjs/add/operator/do';
10 10 import { Observable } from 'rxjs/Observable';
11   -import { GlobalService } from '../../Shared/global';
  11 +import { GlobalService } from '../../shared/global';
12 12 import { DatePipe } from '@angular/common';
13 13  
14 14 @Injectable()
... ... @@ -102,6 +102,12 @@ export class ReportService {
102 102 if (obj.sToDate == '') {
103 103 obj.sToDate = '1/1/9999';
104 104 }
  105 + if (obj.iStartPrice == '') {
  106 + obj.iStartPrice = 0;
  107 + }
  108 + if (obj.iEndPrice == '') {
  109 + obj.iEndPrice = 0;
  110 + }
105 111 obj.sFromDate = this.datePipe.transform(obj.sFromDate, 'MM/dd/yyyy');
106 112 obj.sToDate = this.datePipe.transform(obj.sToDate, 'MM/dd/yyyy');
107 113  
... ...
400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts
... ... @@ -7,17 +7,17 @@ import { Observable } from &#39;rxjs/Observable&#39;;
7 7 import 'rxjs/Rx';
8 8 import 'rxjs/add/operator/map';
9 9 import 'rxjs/add/operator/filter';
10   -import { SiteLicenseUsageReports } from '../Reports/reportdatamodel';
11   -import { ReportService } from '../Reports/report.service';
12   -import { GlobalService } from '../../Shared/global';
  10 +import { SiteLicenseUsageReports } from '../reports/reportdatamodel';
  11 +import { ReportService } from '../reports/report.service';
  12 +import { GlobalService } from '../../shared/global';
13 13 import { BsModalService } from 'ngx-bootstrap/modal';
14 14 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
15 15 import { DatePipe } from '@angular/common';
16 16 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
17 17 import { Http, Response } from '@angular/http';
18 18 import { LoadingService } from '../../shared/loading.service';
19   -import { PagerComponent } from '../../shared/Pager/pager.component';
20   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  19 +import { PagerComponent } from '../../shared/pager/pager.component';
  20 +import { ConfirmService } from '../../shared/confirm/confirm.service';
21 21 declare var $: any;
22 22  
23 23 @Component({
... ... @@ -150,6 +150,7 @@ export class SiteLicenseUsageReport implements OnInit {
150 150 }
151 151  
152 152 SearchRecords() {
  153 + this.ExportingStart = false;
153 154 this.GetSiteLicenseUsageReport('1, ' + this.pageLength);
154 155 }
155 156  
... ...
400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts
... ... @@ -7,16 +7,16 @@ import { Observable } from &#39;rxjs/Observable&#39;;
7 7 import 'rxjs/Rx';
8 8 import 'rxjs/add/operator/map';
9 9 import 'rxjs/add/operator/filter';
10   -import { SubscriptionCancellationReports} from '../Reports/reportdatamodel';
11   -import { ReportService } from '../Reports/report.service';
12   -import { GlobalService } from '../../Shared/global';
  10 +import { SubscriptionCancellationReports} from '../reports/reportdatamodel';
  11 +import { ReportService } from '../reports/report.service';
  12 +import { GlobalService } from '../../shared/global';
13 13 import { BsModalService } from 'ngx-bootstrap/modal';
14 14 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
15 15 import { DatePipe } from '@angular/common';
16 16 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
17 17 import { Http, Response } from '@angular/http';
18 18 import { LoadingService } from '../../shared/loading.service';
19   -import { PagerComponent } from '../../shared/Pager/pager.component';
  19 +import { PagerComponent } from '../../shared/pager/pager.component';
20 20 declare var $: any;
21 21  
22 22 @Component({
... ... @@ -99,7 +99,7 @@ export class SubscriptionCancellationReport implements OnInit {
99 99 { width: 350, align: 'Center' },
100 100 { width: 500, align: 'Center' },
101 101 { width: 130, align: 'Center' },
102   - { width: 120, align: 'center' },
  102 + { width: 150, align: 'center' },
103 103 { width: 280, align: 'Center' },
104 104 { width: 180, align: 'center' },
105 105 { width: 200, align: 'center' },
... ... @@ -173,6 +173,7 @@ export class SubscriptionCancellationReport implements OnInit {
173 173 }
174 174 }
175 175 SearchRecords() {
  176 + this.ExportingStart = false;
176 177 this.GetSubscriptionCancellationReport('1, ' + this.pageLength);
177 178 }
178 179 ExportEvent() {
... ...
400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts
... ... @@ -7,16 +7,16 @@ import { Observable } from &#39;rxjs/Observable&#39;;
7 7 import 'rxjs/Rx';
8 8 import 'rxjs/add/operator/map';
9 9 import 'rxjs/add/operator/filter';
10   -import { SubscriptionReports } from '../Reports/reportdatamodel';
11   -import { ReportService } from '../Reports/report.service';
12   -import { GlobalService } from '../../Shared/global';
  10 +import { SubscriptionReports } from '../reports/reportdatamodel';
  11 +import { ReportService } from '../reports/report.service';
  12 +import { GlobalService } from '../../shared/global';
13 13 import { BsModalService } from 'ngx-bootstrap/modal';
14 14 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
15 15 import { DatePipe } from '@angular/common';
16 16 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
17 17 import { Http, Response } from '@angular/http';
18 18 import { LoadingService } from '../../shared/loading.service';
19   -import { PagerComponent } from '../../shared/Pager/pager.component';
  19 +import { PagerComponent } from '../../shared/pager/pager.component';
20 20 declare var $: any;
21 21  
22 22 @Component({
... ... @@ -99,7 +99,7 @@ export class SubscriptionReport implements OnInit {
99 99 { width: 350, align: 'Center' },
100 100 { width: 500, align: 'Center' },
101 101 { width: 130, align: 'Center' },
102   - { width: 120, align: 'center' },
  102 + { width: 150, align: 'center' },
103 103 { width: 280, align: 'Center' },
104 104 { width: 180, align: 'center' },
105 105 { width: 200, align: 'center' },
... ... @@ -171,6 +171,7 @@ export class SubscriptionReport implements OnInit {
171 171 }
172 172 }
173 173 SearchRecords() {
  174 + this.ExportingStart = false;
174 175 this.GetSubscriptionReport('1, ' + this.pageLength);
175 176 }
176 177 ExportEvent() {
... ...
400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html
  1 +<style>
  2 + :host /deep/ ng2-smart-table {
  3 + font-size: 12px;
  4 + }
  5 +</style>
1 6 <div class="row">
2 7 <div class="col-sm-12 pageHeading" style="margin-left: 15px;">
3 8 <h4>Usage Report</h4>
... ... @@ -139,46 +144,49 @@
139 144 </div>
140 145  
141 146 <div class="well">
  147 + <!--<ng2-smart-table [settings]="settings" [source]="data">
  148 + <i class="fa fa-spinner fa-spin" style="font-size:24px"></i>
  149 + </ng2-smart-table>-->
142 150 <table id="fixed_hdr2" class="table-hover ">
143   - <thead>
144   - <tr>
145   - <th>User Name</th>
146   - <th>First Name</th>
147   - <th>Last Name</th>
148   - <th>Account Number</th>
149   - <th>Institution Name</th>
150   - <th>Credit Card Number</th>
151   - <th>User Type</th>
152   - <th>Zip</th>
153   - <th>State(only U.S.)</th>
154   - <th>Country</th>
155   - <th>Total Login</th>
156   - <th>Original Entry Date</th>
157   - <th>Last Login Date</th>
158   - </tr>
159   - </thead>
160   - <tbody>
161   - <tr *ngIf="NoRecord !== ''">
  151 + <thead>
  152 + <tr>
  153 + <th>User Name</th>
  154 + <th>First Name</th>
  155 + <th>Last Name</th>
  156 + <th>Account Number</th>
  157 + <th>Institution Name</th>
  158 + <th>Credit Card Number</th>
  159 + <th>User Type</th>
  160 + <th>Zip</th>
  161 + <th>State(only U.S.)</th>
  162 + <th>Country</th>
  163 + <th>Total Login</th>
  164 + <th>Original Entry Date</th>
  165 + <th>Last Login Date</th>
  166 + </tr>
  167 + </thead>
  168 + <tbody>
  169 + <tr *ngIf="NoRecord !== ''">
162 170  
163   - <td colspan="6"><b style="color: red;text-align: center; padding-left: 606px;"><span [innerHTML]="NoRecord"></span></b></td>
164   - </tr>
165   - <tr *ngFor="let usage of lstUserUsageReport">
166   - <td>{{usage.LoginId}}</td>
167   - <td>{{usage.FirstName}}</td>
168   - <td>{{usage.LastName}}</td>
169   - <td>{{usage.AccountNumber}}</td>
170   - <td>{{usage.InstitutionName}}</td>
171   - <td>{{usage.CardNumber}}</td>
172   - <td>{{usage.UserType}}</td>
173   - <td>{{usage.LicenseZip}}</td>
174   - <td>{{usage.LicenseState}}</td>
175   - <td>{{usage.LicenseCountry}}</td>
176   - <td>{{usage.TotalLogins}}</td>
177   - <td>{{usage.LicenseCreationDate}}</td>
178   - <td>{{usage.LastLoginDate}}</td>
179   - </tr>
180   - </tbody>
181   - </table>
  171 + <td colspan="6"><b style="color: red;text-align: center; padding-left: 606px;"><span [innerHTML]="NoRecord"></span></b></td>
  172 + </tr>
  173 + <tr *ngFor="let usage of lstUserUsageReport">
  174 + <td>{{usage.LoginId}}</td>
  175 + <td>{{usage.FirstName}}</td>
  176 + <td>{{usage.LastName}}</td>
  177 + <td>{{usage.AccountNumber}}</td>
  178 + <td>{{usage.InstitutionName}}</td>
  179 + <td>{{usage.CardNumber}}</td>
  180 + <td>{{usage.UserType}}</td>
  181 + <td>{{usage.LicenseZip}}</td>
  182 + <td>{{usage.LicenseState}}</td>
  183 + <td>{{usage.LicenseCountry}}</td>
  184 + <td>{{usage.TotalLogins}}</td>
  185 + <td>{{usage.LicenseCreationDate}}</td>
  186 + <td>{{usage.LastLogin}}</td>
  187 + </tr>
  188 + </tbody>
  189 + </table>
182 190 <admin-pager [recordCount]="recordCount" [pageNo]="pageNo" [pageLength]="pageLength" (pagerEvent)="GetUsageReport($event)"></admin-pager>
183 191 <div class="row">
184 192 <div class="col-sm-12 marginTop20 text-center">
... ...
400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts
... ... @@ -7,16 +7,17 @@ import { Observable } from &#39;rxjs/Observable&#39;;
7 7 import 'rxjs/Rx';
8 8 import 'rxjs/add/operator/map';
9 9 import 'rxjs/add/operator/filter';
10   -import { UsageReports } from '../Reports/reportdatamodel';
11   -import { ReportService } from '../Reports/report.service';
12   -import { GlobalService } from '../../Shared/global';
  10 +import { UsageReports } from '../reports/reportdatamodel';
  11 +import { ReportService } from '../reports/report.service';
  12 +import { GlobalService } from '../../shared/global';
13 13 import { BsModalService } from 'ngx-bootstrap/modal';
14 14 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
15 15 import { DatePipe } from '@angular/common';
16 16 import { BsDatepickerModule, BsDatepickerConfig } from 'ngx-bootstrap';
17 17 import { Http, Response } from '@angular/http';
18 18 import { LoadingService } from '../../shared/loading.service';
19   -import { PagerComponent } from '../../shared/Pager/pager.component';
  19 +import { PagerComponent } from '../../shared/pager/pager.component';
  20 +//import { LocalDataSource } from 'ng2-smart-table';
20 21 declare var $: any;
21 22  
22 23 @Component({
... ... @@ -57,6 +58,88 @@ export class UsageReport implements OnInit, AfterViewChecked {
57 58 recordCount: number;
58 59 pageNo: number;
59 60 pageLength: number;
  61 + //Smart Table Setting
  62 + settings = {
  63 + actions: { add: false, edit: false, delete: false },
  64 + pager: {
  65 + display: true,
  66 + perPage: 50
  67 + },
  68 + attr: {
  69 + class: 'table table-condensed table-bordered table-striped table-hover'
  70 + },
  71 + //hideSubHeader:true,
  72 + //rowClassFunction: (row) => {
  73 + // if (row.index == this.selectedRow) {
  74 + // return 'ng2-smart-row selected';
  75 + // }
  76 + // else {
  77 + // return 'ng2-smart-row';
  78 + // }
  79 + //},
  80 + //noDataMessage:'Loading, Please wait...',
  81 + columns: {
  82 + LoginId: {
  83 + title: 'User Name',
  84 + width: '140px',
  85 + },
  86 + FirstName: {
  87 + title: 'First Name',
  88 + width: '140px'
  89 + },
  90 + LastName: {
  91 + title: 'Last Name',
  92 + width: '140px'
  93 + },
  94 + AccountNumber: {
  95 + title: 'Account Number',
  96 + width: '140px'
  97 + },
  98 + InstitutionName: {
  99 + title: 'Institution Name',
  100 + width: '140px'
  101 + },
  102 + CardNumber: {
  103 + title: 'Credit Card Number',
  104 + width: '140px'
  105 + }
  106 + ,
  107 + UserType: {
  108 + title: 'User Type',
  109 + width: '140px'
  110 + },
  111 + Zip: {
  112 + title: 'Zip',
  113 + width: '140px'
  114 + },
  115 + LicenseState: {
  116 + title: 'State(only U.S.)',
  117 + width: '140px'
  118 + }
  119 + ,
  120 + LicenseCountry: {
  121 + title: 'Country',
  122 + width: '140px'
  123 + }
  124 + ,
  125 + TotalLogins: {
  126 + title: 'Total Login',
  127 + width: '140px'
  128 + },
  129 + LicenseCreationDate: {
  130 + title: 'Original Entry Date',
  131 + width: '140px'
  132 + },
  133 + LastLogin: {
  134 + title: 'Last Login Date',
  135 + width: '140px'
  136 + }
  137 +
  138 +
  139 + }
  140 + };
  141 + //source: LocalDataSource;
  142 +
60 143 constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder,
61 144 private modalService: BsModalService, private global: GlobalService,
62 145 private _loadingService: LoadingService) { }
... ... @@ -109,7 +192,7 @@ export class UsageReport implements OnInit, AfterViewChecked {
109 192 { width: 180, align: 'center' },
110 193 { width: 200, align: 'center' },
111 194 { width: 170, align: 'center' },
112   - { width: 80, align: 'center' },
  195 + { width: 120, align: 'center' },
113 196 { width: 150, align: 'center' },
114 197 { width: 150, align: 'center' },
115 198 { width: 180, align: 'Center' },
... ... @@ -146,6 +229,7 @@ export class UsageReport implements OnInit, AfterViewChecked {
146 229 }
147 230 }
148 231 SearchRecords() {
  232 + this.ExportingStart = false;
149 233 this.GetUsageReport('1, ' + this.pageLength);
150 234 }
151 235 GetCountry() {
... ... @@ -156,10 +240,11 @@ export class UsageReport implements OnInit, AfterViewChecked {
156 240 this.reportservice.GetState().subscribe(st => { this.lstState = st; }, error => this.error = <any>error);
157 241 }
158 242  
159   - BindFormFields(data) {
160   - this.recordCount = data.RecordCount;
161   - this.lstUserUsageReport = data.UserUsage;
162   -
  243 + BindFormFields(dataResult) {
  244 + this.recordCount = dataResult.RecordCount;
  245 + this.lstUserUsageReport = dataResult.UserUsage;
  246 + //this.data = dataResult.UserUsage;
  247 + //this.source = new LocalDataSource(data);
163 248 this.numberOfUsageReport = this.lstUserUsageReport.length; this.limit = this.lstUserUsageReport.length;
164 249 if (this.lstUserUsageReport.length > 0) {
165 250 this.NoRecord = '';
... ...
400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.ts
... ... @@ -2,17 +2,17 @@ import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, OnChange
2 2 import { SubscriptionPriceService } from './subscriptionprice.service';
3 3 import { Router } from '@angular/router';
4 4 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
5   -import { SubscriptionPriceModel } from '../UserEntity/datamodel';
  5 +import { SubscriptionPriceModel } from '../userentity/datamodel';
6 6 import { BsDatepickerModule } from 'ngx-bootstrap';
7 7 import { Http, Response } from '@angular/http';
8 8 import { DatePipe } from '@angular/common';
9 9 import { ContenteditableModelDirective } from '../../shared/contenteditabledirective'
10 10 import { BsModalService } from 'ngx-bootstrap/modal';
11 11 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
12   -import { PagerComponent } from '../../shared/Pager/pager.component';
  12 +import { PagerComponent } from '../../shared/pager/pager.component';
13 13 import { LoadingService } from '../../shared/loading.service';
14   -import { GlobalService } from '../../Shared/global';
15   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  14 +import { GlobalService } from '../../shared/global';
  15 +import { ConfirmService } from '../../shared/confirm/confirm.service';
16 16 declare var $:any;
17 17  
18 18 @Component({
... ...
400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.service.ts
... ... @@ -6,7 +6,7 @@ import &#39;rxjs/add/operator/catch&#39;;
6 6 import 'rxjs/add/observable/throw';
7 7 import 'rxjs/add/operator/do';
8 8 import { Observable } from 'rxjs/Observable';
9   -import { GlobalService } from '../../Shared/global';
  9 +import { GlobalService } from '../../shared/global';
10 10  
11 11 @Injectable()
12 12 export class SubscriptionPriceService {
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.html
... ... @@ -76,7 +76,7 @@
76 76 <!--<option *ngFor="let AccountNumberEntity of AccountNumberList" value="{{AccountNumberEntity.Id}}">{{ AccountNumberEntity.AccountNumber }}</option>
77 77 </select>
78 78 </div>-->
79   - <div class="col-sm-7" dropdown (isOpenChange)="onOpenChange($event)">
  79 + <div class="col-sm-7" dropdown (isOpenChange)="onOpenChange($event)" (keyup)="onKeyPress($event)">
80 80 <button id="button-basic" dropdownToggle type="button" class="btn btn-primary dropdown-toggle col-sm-12 col-xs-12"
81 81 aria-controls="dropdown-basic" style="height: 30px;">
82 82 <span class="pull-left" style="margin-top: -1px;">{{accountDropDownText}}</span>
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts
1   -import { Component, OnInit, AfterViewInit,ViewChild } from '@angular/core';
2   -import { UserService } from '../UserEntity/user.service';
  1 +import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core';
  2 +import { UserService } from '../userentity/user.service';
3 3 import { Router } from '@angular/router';
4 4 import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
5 5 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
6   -import { User } from '../UserEntity/datamodel';
  6 +import { User } from '../userentity/datamodel';
7 7 import { Http, Response } from '@angular/http';
8   -import { GlobalService } from '../../Shared/global';
  8 +import { GlobalService } from '../../shared/global';
9 9 //import { DBOperation } from 'S';
10 10 import { Observable } from 'rxjs/Observable';
11   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  11 +import { ConfirmService } from '../../shared/confirm/confirm.service';
12 12 import 'rxjs/Rx';
13 13 import 'rxjs/add/operator/map';
14 14 import 'rxjs/add/operator/filter';
15 15 import { LoadingService } from '../../shared/loading.service';
16 16  
17 17 @Component({
18   - templateUrl:'./adduser.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html'
  18 + templateUrl: './adduser.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html'
19 19 })
20 20  
21   -export class AddUser implements OnInit {
22   - user: User;
  21 +export class AddUser implements OnInit {
  22 + user: User;
23 23 baseUrl: string = "User";
24 24 adduserFrm: FormGroup;
25 25 useFname: string;
... ... @@ -33,21 +33,26 @@ export class AddUser implements OnInit {
33 33 public ProductEditionList: any;
34 34 modalTitle: string;
35 35 accountDropDownText: string;
36   - loopIdx: number;
  36 + loopIdx1: number;
  37 + loopIdx2: number;
  38 + lastScrollPos: number;
37 39 //@ViewChild("profileModal")
38 40 //profileModal: ModalComponent;
39 41 //errorMessage: any;
40   - constructor(private _loadingService: LoadingService,private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http,
41   - private _confirmService: ConfirmService, private commonService: GlobalService
  42 +
  43 + constructor(private _loadingService: LoadingService, private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http,
  44 + private _confirmService: ConfirmService, private commonService: GlobalService
42 45 ) { }
43   -
  46 +
44 47 ngOnInit(): void {
45   -
  48 +
46 49 this.user = new User();
47 50 this.alerts = '';
48 51 this.accountDropDownText = 'Select';
49   - this.loopIdx = 0;
50   - //this.userservice.GetUserById(this.UserId);
  52 + this.loopIdx1 = 0;
  53 + this.loopIdx2 = 0;
  54 + this.lastScrollPos = 0
  55 + //this.userservice.GetUserById(this.UserId);
51 56 this.adduserFrm = this.fb.group({
52 57 id: [''],
53 58 UserName: ['', [Validators.required, Validators.minLength(8)]],
... ... @@ -58,7 +63,7 @@ export class AddUser implements OnInit {
58 63 EmailId: ['', Validators.required],
59 64 AccountNumberId: ['', Validators.required],
60 65 UserTypeId: ['', Validators.required],
61   - ProductEditionId: ['', Validators.required]
  66 + ProductEditionId: ['', Validators.required]
62 67 });
63 68 debugger
64 69 this._loadingService.ShowLoading("global-loading");
... ... @@ -73,66 +78,92 @@ export class AddUser implements OnInit {
73 78 GetUserTypeByLicenseId() {
74 79 debugger;
75 80 var Accountnumber = this.adduserFrm.controls['AccountNumberId'].value;
76   - if (Accountnumber == "") { Accountnumber=0}
77   - this.userservice.GetUserTypeByLicenseType({
  81 + if (Accountnumber == "") { Accountnumber = 0 }
  82 + this.userservice.GetUserTypeByLicenseType({
78 83 AccountNumberId: Accountnumber
79 84 }).subscribe(x => { this.UserTypeList = x; }, error => this.error = <any>error);
80   - }
  85 + }
81 86 GetAccountNumber() {
82 87 this.userservice.GetAccountNumber()
83   - .subscribe(x => {
84   - this.AccountNumberList=x ;
  88 + .subscribe(x => {
  89 + this.AccountNumberList = x;
85 90 this.tempLstAccountNumbers = [];
86   - this.loopIdx = 0;
87   - for (var i = 0; i < 1000; i++) {
88   - if(this.loopIdx < this.AccountNumberList.length){
89   - this.tempLstAccountNumbers.push(this.AccountNumberList[this.loopIdx]);
90   - this.loopIdx++;
91   - }
92   - }
93   - },
94   - error => this.error = <any>error);
  91 + this.loopIdx1 = 0;
  92 + this.loopIdx2 = 0;
  93 + this.lastScrollPos = 0;
  94 + this.tempLstAccountNumbers = [];
  95 + for (var i = 0; i < 50; i++) {
  96 + this.tempLstAccountNumbers.push(this.AccountNumberList[this.loopIdx2++]);
  97 + }
  98 + },
  99 + error => this.error = <any>error);
95 100 }
96   -
  101 +
97 102 GetProductEdition() {
98 103 this.userservice.GetProductEdition({
99   - AccountNumberId: this.adduserFrm.controls['AccountNumberId'].value})
100   - .subscribe(x => { console.log(x); this.ProductEditionList=x }, error => this.error = <any>error);
  104 + AccountNumberId: this.adduserFrm.controls['AccountNumberId'].value
  105 + })
  106 + .subscribe(x => { console.log(x); this.ProductEditionList = x }, error => this.error = <any>error);
101 107 }
102 108 //BindUserTypeAndProductEdition(deviceValue) {
103   - //this.GetUserTypeByLicenseId();
104   - //this.GetProductEdition();
  109 + //this.GetUserTypeByLicenseId();
  110 + //this.GetProductEdition();
105 111 //}
106   - AccountNumberChanged(LicenseId: number, SelectText: string){
  112 + AccountNumberChanged(LicenseId: number, SelectText: string) {
107 113 this.accountDropDownText = SelectText;
108 114 this.adduserFrm.controls['AccountNumberId'].setValue(LicenseId);
109 115 this.GetUserTypeByLicenseId();
110 116 this.GetProductEdition();
111 117 }
112   -
113   - onScroll($event){
114   - if($event.target.scrollTop >= ($event.target.scrollHeight/2)){
115   - for (var i = 0; i < 5000; i++) {
116   - if(this.loopIdx < this.AccountNumberList.length){
117   - this.tempLstAccountNumbers.push(this.AccountNumberList[this.loopIdx]);
118   - this.loopIdx++;
119   - }
120   - }
  118 +
  119 + onScroll($event) {
  120 + if (this.lastScrollPos > $event.target.scrollTop) {
  121 + for (var i = 0; i < 1000; i++) {
  122 + if (this.loopIdx1 > 0)
  123 + this.tempLstAccountNumbers.unshift(this.AccountNumberList[this.loopIdx1--]);
  124 + }
121 125 }
122   -}
  126 + else {
  127 + for (var i = 0; i < 1000; i++) {
  128 + if (this.loopIdx2 < this.AccountNumberList.length)
  129 + this.tempLstAccountNumbers.push(this.AccountNumberList[this.loopIdx2++]);
  130 + }
  131 + }
  132 + this.lastScrollPos = $event.target.scrollTop;
  133 + }
123 134  
124   -onOpenChange(data: boolean): void {
125   - if(!data){
126   - this.loopIdx = 0;
127   - this.tempLstAccountNumbers = [];
128   - for (var i = 0; i < 1000; i++) {
129   - if(this.loopIdx < this.AccountNumberList.length){
130   - this.tempLstAccountNumbers.push(this.AccountNumberList[this.loopIdx]);
131   - this.loopIdx++;
132   - }
133   - }
  135 + onOpenChange(data: boolean): void {
  136 + if (!data) {
  137 + this.loopIdx1 = 0;
  138 + this.loopIdx2 = 0;
  139 + this.tempLstAccountNumbers = [];
  140 + for (var i = 0; i < 50; i++) {
  141 + this.tempLstAccountNumbers.push(this.AccountNumberList[this.loopIdx2++]);
  142 + }
134 143 }
135   -}
  144 + }
  145 +
  146 + onKeyPress($event) {
  147 + let FindItem = this.AccountNumberList.find(C => (C.AccountNumber.toLowerCase().indexOf($event.key) == 0));
  148 + let prevIdx = 0;
  149 + if (FindItem != null) {
  150 + for (var i = 0; i < this.AccountNumberList.length; i++) {
  151 + if (FindItem.Id == this.AccountNumberList[i].Id) {
  152 + prevIdx = i;
  153 + break;
  154 + }
  155 + }
  156 + this.tempLstAccountNumbers = [];
  157 + this.loopIdx1 = prevIdx;
  158 + this.loopIdx2 = prevIdx;
  159 + for (var i = 0; i < 50; i++) {
  160 + if (this.loopIdx2 < this.AccountNumberList.length)
  161 + this.tempLstAccountNumbers.push(this.AccountNumberList[this.loopIdx2++]);
  162 + }
  163 + this.lastScrollPos = 0;
  164 + $event.target.nextElementSibling.scrollTop = 0;
  165 + }
  166 + }
136 167  
137 168 public AddUser(this) {
138 169 this.alerts = '';
... ... @@ -176,15 +207,15 @@ onOpenChange(data: boolean): void {
176 207 this.alerts = "<span>" + this.error + "</span>";
177 208 });
178 209 }
179   -
  210 +
180 211 }
181 212 AfterInsertData(data) {
182 213 //debugger;
183 214 if (data == "User added successfully") {
184 215 this.alerts = '';
185 216 this._confirmService.activate("User added successfully.", "alertMsg");
186   - }
187   -
  217 + }
  218 +
188 219 }
189 220 ResetForm() {
190 221 this._buildForm();
... ... @@ -200,17 +231,17 @@ onOpenChange(data: boolean): void {
200 231 EmailId: [""],
201 232 AccountNumberId: ["0"],
202 233 UserTypeId: ["0"],
203   - ProductEditionId: ["0"]
204   -
  234 + ProductEditionId: ["0"]
  235 +
205 236 });
206 237 }
207 238 bindUsers() {
208   -
  239 +
209 240 //console.log(data);
210 241 //alert(JSON.stringify(data));
211 242 //this.user = data[0];
212 243  
213   -
  244 +
214 245 this.adduserFrm.controls['id'].setValue(0)
215 246 this.adduserFrm.controls['FirstName'].setValue('')
216 247 this.adduserFrm.controls['LastName'].setValue('')
... ... @@ -221,6 +252,6 @@ onOpenChange(data: boolean): void {
221 252 this.adduserFrm.controls['AccountNumberId'].setValue(0)
222 253 this.adduserFrm.controls['UserTypeId'].setValue(0)
223 254 this.adduserFrm.controls['ProductEditionId'].setValue(0)
224   -
225   - }
  255 +
  256 + }
226 257 }
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserid.component.ts
... ... @@ -3,12 +3,12 @@ import { UserService } from &#39;./user.service&#39;;
3 3 import { Router } from '@angular/router';
4 4 import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
5 5 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
6   -import { User } from '../UserEntity/datamodel';
  6 +import { User } from '../userentity/datamodel';
7 7 import { Http, Response } from '@angular/http';
8 8 //import { Global } from '../../Shared/global';
9 9 //import { DBOperation } from 'S';
10 10 import { Observable } from 'rxjs/Observable';
11   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  11 +import { ConfirmService } from '../../shared/confirm/confirm.service';
12 12 import 'rxjs/Rx';
13 13 import 'rxjs/add/operator/map';
14 14 import 'rxjs/add/operator/filter';
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/changeuserpassword.component.ts
... ... @@ -3,13 +3,13 @@ import { UserService } from &#39;./user.service&#39;;
3 3 //import { ChangeUserPasswordService } from '../ChangePassword/changeuserpassword.service';
4 4 import { Router } from '@angular/router';
5 5 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
6   -import { User } from '../UserEntity/datamodel';
  6 +import { User } from '../userentity/datamodel';
7 7 import { Http, Response } from '@angular/http';
8 8 //import { Global } from '../../Shared/global';
9 9 //import { DBOperation } from 'S';
10 10 //import { Observable } from 'rxjs/Observable';
11 11 import { Observable } from 'rxjs/Observable';
12   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  12 +import { ConfirmService } from '../../shared/confirm/confirm.service';
13 13 import 'rxjs/Rx';
14 14 import 'rxjs/add/operator/map';
15 15 import 'rxjs/add/operator/filter';
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/unblockuser.component.ts
... ... @@ -3,12 +3,12 @@ import { UserService } from &#39;./user.service&#39;;
3 3 import { Router } from '@angular/router';
4 4 import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
5 5 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
6   -import { User } from '../UserEntity/datamodel';
  6 +import { User } from '../userentity/datamodel';
7 7 import { Http, Response } from '@angular/http';
8   -import { GlobalService } from '../../Shared/global';
  8 +import { GlobalService } from '../../shared/global';
9 9 //import { DBOperation } from 'S';
10 10 import { Observable } from 'rxjs/Observable';
11   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  11 +import { ConfirmService } from '../../shared/confirm/confirm.service';
12 12 import 'rxjs/Rx';
13 13 import 'rxjs/add/operator/map';
14 14 import 'rxjs/add/operator/filter';
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/updateuserprofile.component.ts
1 1 import { Component, OnInit, AfterViewInit,ViewChild } from '@angular/core';
2   -import { UserService } from '../UserEntity/user.service';
  2 +import { UserService } from '../userentity/user.service';
3 3 import { Router } from '@angular/router';
4 4 import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
5 5 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
6   -import { User } from '../UserEntity/datamodel';
  6 +import { User } from '../userentity/datamodel';
7 7 import { Http, Response } from '@angular/http';
8   -import { GlobalService } from '../../Shared/global';
  8 +import { GlobalService } from '../../shared/global';
9 9 //import { DBOperation } from 'S';
10 10 import { Observable } from 'rxjs/Observable';
11   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  11 +import { ConfirmService } from '../../shared/confirm/confirm.service';
12 12 import 'rxjs/Rx';
13 13 import 'rxjs/add/operator/map';
14 14 import 'rxjs/add/operator/filter';
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts
... ... @@ -4,10 +4,10 @@ import { Http, Response, Headers, RequestOptions, HttpModule } from &#39;@angular/ht
4 4 import 'rxjs/add/operator/map';
5 5 import 'rxjs/add/operator/catch';
6 6 import 'rxjs/add/observable/throw';
7   -import { User } from '../UserEntity/datamodel';
  7 +import { User } from '../userentity/datamodel';
8 8 import 'rxjs/add/operator/do';
9 9 import { Observable } from 'rxjs/Observable';
10   -import { GlobalService } from '../../Shared/global';
  10 +import { GlobalService } from '../../shared/global';
11 11 @Injectable()
12 12 export class UserService {
13 13  
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.html
... ... @@ -51,27 +51,12 @@
51 51 <div class="col-sm-12">
52 52 <div class="form-group marginTop5">
53 53 <label for="AccountNumber" class="col-sm-12 col-lg-6 control-label text-right-lg paddTop7 padd-left0">Account Number :</label>
54   - <!--<div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
  54 + <div class="col-sm-12 col-lg-6 padd-left0 padd-right0">
55 55 <select #accountvalue class="form-control input-sm " id="AccountNumber" (change)="AccountNumberChanged($event.target.value, $event)">
56 56 <option value="0">Select</option>
57 57 <option *ngFor="let item of lstAccountNumbers;" value="{{item.m_Item1}}">{{item.m_Item2}}</option>
58 58 </select>
59   - </div>-->
60   - <div class="col-sm-12 col-lg-6 padd-left0 padd-right0" dropdown (isOpenChange)="onOpenChange($event)">
61   - <button id="button-basic" dropdownToggle type="button" class="btn btn-primary dropdown-toggle col-sm-12 col-xs-12"
62   - aria-controls="dropdown-basic" style="height: 30px;">
63   - <span class="pull-left" style="margin-top: -1px;">{{accountDropDownText}}</span>
64   - <span class="caret pull-right" style="margin-top: 6px;"></span>
65   - </button>
66   - <ul id="dropdown-basic" *dropdownMenu class="dropdown-menu" role="menu" aria-labelledby="button-basic" style="overflow: scroll; height: 200px;" (scroll)="onScroll($event)">
67   - <li role="menuitem">
68   - <a class="dropdown-item" href="#" (click)="AccountNumberChanged(0, 'Select')">Select</a>
69   - </li>
70   - <li role="menuitem" *ngFor="let item of tempLstAccountNumbers">
71   - <a class="dropdown-item" href="#" (click)="AccountNumberChanged(item.m_Item1, item.m_Item2)">{{item.m_Item2}}</a>
72   - </li>
73   - </ul>
74   - </div>
  59 + </div>
75 60 </div>
76 61 </div>
77 62 </div>
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.ts
... ... @@ -2,16 +2,16 @@ import { Component, OnInit, AfterViewInit, AfterViewChecked, Input, Output, Even
2 2 import { UserService } from './user.service';
3 3 import { Router, ActivatedRoute } from '@angular/router';
4 4 import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
5   -import { License } from '../UserEntity/datamodel';
  5 +import { License } from '../userentity/datamodel';
6 6 import { BsDatepickerModule } from 'ngx-bootstrap';
7 7 import { Http, Response } from '@angular/http';
8 8 import { DatePipe } from '@angular/common';
9 9 import { BsModalService } from 'ngx-bootstrap/modal';
10 10 import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
11   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
12   -import { PagerComponent } from '../../shared/Pager/pager.component';
  11 +import { ConfirmService } from '../../shared/confirm/confirm.service';
  12 +import { PagerComponent } from '../../shared/pager/pager.component';
13 13 import { LoadingService } from '../../shared/loading.service';
14   -import { GlobalService } from '../../Shared/global';
  14 +import { GlobalService } from '../../shared/global';
15 15 declare var $: any;
16 16  
17 17 @Component({
... ... @@ -141,14 +141,6 @@ export class UserGroup implements OnInit, AfterViewChecked {
141 141 this.userService.GetLicenseAccounts(1)
142 142 .subscribe(st => {
143 143 this.lstAccountNumbers = st;
144   - this.tempLstAccountNumbers = [];
145   - this.loopIdx = 0;
146   - for (var i = 0; i < 1000; i++) {
147   - if(this.loopIdx < this.lstAccountNumbers.length){
148   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
149   - this.loopIdx++;
150   - }
151   - }
152 144 },
153 145 error => this.error = <any>error);
154 146 }
... ... @@ -196,30 +188,6 @@ export class UserGroup implements OnInit, AfterViewChecked {
196 188 this.SearchRecords();
197 189 }
198 190  
199   - onScroll($event){
200   - if($event.target.scrollTop >= ($event.target.scrollHeight/2)){
201   - for (var i = 0; i < 5000; i++) {
202   - if(this.loopIdx < this.lstAccountNumbers.length){
203   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
204   - this.loopIdx++;
205   - }
206   - }
207   - }
208   -}
209   -
210   -onOpenChange(data: boolean): void {
211   - if(!data){
212   - this.loopIdx = 0;
213   - this.tempLstAccountNumbers = [];
214   - for (var i = 0; i < 1000; i++) {
215   - if(this.loopIdx < this.lstAccountNumbers.length){
216   - this.tempLstAccountNumbers.push(this.lstAccountNumbers[this.loopIdx]);
217   - this.loopIdx++;
218   - }
219   - }
220   - }
221   -}
222   -
223 191 AfterDeleteData(data, template) {
224 192 if (data.Status == "false") {
225 193 this.alerts = "<span>License user group delete unsuccessfull</span>";
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
... ... @@ -3,21 +3,21 @@ import { UserService } from &#39;./user.service&#39;;
3 3 import { Router } from '@angular/router';
4 4 import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
5 5 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
6   -import { User } from '../UserEntity/datamodel';
7   -import { UserManageRightsModel } from '../UserEntity/datamodel';
  6 +import { User } from '../userentity/datamodel';
  7 +import { UserManageRightsModel } from '../userentity/datamodel';
8 8 import { Http, Response } from '@angular/http';
9 9 //import { Global } from '../../Shared/global';
10 10 //import { DBOperation } from 'S';
11 11 import { Observable } from 'rxjs/Observable';
12   -import { ConfirmService } from '../../Shared/Confirm/confirm.service';
  12 +import { ConfirmService } from '../../shared/confirm/confirm.service';
13 13 import 'rxjs/Rx';
14 14 import 'rxjs/add/operator/map';
15 15 import 'rxjs/add/operator/filter';
16 16 import { LoadingService } from '../../shared/loading.service';
17 17 declare var $: any;
18 18 import { DatePipe } from '@angular/common';
19   -import { GlobalService } from '../../Shared/global';
20   -import { PagerComponent } from '../../shared/Pager/pager.component';
  19 +import { GlobalService } from '../../shared/global';
  20 +import { PagerComponent } from '../../shared/pager/pager.component';
21 21 @Component({
22 22 templateUrl:'./users.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html'
23 23 })
... ...
400-SOURCECODE/Admin/src/app/shared/global.ts
... ... @@ -25,9 +25,9 @@ export class GlobalService {
25 25 this.LiveAPIURL = "http://beta.interactiveanatomy.com/API/Adminapi/";
26 26 this.QAAPIURL = "http://qa.beta.interactiveanatomy.com/API/Adminapi/";
27 27 this.LocalURL = "http://localhost:4200";
28   - //this.resourceBaseUrl = this.hostURL;
  28 + this.resourceBaseUrl = this.hostURL;
29 29 //this.resourceBaseUrl = this.LiveAPIURL;
30   - this.resourceBaseUrl = this.QAAPIURL;
  30 + // this.resourceBaseUrl = this.QAAPIURL;
31 31 if (this.resourceBaseUrl == "http://192.168.84.242:97/") {
32 32  
33 33 localStorage.setItem('loggedInUserDetails', JSON.stringify(
... ...
400-SOURCECODE/Admin/src/assets/data/Menu.json
... ... @@ -492,7 +492,7 @@
492 492 "SubMenuId": "207",
493 493 "SubMenuName": "List User",
494 494 "SubMenuUrl": "users",
495   - "SubMenuStatus": "True"
  495 + "SubMenuStatus": "False"
496 496 },
497 497 {
498 498 "SubMenuId": "208",
... ...
400-SOURCECODE/Admin/src/tsconfig.app.json
... ... @@ -4,7 +4,8 @@
4 4 "outDir": "../out-tsc/app",
5 5 "baseUrl": "./",
6 6 "module": "es2015",
7   - "types": []
  7 + "types": [],
  8 + "preserveWhitespaces": true
8 9 },
9 10 "exclude": [
10 11 "test.ts",
... ...
500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetCancelledLicenses.sql 0 โ†’ 100644
  1 +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetCancelledLicenses]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  2 +drop procedure [dbo].[usp_GetCancelledLicenses]
  3 +GO
  4 +
  5 +CREATE PROCEDURE [dbo].[usp_GetCancelledLicenses]
  6 + -- Add the parameters for the stored procedure here
  7 + @sFromDate varchar(20), @sToDate varchar(20), @iStartPrice numeric(14,2), @iEndPrice numeric(14,2), @iLicenseTypeId tinyint,
  8 + @iAccountTypeId tinyint , @sZip varchar(20) = '', @iStateId int, @iCountryId int,@pageNo int, @pageLength int, @recordCount int out
  9 +AS
  10 +BEGIN
  11 +
  12 + IF 1=0 BEGIN
  13 + SET FMTONLY OFF
  14 + END
  15 + -- SET NOCOUNT ON added to prevent extra result sets from
  16 + SET NOCOUNT ON;
  17 + DECLARE @dtFromDate DATETIME
  18 + DECLARE @dtToDate DATETIME
  19 + DECLARE @cGetLicenseID CURSOR
  20 + DECLARE @iLicenseId INT
  21 + DECLARE @iLicenseSubscriptionDetail INT
  22 + DECLARE @sAccountNumber VARCHAR(50)
  23 + DECLARE @sLicenseeName VARCHAR(100)
  24 + DECLARE @sLicenseType VARCHAR(50)
  25 + DECLARE @sInstitutionName VARCHAR(100)
  26 + DECLARE @dtStartDate DATETIME
  27 + DECLARE @dtEndDate DATETIME
  28 + DECLARE @dtLicenseCreationDate DATETIME
  29 + DECLARE @mSubscriptionPrice MONEY
  30 + DECLARE @sAccountType VARCHAR(50)
  31 + DECLARE @sEdition VARCHAR(200)
  32 + DECLARE @iCardNumber INT
  33 +
  34 +
  35 + -- convert the datatype of fromdate & todate parameter to datetime
  36 + SELECT @dtFromDate = CONVERT(DATETIME,@sFromDate)
  37 + SELECT @dtToDate = DATEADD(ms,-3,DATEADD(DAY,1,CONVERT(DATETIME,@sToDate)))
  38 +
  39 + -- create a temporary table to store the desired results of cancelled licenses on the basis of parameter
  40 + CREATE TABLE #CancelledLicenseReport
  41 + (
  42 + AccountNumber VARCHAR(50),
  43 + LicenseeName VARCHAR(100),
  44 + LicenseType VARCHAR(50),
  45 + InstitutionName VARCHAR(100),
  46 + Edition VARCHAR(200),
  47 + ValidFrom DATETIME,
  48 + ValidThrough DATETIME,
  49 + LicenseCreationDate DATETIME,
  50 + Price MONEY,
  51 + AccountType VARCHAR(50),
  52 + CardNumber INT
  53 + )
  54 +
  55 + -- define the forward only, read-only cursor
  56 + SET @cGetLicenseID = CURSOR FAST_FORWARD
  57 + FOR
  58 + SELECT LicenseSubscriptionDetail.LicenseId, MAX(LicenseSubscriptionDetail.Id)
  59 + FROM LicenseSubscriptionDetail
  60 + INNER JOIN License ON License.Id = LicenseSubscriptionDetail.LicenseId
  61 + WHERE (License.CancellationDate BETWEEN @dtFromDate AND @dtToDate) AND
  62 + (TotalAmount >= (CASE WHEN @iStartPrice > 0 THEN @iStartPrice ELSE 0 END))
  63 + AND (TotalAmount <= (CASE WHEN @iEndPrice = 0 THEN 0 WHEN @iEndPrice > 0 THEN @iEndPrice ELSE 9999999999 END))
  64 + GROUP BY LicenseSubscriptionDetail.LicenseId
  65 + --HAVING (MAX(SubscriptionValidThrough) BETWEEN @dtFromDate AND @dtToDate)
  66 +
  67 + -- open & fetch the cursor variables into the local variables
  68 + OPEN @cGetLicenseID
  69 + FETCH NEXT FROM @cGetLicenseID INTO @iLicenseId, @iLicenseSubscriptionDetail
  70 + -- start of while loop
  71 + WHILE @@FETCH_STATUS = 0
  72 + BEGIN
  73 +
  74 + SET @sEdition = ''
  75 + -- fetch the accountnumber, licenseename, licensetype, startdate, enddate, subscriptionprice, accountype of a license
  76 + SELECT @sAccountNumber = AccountNumber, @sLicenseeName = LicenseeName, @sLicenseType = LicenseType,
  77 + @sInstitutionName = InstitutionName,
  78 + @dtStartDate = SubscriptionValidFrom, @dtEndDate = SubscriptionValidThrough,
  79 + @dtLicenseCreationDate = CreationDate,
  80 + @mSubscriptionPrice = TotalAmount, @sAccountType = AccountType, @iCardNumber = CardNumber
  81 + FROM
  82 + (
  83 + SELECT AccountNumber, (LicenseeFirstName+' '+LicenseeLastName) as LicenseeName,
  84 + LicenseType.Title as LicenseType, License.InstitutionName,
  85 + AccountType.Title as AccountType, LicenseSubscriptionDetail.TotalAmount,
  86 + LicenseSubscriptionDetail.SubscriptionValidFrom, LicenseSubscriptionDetail.SubscriptionValidThrough,
  87 + License.CreationDate,
  88 + DATEDIFF(dd,GETDATE(),License.CancellationDate) as DaysRemaining, (CASE WHEN License.CardNumber > 0 THEN License.CardNumber END) as CardNumber
  89 + FROM License
  90 + INNER JOIN LicenseType ON License.LicenseTypeId = LicenseType.Id
  91 + INNER JOIN AccountType ON License.AccountTypeId = AccountType.Id
  92 + INNER JOIN State ON License.StateId = State.Id
  93 + INNER JOIN Country ON License.CountryId = Country.Id
  94 + INNER JOIN LicenseSubscriptionDetail ON License.Id = LicenseSubscriptionDetail.LicenseId
  95 + WHERE License.IsActive = 0
  96 + AND License.LicenseTypeId = (CASE WHEN @iLicenseTypeId > 0 THEN @iLicenseTypeId ELSE License.LicenseTypeId END)
  97 + AND License.AccountTypeId = (CASE WHEN @iAccountTypeId > 0 THEN @iAccountTypeId ELSE License.AccountTypeId END)
  98 + AND State.Id = (CASE WHEN @iStateId > 0 THEN @iStateId ELSE State.Id END)
  99 + AND Country.Id = (CASE WHEN @iCountryId > 0 THEN @iCountryId ELSE Country.Id END)
  100 + AND License.Zip = (CASE WHEN LEN(@sZip)>0 THEN @sZip ELSE License.Zip END)
  101 + AND LicenseSubscriptionDetail.Id = @iLicenseSubscriptionDetail
  102 + AND License.LicenseTypeId <> 5
  103 + ) t1
  104 +
  105 + -- check whether the above query returns any row
  106 + IF @@Rowcount > 0
  107 + BEGIN
  108 + -- fetch all the editions mapped as a string with a license
  109 + SELECT @sEdition = Edition.Title + '; ' + @sEdition
  110 + FROM LicenseToEdition INNER JOIN Edition
  111 + ON LicenseToEdition.EditionId = Edition.Id
  112 + WHERE LicenseToEdition.LicenseId = @iLicenseId
  113 + -- remove the trailing comma-separator from the edition-string
  114 + --AMI SET @sEdition = SUBSTRING(@sEdition,1,LEN(@sEdition)-1);
  115 + IF LEN(@sEdition)> 1
  116 + -- remove the trailing comma-separator from the edition-string
  117 + SET @sEdition = SUBSTRING(@sEdition,1,LEN(@sEdition)-1)
  118 + ELSE
  119 + SET @sEdition = @sEdition
  120 +
  121 + -- insert into the temporary table
  122 + INSERT INTO #CancelledLicenseReport
  123 + (AccountNumber,LicenseeName,LicenseType,InstitutionName,Edition,ValidFrom,ValidThrough,LicenseCreationDate,Price,AccountType,CardNumber)
  124 + VALUES(@sAccountNumber,@sLicenseeName,@sLicenseType,@sInstitutionName,@sEdition,@dtStartDate,@dtEndDate,@dtLicenseCreationDate,@mSubscriptionPrice,@sAccountType,@iCardNumber)
  125 + END
  126 + -- fetch the next record from cursor
  127 + FETCH NEXT FROM @cGetLicenseID INTO @iLicenseId,@iLicenseSubscriptionDetail
  128 + -- end of while loop
  129 + END
  130 + -- close the cursor to free up resources
  131 + CLOSE @cGetLicenseID
  132 + DEALLOCATE @cGetLicenseID
  133 +
  134 + -- Selecting the desired result from temporary table
  135 + --SELECT AccountNumber, LicenseeName, LicenseType,InstitutionName,AccountType, Edition, CONVERT(VARCHAR,ValidFrom,101) as StartDate,
  136 + -- CONVERT(VARCHAR,ValidThrough,101) as EndDate,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate, CONVERT(NUMERIC(14,2),Price) as SubscriptionPrice, CardNumber
  137 + --FROM #CancelledLicenseReport ORDER BY AccountNumber
  138 +
  139 +
  140 + SELECT RowNum as 'Serial_No', AccountNumber, LicenseeName, LicenseType,InstitutionName,AccountType, Edition, StartDate,
  141 + EndDate,LicenseCreationDate,SubscriptionPrice, CardNumber
  142 + from (
  143 + SELECT ROW_NUMBER() OVER (ORDER BY AccountNumber) AS RowNum, AccountNumber, LicenseeName, LicenseType,InstitutionName,AccountType, Edition, CONVERT(VARCHAR,ValidFrom,101) as StartDate,
  144 + CONVERT(VARCHAR,ValidThrough,101) as EndDate,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate, CONVERT(NUMERIC(14,2),Price) as SubscriptionPrice, CardNumber
  145 + FROM #CancelledLicenseReport) as Tempt
  146 + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo
  147 + ORDER BY AccountNumber
  148 +
  149 + --Calculate total number of records
  150 + select @recordCount = count(ResultTable.AccountNumber)
  151 + from (
  152 + SELECT AccountNumber, LicenseeName, LicenseType,InstitutionName,AccountType, Edition, CONVERT(VARCHAR,ValidFrom,101) as StartDate,
  153 + CONVERT(VARCHAR,ValidThrough,101) as EndDate,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate, CONVERT(NUMERIC(14,2),Price) as SubscriptionPrice, CardNumber
  154 + FROM #CancelledLicenseReport) as ResultTable
  155 +
  156 +
  157 + -- Dropping the temporary table
  158 + DROP TABLE #CancelledLicenseReport
  159 +END
  160 +
  161 +
  162 +
  163 +
... ...
500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetCustomerSummary.sql 0 โ†’ 100644
  1 +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetCustomerSummary]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  2 +drop procedure [dbo].[usp_GetCustomerSummary]
  3 +GO
  4 +
  5 +CREATE PROCEDURE [dbo].[usp_GetCustomerSummary]
  6 + -- Add the parameters for the stored procedure here
  7 + @sAccoutNumber varchar(50)='', @sLicenseeFullName varchar(100)='', @iStartPrice numeric(14,2), @iEndPrice numeric(14,2),
  8 + @iLicenseType tinyint, @iAccountType tinyint, @sZip varchar(20) = '', @iState int,
  9 + @iCountry int,@pageNo int, @pageLength int, @recordCount int out
  10 +AS
  11 +BEGIN
  12 + IF 1=0 BEGIN
  13 + SET FMTONLY OFF
  14 + END
  15 + -- SET NOCOUNT ON added to prevent extra result sets from
  16 + SET NOCOUNT ON
  17 + DECLARE @cGetLicenseDetails CURSOR
  18 + DECLARE @iLicenseId INT
  19 + DECLARE @sAccountNumber VARCHAR(50)
  20 + DECLARE @sLicenseeName VARCHAR(100)
  21 + DECLARE @iLicenseTypeId TINYINT
  22 + DECLARE @sLicenseType VARCHAR(50)
  23 + DECLARE @dtStartDate DATETIME
  24 + DECLARE @dtEndDate DATETIME
  25 + DECLARE @sAccountType VARCHAR(50)
  26 + DECLARE @iAccountTypeId TINYINT
  27 + DECLARE @sLicenseStatus VARCHAR(8)
  28 + DECLARE @sEdition VARCHAR(200)
  29 + DECLARE @bExists bit
  30 + DECLARE @sLicenseState VARCHAR(50)
  31 + DECLARE @sLicenseZip VARCHAR(20)
  32 + DECLARE @sLicenseCountry VARCHAR(50)
  33 + DECLARE @sInstitutionName VARCHAR(100)
  34 + DECLARE @dtLicenseCreationDate DATETIME
  35 + DECLARE @mSubscriptionPrice MONEY
  36 + DECLARE @iLicenseSubscriptionId INT
  37 + DECLARE @sEmailId VARCHAR(100)
  38 + DECLARE @iCardNumber INT
  39 +
  40 + -- create a temporary table to store the desired results of licenses on the basis of parameter
  41 + CREATE TABLE #CustomerReport
  42 + (
  43 + AccountNumber VARCHAR(50),
  44 + LicenseeName VARCHAR(100),
  45 + LicenseType VARCHAR(50),
  46 + Edition VARCHAR(200),
  47 + Email VARCHAR(100),
  48 + ValidFrom DATETIME,
  49 + ValidThrough DATETIME,
  50 + AccountType VARCHAR(50),
  51 + LicenseStatus VARCHAR(8),
  52 + Price MONEY,
  53 + LicenseState VARCHAR(50),
  54 + LicenseZip VARCHAR(20),
  55 + LicenseCountry VARCHAR(50),
  56 + InstitutionName VARCHAR(100),
  57 + LicenseCreationDate DATETIME,
  58 + CardNumber INT
  59 + )
  60 +
  61 + SET @sLicenseeFullName = REPLACE(@sLicenseeFullName,' ',' OR ')
  62 +
  63 + -- define the forward only, read-only cursor
  64 + SET @cGetLicenseDetails = CURSOR FAST_FORWARD
  65 + FOR
  66 + SELECT License.Id, License.AccountNumber, (License.LicenseeFirstName+' '+License.LicenseeLastName),
  67 + License.LicenseTypeId, License.AccountTypeId, License.EmailId,
  68 + (CASE License.IsActive WHEN 1 THEN 'Active' ELSE 'Inactive' END) as LicenseStatus,
  69 + State.StateName, License.Zip, Country.CountryName,
  70 + License.InstitutionName,License.CreationDate,
  71 + (CASE WHEN License.CardNumber > 0 THEN License.CardNumber END) as CardNumber
  72 + FROM License WITH (NOLOCK)
  73 + INNER JOIN State WITH (NOLOCK) ON License.StateId = State.Id
  74 + INNER JOIN Country WITH (NOLOCK) ON License.CountryId = Country.Id
  75 + WHERE
  76 + License.AccountNumber = (CASE WHEN LEN(@sAccoutNumber)>0 THEN @sAccoutNumber ELSE License.AccountNumber END)
  77 + AND License.LicenseTypeId = (CASE WHEN @iLicenseType > 0 THEN @iLicenseType ELSE License.LicenseTypeId END)
  78 + AND License.AccountTypeId = (CASE WHEN @iAccountType > 0 THEN @iAccountType ELSE License.AccountTypeId END)
  79 + AND State.Id = (CASE WHEN @iState > 0 THEN @iState ELSE State.Id END)
  80 + AND Country.Id = (CASE WHEN @iCountry > 0 THEN @iCountry ELSE Country.Id END)
  81 + AND License.Zip = (CASE WHEN LEN(@sZip)>0 THEN @sZip ELSE License.Zip END)
  82 +
  83 + -- open & fetch the cursor variables into the local variables
  84 + OPEN @cGetLicenseDetails
  85 + FETCH NEXT FROM @cGetLicenseDetails INTO @iLicenseId, @sAccountNumber, @sLicenseeName,
  86 + @iLicenseTypeId, @iAccountTypeId, @sEmailId, @sLicenseStatus, @sLicenseState, @sLicenseZip, @sLicenseCountry,@sInstitutionName,@dtLicenseCreationDate, @iCardNumber
  87 +
  88 + -- start of while loop
  89 + WHILE @@FETCH_STATUS = 0
  90 + BEGIN
  91 +
  92 + SET @sEdition = ''
  93 + SET @bExists = 1
  94 + -- fetch the latest license start/end date of a license on the basis of Subscription Start & End price if any
  95 + SELECT @dtStartDate = MAX(LicenseSubscriptionDetail.SubscriptionValidFrom),
  96 + @dtEndDate = MAX(LicenseSubscriptionDetail.SubscriptionValidThrough),
  97 + @iLicenseSubscriptionId = MAX(LicenseSubscriptionDetail.Id)
  98 + FROM LicenseSubscriptionDetail WITH (NOLOCK)
  99 + WHERE LicenseSubscriptionDetail.LicenseId = @iLicenseId
  100 + AND (TotalAmount >= (CASE WHEN @iStartPrice > 0 THEN @iStartPrice ELSE 0 END))
  101 + AND (TotalAmount <= (CASE WHEN @iEndPrice = 0 THEN 0 WHEN @iEndPrice > 0 THEN @iEndPrice ELSE 9999999999 END))
  102 + GROUP BY LicenseSubscriptionDetail.LicenseId
  103 +
  104 +
  105 + -- check whether the above query returns any row
  106 + IF @@Rowcount > 0
  107 + BEGIN
  108 +
  109 + -- check whether the name of licensse matches the name entered by user
  110 +
  111 + IF LEN(@sLicenseeFullName) > 0
  112 + BEGIN
  113 + SELECT @bExists = 1
  114 + FROM License WITH (NOLOCK)
  115 + WHERE Id = @iLicenseId AND (LicenseeFirstName LIKE '%'+@sLicenseeFullName+'%' OR LicenseeLastName LIKE '%'+@sLicenseeFullName+'%') --CONTAINS((LicenseeFirstName,LicenseeLastName)
  116 + IF @@Rowcount = 0
  117 + BEGIN
  118 + SET @bExists = 0
  119 + END
  120 + END
  121 +
  122 + -- check whether the above query returns any row
  123 + IF @bExists = 1
  124 + BEGIN
  125 + -- fetch the licensetype of the license
  126 + SELECT @sLicenseType = LicenseType.Title FROM LicenseType WITH (NOLOCK)
  127 + WHERE LicenseType.Id = @iLicenseTypeId
  128 + -- fetch the accounttype of the license
  129 + SELECT @sAccountType = AccountType.Title FROM AccountType WITH (NOLOCK)
  130 + WHERE AccountType.Id = @iAccountTypeId
  131 +
  132 + -- fetch all the editions mapped as a string with a license
  133 + SELECT @sEdition = Edition.Title + '; ' + @sEdition
  134 + FROM LicenseToEdition WITH (NOLOCK) INNER JOIN Edition WITH (NOLOCK)
  135 + ON LicenseToEdition.EditionId = Edition.Id
  136 + WHERE LicenseToEdition.LicenseId = @iLicenseId
  137 +
  138 + IF LEN(@sEdition)> 1
  139 + -- remove the trailing comma-separator from the edition-string
  140 + SET @sEdition = SUBSTRING(@sEdition,1,LEN(@sEdition)-1)
  141 + ELSE
  142 + SET @sEdition = @sEdition
  143 +
  144 + -- fetch the price of the license
  145 + SELECT @mSubscriptionPrice = TotalAmount FROM LicenseSubscriptionDetail WITH (NOLOCK)
  146 + WHERE Id = @iLicenseSubscriptionId
  147 +
  148 + -- insert into the temporary table
  149 + INSERT INTO #CustomerReport
  150 + (AccountNumber, LicenseeName, LicenseType, Edition, Email, ValidFrom, ValidThrough, AccountType, LicenseStatus, Price, LicenseState, LicenseZip, LicenseCountry, InstitutionName, LicenseCreationDate, CardNumber)
  151 + VALUES(@sAccountNumber, @sLicenseeName, @sLicenseType, @sEdition, @sEmailId, @dtStartDate, @dtEndDate, @sAccountType, @sLicenseStatus, @mSubscriptionPrice, @sLicenseState, @sLicenseZip, @sLicenseCountry,@sInstitutionName,@dtLicenseCreationDate, @iCardNumber)
  152 + END
  153 + END
  154 + -- fetch the next record from cursor
  155 + FETCH NEXT FROM @cGetLicenseDetails INTO @iLicenseId, @sAccountNumber, @sLicenseeName,
  156 + @iLicenseTypeId, @iAccountTypeId, @sEmailId, @sLicenseStatus, @sLicenseState, @sLicenseZip, @sLicenseCountry, @sInstitutionName, @dtLicenseCreationDate, @iCardNumber
  157 + -- end of while loop
  158 + END
  159 + -- close the cursor to free up resources
  160 + CLOSE @cGetLicenseDetails
  161 + DEALLOCATE @cGetLicenseDetails
  162 +
  163 + -- Selecting the desired result from temporary table
  164 + SELECT RowNum as 'Serial_No', AccountNumber, LicenseeName, LicenseType, AccountType, Edition, Email, StartDate,
  165 + EndDate, LicenseStatus, Price,
  166 + LicenseZip, LicenseState, LicenseCountry,InstitutionName,LicenseCreationDate , CardNumber
  167 + from (
  168 + SELECT ROW_NUMBER() OVER (ORDER BY AccountNumber) AS RowNum, AccountNumber, LicenseeName, LicenseType, AccountType, Edition, Email, CONVERT(VARCHAR,ValidFrom,101) as StartDate,
  169 + CONVERT(VARCHAR,ValidThrough,101) as EndDate, LicenseStatus, CONVERT(NUMERIC(14,2),Price) as Price,
  170 + LicenseZip, LicenseState, LicenseCountry,InstitutionName, CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate , isnull(CardNumber,'') as CardNumber
  171 + FROM #CustomerReport WITH (NOLOCK) ) as usr
  172 + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo
  173 + ORDER BY AccountNumber
  174 +
  175 + --Calculate total number of records
  176 + select @recordCount = count(ResultTable.AccountNumber)
  177 + from (
  178 + SELECT AccountNumber, LicenseeName, LicenseType, AccountType, Edition, Email, CONVERT(VARCHAR,ValidFrom,101) as StartDate,
  179 + CONVERT(VARCHAR,ValidThrough,101) as EndDate, LicenseStatus, CONVERT(NUMERIC(14,2),Price) as Price,
  180 + LicenseZip, LicenseState, LicenseCountry,InstitutionName, CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate , CardNumber
  181 + FROM #CustomerReport WITH (NOLOCK) ) as ResultTable
  182 +
  183 + -- Dropping the temporary table
  184 + DROP TABLE #CustomerReport
  185 +END
  186 +
  187 +
  188 +
... ...
500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetDiscountReport.sql 0 โ†’ 100644
  1 +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetDiscountReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  2 +drop procedure [dbo].[usp_GetDiscountReport]
  3 +GO
  4 +
  5 +CREATE PROCEDURE [dbo].[usp_GetDiscountReport]
  6 + -- Add the parameters for the stored procedure here
  7 + @sStartDate VARCHAR(20) = '', @sEndDate VARCHAR(20) = '', @intDiscountID INT,
  8 + @sAccoutNumber VARCHAR(16)='', @pageNo int, @pageLength int, @recordCount int out
  9 +AS
  10 +BEGIN
  11 +
  12 + IF 1=0 BEGIN
  13 + SET FMTONLY OFF
  14 + END
  15 +
  16 + -- SET NOCOUNT ON added to prevent extra result sets from
  17 + -- interfering with SELECT statements.
  18 + SET NOCOUNT ON;
  19 + DECLARE @dtStartDate DATETIME, @dtEndDate DATETIME
  20 +
  21 + -- convert the datatype of startdate & enddate parameter to datetime
  22 + SELECT @dtStartDate = CONVERT(DATETIME,@sStartDate)
  23 + SELECT @dtEndDate = DATEADD(ms,-3,DATEADD(DAY,1,CONVERT(DATETIME,@sEndDate)))
  24 + IF LEN(@sAccoutNumber) > 0
  25 + BEGIN
  26 +
  27 + Select RowNum, DiscountCode, Percentage, StartDate, EndDate, DiscountStatus, TotalLicenses
  28 + from (
  29 + SELECT ROW_NUMBER() OVER (ORDER BY Discount.StartDate) AS RowNum , Discount.DiscountCode, Discount.Percentage, CONVERT(VARCHAR(10),Discount.StartDate,101) as StartDate,
  30 + CONVERT(VARCHAR(10),Discount.EndDate,101) as EndDate,
  31 + (CASE Discount.IsActive WHEN 1 THEN 'Active' ELSE 'Inactive' END) AS DiscountStatus,
  32 + COUNT(DiscountToLicense.LicenseId) AS TotalLicenses
  33 + FROM Discount INNER JOIN DiscountToLicense ON Discount.Id = DiscountToLicense.DiscountId
  34 + INNER JOIN License ON License.Id = DiscountToLicense.LicenseId
  35 + WHERE Discount.StartDate >= (CASE WHEN LEN(@sStartDate) > 0 THEN @dtStartDate ELSE Discount.StartDate END)
  36 + AND Discount.EndDate <= (CASE WHEN LEN(@sEndDate) > 0 THEN @dtEndDate ELSE Discount.EndDate END)
  37 + AND Discount.Id = (CASE WHEN @intDiscountID > 0 THEN @intDiscountID ELSE Discount.Id END)
  38 + AND License.AccountNumber = @sAccoutNumber
  39 + GROUP BY Discount.DiscountCode, Discount.Percentage, Discount.StartDate, Discount.EndDate, Discount.IsActive) as usr
  40 + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo order by StartDate
  41 +
  42 + --Calculate total number of records
  43 + select @recordCount = count(ResultTable.DiscountCode) from (
  44 + SELECT Discount.DiscountCode, Discount.Percentage, CONVERT(VARCHAR(10),Discount.StartDate,101) as StartDate,
  45 + CONVERT(VARCHAR(10),Discount.EndDate,101) as EndDate,
  46 + (CASE Discount.IsActive WHEN 1 THEN 'Active' ELSE 'Inactive' END) AS DiscountStatus,
  47 + COUNT(DiscountToLicense.LicenseId) AS TotalLicenses
  48 + FROM Discount INNER JOIN DiscountToLicense ON Discount.Id = DiscountToLicense.DiscountId
  49 + INNER JOIN License ON License.Id = DiscountToLicense.LicenseId
  50 + WHERE Discount.StartDate >= (CASE WHEN LEN(@sStartDate) > 0 THEN @dtStartDate ELSE Discount.StartDate END)
  51 + AND Discount.EndDate <= (CASE WHEN LEN(@sEndDate) > 0 THEN @dtEndDate ELSE Discount.EndDate END)
  52 + AND Discount.Id = (CASE WHEN @intDiscountID > 0 THEN @intDiscountID ELSE Discount.Id END)
  53 + AND License.AccountNumber = @sAccoutNumber
  54 + GROUP BY Discount.DiscountCode, Discount.Percentage, Discount.StartDate, Discount.EndDate, Discount.IsActive) as ResultTable;
  55 +
  56 + END
  57 + ELSE
  58 + BEGIN
  59 +
  60 + Select RowNum as 'Serial_No', DiscountCode, Percentage, StartDate, EndDate, DiscountStatus, TotalLicenses
  61 + from (
  62 + SELECT ROW_NUMBER() OVER (ORDER BY Discount.StartDate) AS RowNum , Discount.DiscountCode, Discount.Percentage, CONVERT(VARCHAR(10),Discount.StartDate,101) as StartDate,
  63 + CONVERT(VARCHAR(10),Discount.EndDate,101) as EndDate,
  64 + (CASE Discount.IsActive WHEN 1 THEN 'Active' ELSE 'Inactive' END) AS DiscountStatus,
  65 + COUNT(DiscountToLicense.LicenseId) AS TotalLicenses
  66 + FROM Discount LEFT JOIN DiscountToLicense ON Discount.Id = DiscountToLicense.DiscountId
  67 + WHERE Discount.StartDate >= (CASE WHEN LEN(@sStartDate) > 0 THEN @dtStartDate ELSE Discount.StartDate END)
  68 + AND Discount.EndDate <= (CASE WHEN LEN(@sEndDate) > 0 THEN @dtEndDate ELSE Discount.EndDate END)
  69 + AND Discount.Id = (CASE WHEN @intDiscountID > 0 THEN @intDiscountID ELSE Discount.Id END)
  70 + GROUP BY Discount.DiscountCode, Discount.Percentage, Discount.StartDate, Discount.EndDate, Discount.IsActive) as usr
  71 + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo order by StartDate
  72 +
  73 + --Calculate total number of records
  74 + select @recordCount = count(ResultTable.DiscountCode) from (
  75 + SELECT Discount.DiscountCode, Discount.Percentage, CONVERT(VARCHAR(10),Discount.StartDate,101) as StartDate,
  76 + CONVERT(VARCHAR(10),Discount.EndDate,101) as EndDate,
  77 + (CASE Discount.IsActive WHEN 1 THEN 'Active' ELSE 'Inactive' END) AS DiscountStatus,
  78 + COUNT(DiscountToLicense.LicenseId) AS TotalLicenses
  79 + FROM Discount LEFT JOIN DiscountToLicense ON Discount.Id = DiscountToLicense.DiscountId
  80 + WHERE Discount.StartDate >= (CASE WHEN LEN(@sStartDate) > 0 THEN @dtStartDate ELSE Discount.StartDate END)
  81 + AND Discount.EndDate <= (CASE WHEN LEN(@sEndDate) > 0 THEN @dtEndDate ELSE Discount.EndDate END)
  82 + AND Discount.Id = (CASE WHEN @intDiscountID > 0 THEN @intDiscountID ELSE Discount.Id END)
  83 + GROUP BY Discount.DiscountCode, Discount.Percentage, Discount.StartDate, Discount.EndDate, Discount.IsActive) as ResultTable;
  84 +
  85 + END
  86 +
  87 +END
  88 +
... ...
500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetExpiringLicenses.sql 0 โ†’ 100644
  1 +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetExpiringLicenses]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  2 +drop procedure [dbo].[usp_GetExpiringLicenses]
  3 +GO
  4 +
  5 +CREATE PROCEDURE [dbo].[usp_GetExpiringLicenses] --'2010-01-01','2020-01-01',0,1,0,0,'',0,0,1,10,0
  6 + -- Add the parameters for the stored procedure here
  7 + @sFromDate varchar(20), @sToDate varchar(20), @iStartPrice numeric(14,2), @iEndPrice numeric(14,2),
  8 + @iLicenseTypeId int, @iAccountTypeId int, @sZip varchar(20)=null, @iStateId int, @iCountryId int
  9 + ,@pageNo int, @pageLength int, @recordCount int out
  10 +AS
  11 +BEGIN
  12 +
  13 + IF 1=0 BEGIN
  14 + SET FMTONLY OFF
  15 + END
  16 +
  17 + -- SET NOCOUNT ON added to prevent extra result sets from
  18 + SET NOCOUNT ON;
  19 + DECLARE @dtFromDate DATETIME
  20 + DECLARE @dtToDate DATETIME
  21 + DECLARE @cGetLicenseId CURSOR
  22 + DECLARE @iLicenseId INT
  23 + DECLARE @iLicenseSubscriptionDetail INT
  24 + DECLARE @sAccountNumber VARCHAR(50)
  25 + DECLARE @sLicenseeName VARCHAR(100)
  26 + DECLARE @sLicenseType VARCHAR(50)
  27 + DECLARE @sInstitutionName VARCHAR(100)
  28 + DECLARE @dtLicenseCreationDate DATETIME
  29 + DECLARE @dtStartDate DATETIME
  30 + DECLARE @dtEndDate DATETIME
  31 + DECLARE @mSubscriptionPrice MONEY
  32 + DECLARE @sAccountType VARCHAR(50)
  33 + DECLARE @sEdition VARCHAR(200)
  34 + DECLARE @iDaysRemaining INT
  35 + DECLARE @iCardNumber INT
  36 +
  37 + -- convert the datatype of fromdate & todate parameter to datetime
  38 + SELECT @dtFromDate = CONVERT(DATETIME,@sFromDate)
  39 + SELECT @dtToDate = DATEADD(ms,-3,DATEADD(DAY,1,CONVERT(DATETIME,@sToDate)))
  40 +
  41 + -- create a temporary table to store the desired results of license which are going to be expire on the basis of parameter
  42 + CREATE TABLE #ExpiringLicenseReport
  43 + (
  44 + AccountNumber VARCHAR(50),
  45 + LicenseeName VARCHAR(100),
  46 + LicenseType VARCHAR(50),
  47 + InstitutionName VARCHAR(100),
  48 + Edition VARCHAR(200),
  49 + ValidFrom DATETIME,
  50 + ValidThrough DATETIME,
  51 + LicenseCreationDate DATETIME,
  52 + Price MONEY,
  53 + AccountType VARCHAR(50),
  54 + DaysRemaining INT,
  55 + CardNumber INT
  56 + )
  57 +
  58 + -- define the forward only, read-only cursor
  59 + SET @cGetLicenseId = CURSOR FAST_FORWARD
  60 + FOR
  61 + SELECT LicenseSubscriptionDetail.LicenseId, MAX(LicenseSubscriptionDetail.Id)
  62 + FROM LicenseSubscriptionDetail WHERE
  63 + (TotalAmount >= (CASE WHEN @iStartPrice > 0 THEN @iStartPrice ELSE 0 END))
  64 + AND (TotalAmount <= (CASE WHEN @iEndPrice = 0 THEN 0 WHEN @iEndPrice > 0 THEN @iEndPrice ELSE 9999999999 END))
  65 + GROUP BY LicenseSubscriptionDetail.LicenseId
  66 + HAVING (MAX(SubscriptionValidThrough) BETWEEN @dtFromDate AND @dtToDate)
  67 +
  68 + -- open & fetch the cursor variables into the local variables
  69 + OPEN @cGetLicenseId
  70 + FETCH NEXT FROM @cGetLicenseId INTO @iLicenseId, @iLicenseSubscriptionDetail
  71 + -- start of while loop
  72 + WHILE @@FETCH_STATUS = 0
  73 + BEGIN
  74 +
  75 + SET @sEdition = ''
  76 + -- fetch the accountnumber, licenseename, licensetype, startdate, enddate, subscriptionprice, accountype & days remaining to expire for a license
  77 + SELECT @sAccountNumber = AccountNumber, @sLicenseeName = LicenseeName, @sLicenseType = LicenseType,
  78 + @sInstitutionName = InstitutionName, @dtLicenseCreationDate = CreationDate,
  79 + @dtStartDate = SubscriptionValidFrom, @dtEndDate = SubscriptionValidThrough,
  80 + @mSubscriptionPrice = TotalAmount, @sAccountType = AccountType, @iDaysRemaining = DaysRemaining, @iCardNumber = CardNumber
  81 + FROM
  82 + (
  83 + SELECT AccountNumber, (LicenseeFirstName+' '+LicenseeLastName) as LicenseeName,
  84 + LicenseType.Title as LicenseType, AccountType.Title as AccountType,
  85 + License.InstitutionName,License.CreationDate,
  86 + LicenseSubscriptionDetail.TotalAmount,
  87 + LicenseSubscriptionDetail.SubscriptionValidFrom, LicenseSubscriptionDetail.SubscriptionValidThrough,
  88 + DATEDIFF(dd,GETDATE(),LicenseSubscriptionDetail.SubscriptionValidThrough) as DaysRemaining, (CASE WHEN License.CardNumber > 0 THEN License.CardNumber END) as CardNumber
  89 + FROM License
  90 + INNER JOIN LicenseType ON License.LicenseTypeId = LicenseType.Id
  91 + INNER JOIN AccountType ON License.AccountTypeId = AccountType.Id
  92 + INNER JOIN LicenseSubscriptionDetail ON License.Id = LicenseSubscriptionDetail.LicenseId
  93 + INNER JOIN State ON License.StateId = State.Id
  94 + INNER JOIN Country ON License.CountryId = Country.Id
  95 + WHERE License.IsActive = 1
  96 + AND License.LicenseTypeId = (CASE WHEN @iLicenseTypeId > 0 THEN @iLicenseTypeId ELSE License.LicenseTypeId END)
  97 + AND License.AccountTypeId = (CASE WHEN @iAccountTypeId > 0 THEN @iAccountTypeId ELSE License.AccountTypeId END)
  98 + AND State.Id = (CASE WHEN @iStateId > 0 THEN @iStateId ELSE State.Id END)
  99 + AND Country.Id = (CASE WHEN @iCountryId > 0 THEN @iCountryId ELSE Country.Id END)
  100 + AND (@sZip is NULL or License.Zip = (CASE WHEN LEN(@sZip)>0 THEN @sZip ELSE License.Zip END))
  101 + AND LicenseSubscriptionDetail.Id = @iLicenseSubscriptionDetail
  102 + AND License.LicenseTypeId <> 5
  103 + ) t1
  104 + WHERE DaysRemaining>=0
  105 + -- check whether the above query returns any row
  106 + IF @@Rowcount > 0
  107 + BEGIN
  108 + -- fetch all the editions mapped as a string with a license
  109 + SELECT @sEdition = Edition.Title + '; ' + @sEdition
  110 + FROM LicenseToEdition INNER JOIN Edition
  111 + ON LicenseToEdition.EditionId = Edition.Id
  112 + WHERE LicenseToEdition.LicenseId = @iLicenseId
  113 + -- remove the trailing comma-separator from the edition-string
  114 + SET @sEdition = SUBSTRING(@sEdition,1,LEN(@sEdition)-1);
  115 +
  116 + -- insert into the temporary table
  117 + INSERT INTO #ExpiringLicenseReport
  118 + (AccountNumber, LicenseeName, LicenseType,InstitutionName, Edition, ValidFrom, ValidThrough,LicenseCreationDate, Price, AccountType, DaysRemaining,CardNumber)
  119 + VALUES(@sAccountNumber,@sLicenseeName,@sLicenseType,@sInstitutionName,@sEdition,@dtStartDate,@dtEndDate,@dtLicenseCreationDate, @mSubscriptionPrice,@sAccountType,@iDaysRemaining,@iCardNumber)
  120 + END
  121 + -- fetch the next record from cursor
  122 + FETCH NEXT FROM @cGetLicenseId INTO @iLicenseId,@iLicenseSubscriptionDetail
  123 + -- end of while loop
  124 + END
  125 + -- close the cursor to free up resources
  126 + CLOSE @cGetLicenseId
  127 + DEALLOCATE @cGetLicenseId
  128 +
  129 + -- Selecting the desired result from temporary table
  130 + --SELECT AccountNumber,LicenseeName,LicenseType,InstitutionName,Edition,
  131 + --CONVERT(VARCHAR,ValidFrom,101) as StartDate,CONVERT(VARCHAR,ValidThrough,101) as EndDate,
  132 + --CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate,
  133 + --CONVERT(NUMERIC(14,2),Price) as SubscriptionPrice,AccountType,DaysRemaining, CardNumber
  134 + --FROM #ExpiringLicenseReport ORDER BY AccountNumber
  135 +
  136 +
  137 + SELECT RowNum as 'Serial_No', AccountNumber,LicenseeName,LicenseType,InstitutionName,Edition,
  138 + StartDate,EndDate,LicenseCreationDate,SubscriptionPrice,AccountType,DaysRemaining, CardNumber
  139 + from (
  140 + SELECT ROW_NUMBER() OVER (ORDER BY AccountNumber) AS RowNum, AccountNumber,LicenseeName,LicenseType,InstitutionName,Edition,
  141 + CONVERT(VARCHAR,ValidFrom,101) as StartDate,CONVERT(VARCHAR,ValidThrough,101) as EndDate,
  142 + CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate,
  143 + CONVERT(NUMERIC(14,2),Price) as SubscriptionPrice,AccountType,DaysRemaining, isnull(CardNumber,'') as CardNumber
  144 + FROM #ExpiringLicenseReport) as Tempt
  145 + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo
  146 + ORDER BY AccountNumber
  147 +
  148 + --Calculate total number of records
  149 + select @recordCount = count(ResultTable.AccountNumber)
  150 + from (
  151 + SELECT AccountNumber,LicenseeName,LicenseType,InstitutionName,Edition,
  152 + CONVERT(VARCHAR,ValidFrom,101) as StartDate,CONVERT(VARCHAR,ValidThrough,101) as EndDate,
  153 + CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate,
  154 + CONVERT(NUMERIC(14,2),Price) as SubscriptionPrice,AccountType,DaysRemaining, CardNumber
  155 + FROM #ExpiringLicenseReport ) as ResultTable
  156 +
  157 + -- Dropping the temporary table
  158 + DROP TABLE #ExpiringLicenseReport
  159 +END
  160 +
  161 +
... ...
500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetNetAdSummaryReport.sql 0 โ†’ 100644
  1 +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetNetAdSummaryReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  2 +drop procedure [dbo].[usp_GetNetAdSummaryReport]
  3 +GO
  4 +
  5 +CREATE PROCEDURE [dbo].[usp_GetNetAdSummaryReport] --'2015-05-01','2018-05-01',0,0,0,1,100,1000
  6 + -- Add the parameters for the stored procedure here
  7 + -- FromDate & ToDate are mandatory
  8 + @sFromDate varchar(20), @sToDate varchar(20), @iStartPrice numeric(14,2), @iEndPrice numeric(14,2), @iLicenseTypeId tinyint,
  9 + @pageNo int, @pageLength int, @recordCount int out
  10 +AS
  11 +BEGIN
  12 +
  13 + IF 1=0 BEGIN
  14 + SET FMTONLY OFF
  15 + END
  16 +
  17 + -- SET NOCOUNT ON added to prevent extra result sets from
  18 + SET NOCOUNT ON;
  19 + DECLARE @dtFromDate DATETIME
  20 + DECLARE @dtToDate DATETIME
  21 + DECLARE @cGetSummary CURSOR
  22 + DECLARE @iLicenseId INT
  23 + DECLARE @iLicenseSubscriptioId INT
  24 + DECLARE @iActiveSubscription INT
  25 + DECLARE @iRenewSubscription INT
  26 + DECLARE @iCancelSubscription INT
  27 + DECLARE @iNetAdSubscription INT
  28 + DECLARE @sLicenseType VARCHAR(50)
  29 + DECLARE @sInstitutionname VARCHAR(100)
  30 + DECLARE @dtLicenseCreationDate DATETIME
  31 + DECLARE @sAccountType VARCHAR(50)
  32 + DECLARE @IsActive BIT
  33 + DECLARE @sRenew BIT
  34 +
  35 + -- set the default parameters to 0
  36 + SET @iActiveSubscription = 0
  37 + SET @iRenewSubscription = 0
  38 + SET @iCancelSubscription = 0
  39 +
  40 + -- convert the datatype of fromdate & todate parameter to datetime
  41 + SELECT @dtFromDate = CONVERT(DATETIME,@sFromDate)
  42 + SELECT @dtToDate = DATEADD(ms,-3,DATEADD(DAY,1,CONVERT(DATETIME,@sToDate)))
  43 +
  44 + -- create a temporary table to store the first-level of result shown in the netad subscription report on the basis of parameter
  45 + CREATE TABLE #NetAdSummaryReport
  46 + (
  47 + LicenseType VARCHAR(50),
  48 + AccountType VARCHAR(50),
  49 + InstitutionName VARCHAR(100),
  50 + LicenseCreationDate DATETIME,
  51 + IsActive BIT,
  52 + IsRenew BIT
  53 + )
  54 + CREATE CLUSTERED INDEX IK_NetAdSummaryReport_1 ON #NetAdSummaryReport (LicenseType, AccountType)
  55 + CREATE NONCLUSTERED INDEX IK_NetAdSummaryReport_2 ON #NetAdSummaryReport (IsActive)
  56 +
  57 + -- create a temporary table
  58 + CREATE TABLE #NetAdResult
  59 + (
  60 + LicenseType VARCHAR(50),
  61 + AccountType VARCHAR(50),
  62 + InstitutionName VARCHAR(100),
  63 + LicenseCreationDate DATETIME,
  64 + ActiveSubscription INT,
  65 + RenewSubscription INT,
  66 + InActiveSubscription INT,
  67 + NetAdSubscription INT
  68 + )
  69 +
  70 + -- define the forward only, read-only cursor
  71 + SET @cGetSummary = CURSOR FAST_FORWARD
  72 + FOR
  73 + SELECT License.Id, LicenseSubscriptionDetail.Id
  74 + FROM LicenseSubscriptionDetail
  75 + INNER JOIN License ON LicenseSubscriptionDetail.LicenseId = License.Id WHERE
  76 + ((License.CancellationDate BETWEEN @dtFromDate AND @dtToDate AND License.IsActive = 0 )
  77 + OR (License.CreationDate BETWEEN @dtFromDate AND @dtToDate )
  78 + OR (RenewalDate BETWEEN @dtFromDate AND @dtToDate))
  79 + AND License.LicenseTypeId = (CASE WHEN @iLicenseTypeId > 0 THEN @iLicenseTypeId ELSE License.LicenseTypeId END)
  80 + AND (TotalAmount >= (CASE WHEN @iStartPrice > 0 THEN @iStartPrice ELSE 0 END))
  81 + AND (TotalAmount <= (CASE WHEN @iEndPrice = 0 THEN 0 WHEN @iEndPrice > 0 THEN @iEndPrice ELSE 9999999999 END))
  82 + AND License.LicenseTypeId <> 5
  83 + GROUP BY License.Id, LicenseSubscriptionDetail.Id
  84 +
  85 +
  86 + -- open & fetch the cursor variables into the local variables
  87 + OPEN @cGetSummary
  88 + FETCH NEXT FROM @cGetSummary INTO @iLicenseId, @iLicenseSubscriptioId
  89 + -- start of while loop
  90 + WHILE @@FETCH_STATUS = 0
  91 + BEGIN
  92 +
  93 + -- fetch the licensetype, accountype & the status of a license
  94 + SELECT @sLicenseType = LicenseType.Title, @sAccountType = AccountType.Title,
  95 + @sInstitutionname = License.InstitutionName, @dtLicenseCreationDate = License.CreationDate,
  96 + @IsActive = License.IsActive,
  97 + @sRenew = (CASE WHEN LicenseSubscriptionDetail.RenewalDate IS NULL THEN 0 ELSE 1 END)
  98 + FROM License
  99 + INNER JOIN LicenseType ON License.LicenseTypeId = LicenseType.Id
  100 + INNER JOIN AccountType ON License.AccountTypeId = AccountType.Id
  101 + INNER JOIN LicenseSubscriptionDetail ON LicenseSubscriptionDetail.LicenseId = License.Id
  102 + WHERE License.Id = @iLicenseId
  103 + AND LicenseSubscriptionDetail.Id = @iLicenseSubscriptioId
  104 +
  105 +
  106 + -- check whether the above query returns any row
  107 + IF @@Rowcount > 0
  108 + BEGIN
  109 +
  110 + IF @IsActive = 1
  111 + BEGIN
  112 + IF @sRenew = 1
  113 + BEGIN
  114 + SET @iRenewSubscription = @iRenewSubscription + 1
  115 + END
  116 + ELSE
  117 + BEGIN
  118 + SET @iActiveSubscription = @iActiveSubscription + 1
  119 + END
  120 + END
  121 + ELSE
  122 + BEGIN
  123 + IF @sRenew = 1
  124 + BEGIN
  125 + SET @iRenewSubscription = @iRenewSubscription + 1
  126 + END
  127 + ELSE
  128 + BEGIN
  129 + SET @iCancelSubscription = @iCancelSubscription + 1
  130 + END
  131 + END
  132 +
  133 + -- insert into the temporary table
  134 + INSERT INTO #NetAdSummaryReport
  135 + (LicenseType,AccountType,InstitutionName,LicenseCreationDate,IsActive,IsRenew)
  136 + VALUES(@sLicenseType,@sAccountType,@sInstitutionname,@dtLicenseCreationDate,@IsActive,@sRenew)
  137 + END
  138 + -- fetch the next record from cursor
  139 + FETCH NEXT FROM @cGetSummary INTO @iLicenseId, @iLicenseSubscriptioId
  140 + -- end of while loop
  141 + END
  142 + -- close the cursor to free up resources
  143 + CLOSE @cGetSummary
  144 + DEALLOCATE @cGetSummary
  145 +
  146 + -- Selecting the desired result from temporary table
  147 + INSERT INTO #NetAdResult (LicenseType, AccountType,InstitutionName,LicenseCreationDate,ActiveSubscription, RenewSubscription, InActiveSubscription,
  148 + NetAdSubscription)
  149 + SELECT LicenseType,AccountType,MAX(InstitutionName) as InstitutionName, MAX(LicenseCreationDate) as LicenseCreationDate,(SELECT COUNT(1) FROM #NetAdSummaryReport
  150 + WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsActive = 1 AND IsRenew = 0) as ActiveSubscription,
  151 + (SELECT COUNT(1) FROM #NetAdSummaryReport
  152 + WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsRenew = 1) as RenewSubscription,
  153 + (SELECT COUNT(1) FROM #NetAdSummaryReport
  154 + WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsActive = 0 AND IsRenew = 0) as InActiveSubscription,
  155 + ((SELECT COUNT(1) FROM #NetAdSummaryReport
  156 + WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsActive = 1 AND IsRenew = 0) + (SELECT COUNT(1) FROM #NetAdSummaryReport
  157 + WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsRenew = 1) - (SELECT COUNT(1) FROM #NetAdSummaryReport
  158 + WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsActive = 0)) as NetAdSubscription
  159 + FROM #NetAdSummaryReport N1 GROUP BY LicenseType,AccountType
  160 +
  161 + -- to show the sum of active, renew, cancel & netad subscriptions
  162 + if((Select COUNT(*) from #NetAdResult)>0)
  163 + begin
  164 + INSERT INTO #NetAdResult (LicenseType,LicenseCreationDate, ActiveSubscription, RenewSubscription, InActiveSubscription,
  165 + NetAdSubscription) SELECT 'Total','9999-01-01', @iActiveSubscription, @iRenewSubscription, @iCancelSubscription,
  166 + (@iActiveSubscription+@iRenewSubscription-@iCancelSubscription)
  167 + End
  168 +
  169 + Select RowNum as 'Serial_No', LicenseType, AccountType,InstitutionName,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate, ActiveSubscription, RenewSubscription, InActiveSubscription,
  170 + NetAdSubscription
  171 + from (
  172 + SELECT ROW_NUMBER() OVER (ORDER BY LicenseCreationDate Asc) AS RowNum ,LicenseType, AccountType,InstitutionName,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate, ActiveSubscription, RenewSubscription, InActiveSubscription,
  173 + NetAdSubscription FROM #NetAdResult) as usr
  174 + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo order by LicenseCreationDate desc
  175 +
  176 + --Calculate total number of records
  177 + select @recordCount = count(ResultTable.NetAdSubscription) from (SELECT LicenseType, AccountType,InstitutionName,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate, ActiveSubscription, RenewSubscription, InActiveSubscription,
  178 + NetAdSubscription FROM #NetAdResult) as ResultTable;
  179 +
  180 + -- Dropping the temporary tables
  181 + DROP TABLE #NetAdSummaryReport
  182 + DROP TABLE #NetAdResult
  183 +END
... ...
500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetSiteLicenseUsageReport.sql 0 โ†’ 100644
  1 +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetSiteLicenseUsageReports]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  2 +drop procedure [dbo].[usp_GetSiteLicenseUsageReports]
  3 +GO
  4 +
  5 +CREATE PROCEDURE [dbo].[usp_GetSiteLicenseUsageReports]
  6 + -- Add the parameters for the stored procedure here
  7 + @sFromDate varchar(20), @sToDate varchar(20), @sAccoutNumber varchar(50)='', @iEditionId tinyint = 0,
  8 + @pageNo int, @pageLength int, @recordCount int out
  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 + SET NOCOUNT ON
  16 + DECLARE @dtFromDate DATETIME
  17 + DECLARE @dtToDate DATETIME
  18 +
  19 + -- convert the datatype of fromdate & todate parameter to datetime
  20 + SELECT @dtFromDate = CONVERT(DATETIME,@sFromDate)
  21 + SELECT @dtToDate = DATEADD(ms,-3,DATEADD(DAY,1,CONVERT(DATETIME,@sToDate)))
  22 +
  23 + Select RowNum as 'Serial_No',AccountNumber, EditionTitle, ReferalUrl, InstitutionName, LicenseCreationDate,TotalLogins,LastLogin
  24 + from (
  25 + SELECT ROW_NUMBER() OVER (ORDER BY UserLoginLog.AccountNumber) AS RowNum , UserLoginLog.AccountNumber, Edition.Title AS EditionTitle, UserLoginLog.ReferalUrl,
  26 + (SELECT License.InstitutionName FROM License WHERE License.AccountNumber = UserLoginLog.AccountNumber) as InstitutionName,
  27 + (SELECT CONVERT(VARCHAR,License.CreationDate,101) FROM License WHERE License.AccountNumber = UserLoginLog.AccountNumber) as LicenseCreationDate,
  28 + COUNT(DISTINCT UserLoginLog.LogDate) AS TotalLogins,
  29 + CONVERT(VARCHAR,MAX(UserLoginLog.LogDate),101) AS LastLogin FROM
  30 + UserLoginLog INNER JOIN Edition ON UserLoginLog.Edition = CAST(Edition.Id AS NVARCHAR)
  31 + WHERE UserLoginLog.FailureId IS NULL
  32 + AND UserLoginLog.LogDate BETWEEN @dtFromDate AND @dtToDate
  33 + AND UserLoginLog.AccountNumber = (CASE WHEN LEN(@sAccoutNumber) > 0 THEN @sAccoutNumber ELSE UserLoginLog.AccountNumber END)
  34 + AND Edition.IsActive = 1
  35 + AND Edition.Id = (CASE WHEN @iEditionId > 0 THEN @iEditionId ELSE Edition.Id END)
  36 + GROUP BY UserLoginLog.AccountNumber, Edition.Title, UserLoginLog.ReferalUrl) as usr
  37 + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo order by AccountNumber
  38 +
  39 +
  40 + --Calculate total number of records
  41 + select @recordCount = count(ResultTable.AccountNumber) from (
  42 + SELECT UserLoginLog.AccountNumber, Edition.Title AS EditionTitle, UserLoginLog.ReferalUrl,
  43 + (SELECT License.InstitutionName FROM License WHERE License.AccountNumber = UserLoginLog.AccountNumber) as InstitutionName,
  44 + (SELECT CONVERT(VARCHAR,License.CreationDate,101) FROM License WHERE License.AccountNumber = UserLoginLog.AccountNumber) as LicenseCreationDate,
  45 + COUNT(DISTINCT UserLoginLog.LogDate) AS TotalLogins,
  46 + CONVERT(VARCHAR,MAX(UserLoginLog.LogDate),101) AS LastLogin FROM
  47 + UserLoginLog INNER JOIN Edition ON UserLoginLog.Edition = CAST(Edition.Id AS NVARCHAR)
  48 + WHERE UserLoginLog.FailureId IS NULL
  49 + AND UserLoginLog.LogDate BETWEEN @dtFromDate AND @dtToDate
  50 + AND UserLoginLog.AccountNumber = (CASE WHEN LEN(@sAccoutNumber) > 0 THEN @sAccoutNumber ELSE UserLoginLog.AccountNumber END)
  51 + AND Edition.IsActive = 1
  52 + AND Edition.Id = (CASE WHEN @iEditionId > 0 THEN @iEditionId ELSE Edition.Id END)
  53 + GROUP BY UserLoginLog.AccountNumber, Edition.Title, UserLoginLog.ReferalUrl) as ResultTable;
  54 +
  55 +END
  56 +
... ...
500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetSubscribedLicenses.sql 0 โ†’ 100644
  1 +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetSubscribedLicenses]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  2 +drop procedure [dbo].[usp_GetSubscribedLicenses]
  3 +GO
  4 +
  5 +CREATE PROCEDURE [dbo].[usp_GetSubscribedLicenses]
  6 + -- Add the parameters for the stored procedure here
  7 + @sFromDate varchar(20), @sToDate varchar(20), @iStartPrice numeric(14,2), @iEndPrice numeric(14,2), @iLicenseTypeId tinyint,
  8 + @iAccountTypeId tinyint, @sZip varchar(20) = '', @iStateId int, @iCountryId int,@pageNo int, @pageLength int, @recordCount int out
  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 + SET NOCOUNT ON;
  16 + DECLARE @dtFromDate DATETIME
  17 + DECLARE @dtToDate DATETIME
  18 + DECLARE @cGetLicenseID CURSOR
  19 + DECLARE @iLicenseId INT
  20 + DECLARE @iLicenseSubscriptionDetail INT
  21 + DECLARE @sAccountNumber VARCHAR(50)
  22 + DECLARE @sLicenseeName VARCHAR(100)
  23 + DECLARE @sLicenseType VARCHAR(50)
  24 + DECLARE @sInstitutionName VARCHAR(100)
  25 + DECLARE @dtStartDate DATETIME
  26 + DECLARE @dtEndDate DATETIME
  27 + DECLARE @dtLicenseCreationDate DATETIME
  28 + DECLARE @mSubscriptionPrice MONEY
  29 + DECLARE @sAccountType VARCHAR(50)
  30 + DECLARE @sEdition VARCHAR(200)
  31 + DECLARE @iCardNumber INT
  32 +
  33 +
  34 + -- convert the datatype of fromdate & todate parameter to datetime
  35 + SELECT @dtFromDate = CONVERT(DATETIME,@sFromDate)
  36 + SELECT @dtToDate = DATEADD(ms,-3,DATEADD(DAY,1,CONVERT(DATETIME,@sToDate)))
  37 +
  38 + -- create a temporary table to store the desired results of subscribed licenses on the basis of parameter
  39 + CREATE TABLE #SubscribedLicenseReport
  40 + (
  41 + AccountNumber VARCHAR(50),
  42 + LicenseeName VARCHAR(100),
  43 + LicenseType VARCHAR(50),
  44 + InstitutionName VARCHAR(100),
  45 + Edition VARCHAR(200),
  46 + ValidFrom DATETIME,
  47 + ValidThrough DATETIME,
  48 + LicenseCreationDate DATETIME,
  49 + Price MONEY,
  50 + AccountType varchar(50),
  51 + CardNumber INT
  52 + )
  53 +
  54 + -- define the forward only, read-only cursor
  55 + SET @cGetLicenseID = CURSOR FAST_FORWARD
  56 + FOR
  57 + SELECT LicenseSubscriptionDetail.LicenseId, MAX(LicenseSubscriptionDetail.Id)
  58 + FROM LicenseSubscriptionDetail WHERE
  59 + (TotalAmount >= (CASE WHEN @iStartPrice > 0 THEN @iStartPrice ELSE 0 END))
  60 + AND (TotalAmount <= (CASE WHEN @iEndPrice = 0 THEN 0 WHEN @iEndPrice > 0 THEN @iEndPrice ELSE 9999999999 END))
  61 + GROUP BY LicenseSubscriptionDetail.LicenseId
  62 + HAVING (MAX(SubscriptionValidFrom) BETWEEN @dtFromDate AND @dtToDate)
  63 +
  64 + -- open & fetch the cursor variables into the local variables
  65 + OPEN @cGetLicenseID
  66 + FETCH NEXT FROM @cGetLicenseID INTO @iLicenseId, @iLicenseSubscriptionDetail
  67 + -- start of while loop
  68 + WHILE @@FETCH_STATUS = 0
  69 + BEGIN
  70 +
  71 + SET @sEdition = ''
  72 +
  73 + -- fetch the accountnumber, licenseename, licensetype, accountype of a license
  74 + SELECT @sAccountNumber = AccountNumber, @sLicenseeName = (LicenseeFirstName+' '+LicenseeLastName),
  75 + @sLicenseType = LicenseType.Title, @sAccountType = AccountType.Title,
  76 + @iCardNumber = (CASE WHEN License.CardNumber > 0 THEN License.CardNumber END),
  77 + @sInstitutionName = License.InstitutionName,@dtLicenseCreationDate = License.CreationDate
  78 + FROM License
  79 + INNER JOIN LicenseType ON License.LicenseTypeId = LicenseType.Id
  80 + INNER JOIN AccountType ON License.AccountTypeId = AccountType.Id
  81 + INNER JOIN State ON License.StateId = State.Id
  82 + INNER JOIN Country ON License.CountryId = Country.Id
  83 + WHERE License.Id = @iLicenseId AND License.IsActive = 1
  84 + AND License.LicenseTypeId = (CASE WHEN @iLicenseTypeId > 0 THEN @iLicenseTypeId ELSE License.LicenseTypeId END)
  85 + AND License.AccountTypeId = (CASE WHEN @iAccountTypeId > 0 THEN @iAccountTypeId ELSE License.AccountTypeId END)
  86 + AND State.Id = (CASE WHEN @iStateId > 0 THEN @iStateId ELSE State.Id END)
  87 + AND Country.Id = (CASE WHEN @iCountryId > 0 THEN @iCountryId ELSE Country.Id END)
  88 + AND License.Zip = (CASE WHEN LEN(@sZip)>0 THEN @sZip ELSE License.Zip END)
  89 + AND License.LicenseTypeId <> 5
  90 +
  91 + -- check whether the above query returns any row
  92 + IF @@Rowcount > 0
  93 + BEGIN
  94 + -- fetch startdate, enddate, subscriptionprice of a license
  95 + SELECT @mSubscriptionPrice = LicenseSubscriptionDetail.TotalAmount,
  96 + @dtStartDate = LicenseSubscriptionDetail.SubscriptionValidFrom,
  97 + @dtEndDate = LicenseSubscriptionDetail.SubscriptionValidThrough
  98 + FROM LicenseSubscriptionDetail
  99 + WHERE LicenseSubscriptionDetail.Id = @iLicenseSubscriptionDetail
  100 +
  101 + -- fetch all the editions mapped as a string with a license
  102 + SELECT @sEdition = Edition.Title + '; ' + @sEdition
  103 + FROM LicenseToEdition INNER JOIN Edition
  104 + ON LicenseToEdition.EditionId = Edition.Id
  105 + WHERE LicenseToEdition.LicenseId = @iLicenseId
  106 + -- remove the trailing comma-separator from the edition-string
  107 + -- AMI SET @sEdition = SUBSTRING(@sEdition,1,LEN(@sEdition)-1);
  108 + IF LEN(@sEdition)> 1
  109 + -- remove the trailing comma-separator from the edition-string
  110 + SET @sEdition = SUBSTRING(@sEdition,1,LEN(@sEdition)-1)
  111 + ELSE
  112 + SET @sEdition = @sEdition
  113 +
  114 + -- insert into the temporary table
  115 + INSERT INTO #SubscribedLicenseReport
  116 + (AccountNumber, LicenseeName, LicenseType, InstitutionName, Edition, ValidFrom, ValidThrough,LicenseCreationDate, Price, AccountType,CardNumber)
  117 + VALUES(@sAccountNumber,@sLicenseeName,@sLicenseType,@sInstitutionName,@sEdition,@dtStartDate,@dtEndDate,@dtLicenseCreationDate,@mSubscriptionPrice,@sAccountType,@iCardNumber)
  118 + END
  119 + -- fetch the next record from cursor
  120 + FETCH NEXT FROM @cGetLicenseID INTO @iLicenseId,@iLicenseSubscriptionDetail
  121 + -- end of while loop
  122 + END
  123 + -- close the cursor to free up resources
  124 + CLOSE @cGetLicenseID
  125 + DEALLOCATE @cGetLicenseID
  126 +
  127 + -- Selecting the desired result from temporary table
  128 + --SELECT AccountNumber, LicenseeName, LicenseType,InstitutionName, AccountType, Edition,
  129 + --CONVERT(VARCHAR,ValidFrom,101) as StartDate, CONVERT(VARCHAR,ValidThrough,101) as EndDate,
  130 + --CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate,
  131 + --CONVERT(NUMERIC(14,2),Price) as SubscriptionPrice,CardNumber
  132 + --FROM #SubscribedLicenseReport ORDER BY AccountNumber
  133 +
  134 +
  135 + SELECT RowNum as 'Serial_No', AccountNumber, LicenseeName, LicenseType,InstitutionName, AccountType, Edition,
  136 + StartDate, EndDate,
  137 + LicenseCreationDate,
  138 + SubscriptionPrice,CardNumber
  139 + from (
  140 + SELECT ROW_NUMBER() OVER (ORDER BY AccountNumber) AS RowNum, AccountNumber, LicenseeName, LicenseType,InstitutionName, AccountType, Edition,
  141 + CONVERT(VARCHAR,ValidFrom,101) as StartDate, CONVERT(VARCHAR,ValidThrough,101) as EndDate,
  142 + CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate,
  143 + CONVERT(NUMERIC(14,2),Price) as SubscriptionPrice,isnull(CardNumber,'') as CardNumber
  144 + FROM #SubscribedLicenseReport) as Tempt
  145 + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo
  146 + ORDER BY AccountNumber
  147 +
  148 + select @recordCount = count(ResultTable.AccountNumber)
  149 + from (
  150 + SELECT AccountNumber, LicenseeName, LicenseType,InstitutionName, AccountType, Edition,
  151 + CONVERT(VARCHAR,ValidFrom,101) as StartDate, CONVERT(VARCHAR,ValidThrough,101) as EndDate,
  152 + CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate,
  153 + CONVERT(NUMERIC(14,2),Price) as SubscriptionPrice,CardNumber
  154 + FROM #SubscribedLicenseReport) as ResultTable
  155 +
  156 + -- Dropping the temporary table
  157 + DROP TABLE #SubscribedLicenseReport
  158 +END
  159 +
  160 +
... ...
500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetUsageReport.sql 0 โ†’ 100644
  1 +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetUsageReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  2 +drop procedure [dbo].[usp_GetUsageReport]
  3 +GO
  4 +Create PROCEDURE [dbo].[usp_GetUsageReport]--'2011-01-01','2018-01-01','','',0,0,1,10,0
  5 + -- Add the parameters for the stored procedure here
  6 + -- FromDate & ToDate are mandatory parameters
  7 + @sFromDate varchar(20), @sToDate varchar(20), @sAccoutNumber varchar(50)='',
  8 + @sZip varchar(20) = '', @iState int, @iCountry int,
  9 + @pageNo int, @pageLength int, @recordCount int out
  10 +AS
  11 +BEGIN
  12 + IF 1=0 BEGIN
  13 + SET FMTONLY OFF
  14 + END
  15 + -- SET NOCOUNT ON added to prevent extra result sets from
  16 + SET NOCOUNT ON
  17 + DECLARE @cGetUserDetails CURSOR
  18 + DECLARE @iUserId INT
  19 + DECLARE @sAccountNumber VARCHAR(50)
  20 + DECLARE @iCardNumber INT
  21 + DECLARE @sLoginId VARCHAR(50)
  22 + DECLARE @sFirstName VARCHAR(100)
  23 + DECLARE @sLastName VARCHAR(100)
  24 + DECLARE @sUserType VARCHAR(50)
  25 + DECLARE @dtFromDate DATETIME
  26 + DECLARE @dtToDate DATETIME
  27 + DECLARE @dtLicenseCreationDate DATETIME
  28 + DECLARE @sLicenseState VARCHAR(50)
  29 + DECLARE @sLicenseZip VARCHAR(20)
  30 + DECLARE @sLicenseCountry VARCHAR(50)
  31 + DECLARE @sInstitutionName VARCHAR(100)
  32 + DECLARE @iTotalLogins INT
  33 + DECLARE @dtLastLogin DATETIME
  34 +
  35 + -- convert the datatype of fromdate & todate parameter to datetime
  36 + SELECT @dtFromDate = CONVERT(DATETIME,@sFromDate)
  37 + SELECT @dtToDate = DATEADD(ms,-3,DATEADD(DAY,1,CONVERT(DATETIME,@sToDate)))
  38 +
  39 + -- create a temporary table to store the results of users logged into the system within a particular time period
  40 + CREATE TABLE #UsageReport
  41 + (
  42 + LoginId VARCHAR(50),
  43 + FirstName VARCHAR(100),
  44 + LastName VARCHAR(100),
  45 + AccountNumber VARCHAR(50),
  46 + CardNumber INT,
  47 + UserType VARCHAR(50),
  48 + LicenseCreationDate DATETIME,
  49 + LicenseState VARCHAR(50),
  50 + LicenseZip VARCHAR(20),
  51 + LicenseCountry VARCHAR(50),
  52 + InstitutionName VARCHAR(100),
  53 + TotalLogins INT,
  54 + LastLoginDate DATETIME
  55 + )
  56 +
  57 + -- define the forward only, read-only cursor
  58 + SET @cGetUserDetails = CURSOR FAST_FORWARD
  59 + FOR
  60 + SELECT LoginDetail.UserId, COUNT(1) as TotalLogins, MAX(LoginDetail.LoginTime)
  61 + FROM LoginDetail WHERE
  62 + (LoginTime) BETWEEN @dtFromDate AND @dtToDate
  63 + GROUP BY LoginDetail.UserId
  64 +
  65 + -- open & fetch the cursor variables into the local variables
  66 + OPEN @cGetUserDetails
  67 + FETCH NEXT FROM @cGetUserDetails INTO @iUserId, @iTotalLogins, @dtLastLogin
  68 + -- start of while loop
  69 + WHILE @@FETCH_STATUS = 0
  70 + BEGIN
  71 + -- fetch account number, state, zip, country of the license to which the user is belonged
  72 + SELECT @sAccountNumber = License.AccountNumber,
  73 + @dtLicenseCreationDate = License.CreationDate,
  74 + @sInstitutionName = License.InstitutionName,
  75 + @sLicenseState = State.StateName,
  76 + @sLicenseZip = License.Zip,
  77 + @sLicenseCountry = Country.CountryName,
  78 + @iCardNumber = (CASE WHEN License.CardNumber > 0 THEN License.CardNumber END)
  79 + FROM AIAUserToLicenseEdition
  80 + INNER JOIN LicenseToEdition ON AIAUserToLicenseEdition.LicenseEditionId = LicenseToEdition.Id
  81 + INNER JOIN License ON LicenseToEdition.LicenseId = License.Id
  82 + INNER JOIN State ON License.StateId = State.Id
  83 + INNER JOIN Country ON License.CountryId = Country.Id
  84 + WHERE AIAUserToLicenseEdition.UserId = @iUserId
  85 + AND License.IsActive = 1
  86 + AND License.AccountNumber = (CASE WHEN LEN(@sAccoutNumber)>0 THEN @sAccoutNumber ELSE License.AccountNumber END)
  87 + AND State.Id = (CASE WHEN @iState > 0 THEN @iState ELSE State.Id END)
  88 + AND Country.Id = (CASE WHEN @iCountry > 0 THEN @iCountry ELSE Country.Id END)
  89 + AND License.Zip = (CASE WHEN LEN(@sZip)>0 THEN @sZip ELSE License.Zip END)
  90 + --AND License.LicenseTypeId <> 5
  91 + --AND License.Country = (CASE WHEN LEN(@sCountry)>0 THEN @sCountry ELSE License.Country END)
  92 +
  93 + -- check whether the above query returns any row
  94 + IF @@Rowcount > 0
  95 + BEGIN
  96 + -- fetch loginid, firstname, lastname, usertype of the user
  97 + SELECT @sLoginId = AIAUser.LoginId, @sFirstName = AIAUser.Firstname,
  98 + @sLastName = AIAUser.LastName, @sUserType = UserType.Title
  99 + FROM AIAUser
  100 + INNER JOIN UserType ON AIAUser.UserTypeId = UserType.Id
  101 + WHERE AIAUser.Id = @iUserId
  102 + AND AIAUser.IsActive = 1
  103 +
  104 + IF @@Rowcount > 0
  105 + BEGIN
  106 + -- insert into the temporary table
  107 + INSERT INTO #UsageReport
  108 + (LoginId, FirstName, LastName, AccountNumber,CardNumber ,UserType,LicenseCreationDate, LicenseState, LicenseZip,
  109 + LicenseCountry,InstitutionName, TotalLogins, LastLoginDate)
  110 + VALUES(@sLoginId, @sFirstName, @sLastName, @sAccountNumber, @iCardNumber, @sUserType,@dtLicenseCreationDate,
  111 + @sLicenseState, @sLicenseZip, @sLicenseCountry,@sInstitutionName, @iTotalLogins, @dtLastLogin)
  112 + END
  113 + END
  114 + -- fetch the next record from cursor
  115 + FETCH NEXT FROM @cGetUserDetails INTO @iUserId, @iTotalLogins, @dtLastLogin
  116 + -- end of while loop
  117 + END
  118 + -- close the cursor to free up resources
  119 + CLOSE @cGetUserDetails
  120 + DEALLOCATE @cGetUserDetails
  121 +
  122 + -- Selecting the desired result from temporary table
  123 + --SELECT LoginId, FirstName, LastName, AccountNumber, CardNumber,UserType,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate, LicenseZip, LicenseState,
  124 + --LicenseCountry,InstitutionName, TotalLogins, CONVERT(VARCHAR,LastLoginDate,101) as LastLogin FROM #UsageReport ORDER BY AccountNumber
  125 +
  126 +
  127 + Select RowNum as 'Serial_No',
  128 + LoginId, FirstName, LastName, AccountNumber, CardNumber,UserType,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate, LicenseZip, LicenseState,
  129 + LicenseCountry,InstitutionName, TotalLogins, LastLogin
  130 + from (
  131 + SELECT ROW_NUMBER() OVER (ORDER BY AccountNumber) AS RowNum ,
  132 + LoginId, FirstName, LastName, isnull(AccountNumber,'') as AccountNumber, isnull(CardNumber,'') as CardNumber,UserType,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate,
  133 + LicenseZip, LicenseState,
  134 + LicenseCountry,InstitutionName, TotalLogins, CONVERT(VARCHAR,LastLoginDate,101) as LastLogin FROM #UsageReport) as usr
  135 + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo
  136 + order by AccountNumber
  137 +
  138 +
  139 + --Calculate total number of records
  140 + select @recordCount = count(ResultTable.LoginId) from (SELECT LoginId, FirstName, LastName, AccountNumber, CardNumber,UserType,CONVERT(VARCHAR,LicenseCreationDate,101) as LicenseCreationDate, LicenseZip, LicenseState,
  141 + LicenseCountry,InstitutionName, TotalLogins, CONVERT(VARCHAR,LastLoginDate,101) as LastLogin FROM #UsageReport) as ResultTable;
  142 + -- Dropping the temporary table
  143 + DROP TABLE #UsageReport
  144 +END
  145 +
  146 +
  147 +
... ...