Commit 40e69274dd1d2a58746030fbb1123efbe41ba595

Authored by Harpreet Banwait
1 parent 8d79375e

bug work

150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenses.sql
1 1 Binary files a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenses.sql and b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenses.sql differ
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs
... ... @@ -17,7 +17,7 @@ namespace AIAHTML5.ADMIN.API
17 17 .Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);
18 18  
19 19 // Configure cross domain access
20   - var cors = new EnableCorsAttribute("http://localhost:4200, http://localhost:91", "*", "*");
  20 + var cors = new EnableCorsAttribute("http://localhost:4200, http://localhost:4201, http://localhost:91", "*", "*");
21 21 config.EnableCors(cors);
22 22  
23 23 // Web API routes
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs
... ... @@ -42,14 +42,15 @@ namespace AIAHTML5.ADMIN.API.Controllers
42 42 [HttpGet]
43 43 public HttpResponseMessage GetLicenses(string accountNumber, string licenseeFirstName, string licenseeLastName, byte licenseTypeId,
44 44 string institutionName, int stateId, int countryId, string emailId, DateTime subscriptionStartDate, DateTime subscriptionEndDate,
45   - bool isActive)
  45 + bool isActive, int pageNo, int pageLength)
46 46 {
47 47 List<LicenseModel> LicenseList = new List<LicenseModel>();
  48 + int recordCount = 0;
48 49 try
49 50 {
50 51 LicenseList = LicenseModel.GetLicenses(dbContext, accountNumber, licenseeFirstName, licenseeLastName, licenseTypeId, institutionName,
51   - stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive);
52   - return Request.CreateResponse(HttpStatusCode.OK, LicenseList);
  52 + stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive, pageNo, pageLength, out recordCount);
  53 + return Request.CreateResponse(HttpStatusCode.OK, new { LicenseList = LicenseList, RecordCount = recordCount });
53 54 }
54 55 catch (Exception ex)
55 56 {
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
... ... @@ -2976,7 +2976,7 @@ namespace AIAHTML5.ADMIN.API.Entity
2976 2976 return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetLicenseTypes_Result>("usp_GetLicenseTypes");
2977 2977 }
2978 2978  
2979   - public virtual ObjectResult<usp_GetLicenses_Result> usp_GetLicenses(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable<byte> iLicenseTypeId, string sInstituteName, string sEmail, Nullable<int> iStateId, Nullable<int> iCountryId, Nullable<bool> bisActive)
  2979 + public virtual ObjectResult<usp_GetLicenses_Result> usp_GetLicenses(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable<byte> iLicenseTypeId, string sInstituteName, string sEmail, Nullable<int> iStateId, Nullable<int> iCountryId, Nullable<bool> bisActive, Nullable<int> pageNo, Nullable<int> pageLength, ObjectParameter recordCount)
2980 2980 {
2981 2981 var sStartDateParameter = sStartDate != null ?
2982 2982 new ObjectParameter("sStartDate", sStartDate) :
... ... @@ -3022,7 +3022,15 @@ namespace AIAHTML5.ADMIN.API.Entity
3022 3022 new ObjectParameter("bisActive", bisActive) :
3023 3023 new ObjectParameter("bisActive", typeof(bool));
3024 3024  
3025   - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetLicenses_Result>("usp_GetLicenses", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter);
  3025 + var pageNoParameter = pageNo.HasValue ?
  3026 + new ObjectParameter("pageNo", pageNo) :
  3027 + new ObjectParameter("pageNo", typeof(int));
  3028 +
  3029 + var pageLengthParameter = pageLength.HasValue ?
  3030 + new ObjectParameter("pageLength", pageLength) :
  3031 + new ObjectParameter("pageLength", typeof(int));
  3032 +
  3033 + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetLicenses_Result>("usp_GetLicenses", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter, pageNoParameter, pageLengthParameter, recordCount);
3026 3034 }
3027 3035  
3028 3036 public virtual ObjectResult<usp_GetEditions_Result> usp_GetEditions()
... ... @@ -3513,5 +3521,31 @@ namespace AIAHTML5.ADMIN.API.Entity
3513 3521  
3514 3522 return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_DeleteLicenseUserGroup", userGroupIdParameter, status);
3515 3523 }
  3524 +
  3525 + public virtual int usp_SaveLabExerciseAttempts(Nullable<int> userId, string labExerciseIdentifier, Nullable<int> lastQuestion, Nullable<int> totalQuestions)
  3526 + {
  3527 + var userIdParameter = userId.HasValue ?
  3528 + new ObjectParameter("UserId", userId) :
  3529 + new ObjectParameter("UserId", typeof(int));
  3530 +
  3531 + var labExerciseIdentifierParameter = labExerciseIdentifier != null ?
  3532 + new ObjectParameter("LabExerciseIdentifier", labExerciseIdentifier) :
  3533 + new ObjectParameter("LabExerciseIdentifier", typeof(string));
  3534 +
  3535 + var lastQuestionParameter = lastQuestion.HasValue ?
  3536 + new ObjectParameter("LastQuestion", lastQuestion) :
  3537 + new ObjectParameter("LastQuestion", typeof(int));
  3538 +
  3539 + var totalQuestionsParameter = totalQuestions.HasValue ?
  3540 + new ObjectParameter("TotalQuestions", totalQuestions) :
  3541 + new ObjectParameter("TotalQuestions", typeof(int));
  3542 +
  3543 + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_SaveLabExerciseAttempts", userIdParameter, labExerciseIdentifierParameter, lastQuestionParameter, totalQuestionsParameter);
  3544 + }
  3545 +
  3546 + public virtual int uspInsertBulkRow()
  3547 + {
  3548 + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("uspInsertBulkRow");
  3549 + }
3516 3550 }
3517 3551 }
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
... ... @@ -2656,6 +2656,9 @@ warning 6002: The table/view &#39;AIADatabaseV5.dbo.VocabTermNumberToSystemMap&#39; does
2656 2656 <Parameter Name="iStateId" Type="int" Mode="In" />
2657 2657 <Parameter Name="iCountryId" Type="int" Mode="In" />
2658 2658 <Parameter Name="bisActive" Type="bit" Mode="In" />
  2659 + <Parameter Name="pageNo" Type="int" Mode="In" />
  2660 + <Parameter Name="pageLength" Type="int" Mode="In" />
  2661 + <Parameter Name="recordCount" Type="int" Mode="InOut" />
2659 2662 </Function>
2660 2663 <Function Name="usp_GetLicenseTypes" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" />
2661 2664 <Function Name="usp_GetLicenseUserGroups" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
... ... @@ -2752,6 +2755,12 @@ warning 6002: The table/view &#39;AIADatabaseV5.dbo.VocabTermNumberToSystemMap&#39; does
2752 2755 <Parameter Name="SiteEditionIds" Type="varchar" Mode="In" />
2753 2756 <Parameter Name="Status" Type="bit" Mode="InOut" />
2754 2757 </Function>
  2758 + <Function Name="usp_SaveLabExerciseAttempts" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
  2759 + <Parameter Name="UserId" Type="int" Mode="In" />
  2760 + <Parameter Name="LabExerciseIdentifier" Type="nchar" Mode="In" />
  2761 + <Parameter Name="LastQuestion" Type="int" Mode="In" />
  2762 + <Parameter Name="TotalQuestions" Type="int" Mode="In" />
  2763 + </Function>
2755 2764 <Function Name="usp_UpdateAIAUser" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
2756 2765 <Parameter Name="sLoginId" Type="varchar" Mode="In" />
2757 2766 <Parameter Name="sPassword" Type="varchar" Mode="In" />
... ... @@ -2814,6 +2823,7 @@ warning 6002: The table/view &#39;AIADatabaseV5.dbo.VocabTermNumberToSystemMap&#39; does
2814 2823 <Parameter Name="olduserId" Type="varchar" Mode="In" />
2815 2824 <Parameter Name="Status" Type="int" Mode="InOut" />
2816 2825 </Function>
  2826 + <Function Name="uspInsertBulkRow" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" />
2817 2827 <EntityContainer Name="AIADatabaseV5ModelStoreContainer">
2818 2828 <EntitySet Name="AccountType" EntityType="Self.AccountType" Schema="dbo" store:Type="Tables" />
2819 2829 <EntitySet Name="Activity" EntityType="Self.Activity" Schema="dbo" store:Type="Tables" />
... ... @@ -6281,6 +6291,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
6281 6291 <Parameter Name="iStateId" Mode="In" Type="Int32" />
6282 6292 <Parameter Name="iCountryId" Mode="In" Type="Int32" />
6283 6293 <Parameter Name="bisActive" Mode="In" Type="Boolean" />
  6294 + <Parameter Name="pageNo" Mode="In" Type="Int32" />
  6295 + <Parameter Name="pageLength" Mode="In" Type="Int32" />
  6296 + <Parameter Name="recordCount" Mode="InOut" Type="Int32" />
6284 6297 </FunctionImport>
6285 6298 <FunctionImport Name="usp_GetEditions" ReturnType="Collection(AIADatabaseV5Model.usp_GetEditions_Result)" />
6286 6299 <FunctionImport Name="usp_InsertAIAUser" ReturnType="Collection(Int32)">
... ... @@ -6432,6 +6445,13 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
6432 6445 <Parameter Name="UserGroupId" Mode="In" Type="Int32" />
6433 6446 <Parameter Name="Status" Mode="InOut" Type="Boolean" />
6434 6447 </FunctionImport>
  6448 + <FunctionImport Name="usp_SaveLabExerciseAttempts">
  6449 + <Parameter Name="UserId" Mode="In" Type="Int32" />
  6450 + <Parameter Name="LabExerciseIdentifier" Mode="In" Type="String" />
  6451 + <Parameter Name="LastQuestion" Mode="In" Type="Int32" />
  6452 + <Parameter Name="TotalQuestions" Mode="In" Type="Int32" />
  6453 + </FunctionImport>
  6454 + <FunctionImport Name="uspInsertBulkRow" />
6435 6455 </EntityContainer>
6436 6456 <ComplexType Name="DA_GetBaseLayer_Result">
6437 6457 <Property Type="Int32" Name="Id" Nullable="false" />
... ... @@ -9913,6 +9933,8 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap]&lt;/Definin
9913 9933 <FunctionImportMapping FunctionImportName="usp_InsertDeleteUserManageRights" FunctionName="AIADatabaseV5Model.Store.usp_InsertDeleteUserManageRights" />
9914 9934 <FunctionImportMapping FunctionImportName="usp_UpdateLicenseUserGroupUsers" FunctionName="AIADatabaseV5Model.Store.usp_UpdateLicenseUserGroupUsers" />
9915 9935 <FunctionImportMapping FunctionImportName="usp_DeleteLicenseUserGroup" FunctionName="AIADatabaseV5Model.Store.usp_DeleteLicenseUserGroup" />
  9936 + <FunctionImportMapping FunctionImportName="usp_SaveLabExerciseAttempts" FunctionName="AIADatabaseV5Model.Store.usp_SaveLabExerciseAttempts" />
  9937 + <FunctionImportMapping FunctionImportName="uspInsertBulkRow" FunctionName="AIADatabaseV5Model.Store.uspInsertBulkRow" />
9916 9938 </EntityContainerMapping>
9917 9939 </Mapping>
9918 9940 </edmx:Mappings>
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs
... ... @@ -58,19 +58,20 @@ namespace AIAHTML5.ADMIN.API.Models
58 58  
59 59 public static List<LicenseModel> GetLicenses(AIADatabaseV5Entities dbContext, string accountNumber, string licenseeFirstName,
60 60 string licenseeLastName, byte licenseTypeId, string institutionName, int stateId, int countryId, string emailId,
61   - DateTime subscriptionStartDate, DateTime subscriptionEndDate, bool isActive)
  61 + DateTime subscriptionStartDate, DateTime subscriptionEndDate, bool isActive, int pageNo, int pageLength, out int recordCount)
62 62 {
63 63 List<LicenseModel> LicenseList = new List<LicenseModel>();
64 64 LicenseModel LicenseObj = new LicenseModel();
65   - int i = 0;
  65 + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
  66 + recordCount = 0;
66 67 try
67 68 {
68 69 var result = dbContext.usp_GetLicenses(
69 70 (subscriptionStartDate > DateTime.MinValue ? subscriptionStartDate.ToShortDateString() : "01/01/01"),
70 71 (subscriptionEndDate > DateTime.MinValue ? subscriptionEndDate.ToShortDateString() : "01/01/01"),
71 72 (accountNumber == null ? "" : accountNumber), (licenseeFirstName == null ? "" : licenseeFirstName),
72   - (licenseeLastName == null ? "" : licenseeLastName), licenseTypeId, (institutionName == null ? "" : institutionName),
73   - (emailId == null ? "" : emailId), stateId, countryId, isActive).ToList();
  73 + (licenseeLastName == null ? "" : licenseeLastName), licenseTypeId, (institutionName == null ? "" : institutionName),
  74 + (emailId == null ? "" : emailId), stateId, countryId, isActive, pageNo, pageLength, spRecordCount).ToList();
74 75 if (result.Count > 0)
75 76 {
76 77 foreach (var item in result)
... ... @@ -97,9 +98,8 @@ namespace AIAHTML5.ADMIN.API.Models
97 98 LicenseObj.ModifyDate = DateTime.ParseExact((item.ModifyDate == "" ? "01/01/0001" : item.ModifyDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture);
98 99 LicenseObj.IsActive = (item.LicenseStatus == "Active" ? true : false);
99 100 LicenseList.Add(LicenseObj);
100   - i++;
101   - if (i >= 100) break;
102 101 }
  102 + recordCount = (int)spRecordCount.Value;
103 103 }
104 104 }
105 105 catch (Exception ex) { }
... ...
400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts
... ... @@ -34,6 +34,7 @@ import { LicenseModestySettings } from &#39;./components/LicenseEntity/licensemodest
34 34 import { LicenseModuleSettings } from './components/LicenseEntity/licensemodulesettings.component';
35 35 import { SiteLicenseAccount } from './components/LicenseEntity/sitelicenseaccount.component';
36 36 import { UserGroup } from './components/UserEntity/usergroup.component';
  37 +import { PagerComponent } from './shared/Pager/pager.component';
37 38  
38 39 import { AppComponent } from './app.component';
39 40 import { AppRoutingModule } from './app.routing.module';
... ... @@ -61,7 +62,8 @@ import { LoadingService } from &#39;./shared/loading.service&#39;;
61 62 SubscriptionCancellationReport, NetAdSubscriptionReport,
62 63 SiteLicenseUsageReport, DiscountCodeReport, ImageExportReport,
63 64 EditLicenseBasicSettings, LicenseModestySettings,
64   - LicenseModuleSettings, SiteLicenseAccount, UserGroup
  65 + LicenseModuleSettings, SiteLicenseAccount, UserGroup,
  66 + PagerComponent
65 67 ],
66 68 imports: [
67 69 BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule,
... ...
400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html
1 1 <div class="row">
2 2 <!-- main-heading -->
3 3 <div class="col-sm-12 pageHeading" style="margin-left: 15px;">
4   - <h4>{{Mode}} Subscription Price</h4>
  4 + <h4 *ngIf="Mode=='Search'"> Subscription Price</h4>
  5 + <h4 *ngIf="Mode!='Search'">{{Mode}} Subscription Price</h4>
5 6 </div>
6 7 <!-- main-heading -->
7 8  
... ...