diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenses.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenses.sql index 051b8c5..63c10cb 100644 --- a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenses.sql +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenses.sql diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs index 2a536d3..1979338 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs @@ -17,7 +17,7 @@ namespace AIAHTML5.ADMIN.API .Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter); // Configure cross domain access - var cors = new EnableCorsAttribute("http://localhost:4200, http://localhost:91", "*", "*"); + var cors = new EnableCorsAttribute("http://localhost:4200, http://localhost:4201, http://localhost:91", "*", "*"); config.EnableCors(cors); // Web API routes diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index 915d327..789b405 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -42,14 +42,15 @@ namespace AIAHTML5.ADMIN.API.Controllers [HttpGet] public HttpResponseMessage GetLicenses(string accountNumber, string licenseeFirstName, string licenseeLastName, byte licenseTypeId, string institutionName, int stateId, int countryId, string emailId, DateTime subscriptionStartDate, DateTime subscriptionEndDate, - bool isActive) + bool isActive, int pageNo, int pageLength) { List LicenseList = new List(); + int recordCount = 0; try { LicenseList = LicenseModel.GetLicenses(dbContext, accountNumber, licenseeFirstName, licenseeLastName, licenseTypeId, institutionName, - stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive); - return Request.CreateResponse(HttpStatusCode.OK, LicenseList); + stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive, pageNo, pageLength, out recordCount); + return Request.CreateResponse(HttpStatusCode.OK, new { LicenseList = LicenseList, RecordCount = recordCount }); } catch (Exception ex) { diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index 5da2af0..0eef8d1 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -2976,7 +2976,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseTypes"); } - public virtual ObjectResult usp_GetLicenses(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable iLicenseTypeId, string sInstituteName, string sEmail, Nullable iStateId, Nullable iCountryId, Nullable bisActive) + public virtual ObjectResult usp_GetLicenses(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable iLicenseTypeId, string sInstituteName, string sEmail, Nullable iStateId, Nullable iCountryId, Nullable bisActive, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sStartDateParameter = sStartDate != null ? new ObjectParameter("sStartDate", sStartDate) : @@ -3022,7 +3022,15 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("bisActive", bisActive) : new ObjectParameter("bisActive", typeof(bool)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenses", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter); + var pageNoParameter = pageNo.HasValue ? + new ObjectParameter("pageNo", pageNo) : + new ObjectParameter("pageNo", typeof(int)); + + var pageLengthParameter = pageLength.HasValue ? + new ObjectParameter("pageLength", pageLength) : + new ObjectParameter("pageLength", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenses", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetEditions() @@ -3513,5 +3521,31 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_DeleteLicenseUserGroup", userGroupIdParameter, status); } + + public virtual int usp_SaveLabExerciseAttempts(Nullable userId, string labExerciseIdentifier, Nullable lastQuestion, Nullable totalQuestions) + { + var userIdParameter = userId.HasValue ? + new ObjectParameter("UserId", userId) : + new ObjectParameter("UserId", typeof(int)); + + var labExerciseIdentifierParameter = labExerciseIdentifier != null ? + new ObjectParameter("LabExerciseIdentifier", labExerciseIdentifier) : + new ObjectParameter("LabExerciseIdentifier", typeof(string)); + + var lastQuestionParameter = lastQuestion.HasValue ? + new ObjectParameter("LastQuestion", lastQuestion) : + new ObjectParameter("LastQuestion", typeof(int)); + + var totalQuestionsParameter = totalQuestions.HasValue ? + new ObjectParameter("TotalQuestions", totalQuestions) : + new ObjectParameter("TotalQuestions", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_SaveLabExerciseAttempts", userIdParameter, labExerciseIdentifierParameter, lastQuestionParameter, totalQuestionsParameter); + } + + public virtual int uspInsertBulkRow() + { + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("uspInsertBulkRow"); + } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index 67cc317..9452d00 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -2656,6 +2656,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + @@ -2752,6 +2755,12 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + @@ -2814,6 +2823,7 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + @@ -6281,6 +6291,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + @@ -6432,6 +6445,13 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + + + + @@ -9913,6 +9933,8 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index 7c90749..c7251b7 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -58,19 +58,20 @@ namespace AIAHTML5.ADMIN.API.Models public static List GetLicenses(AIADatabaseV5Entities dbContext, string accountNumber, string licenseeFirstName, string licenseeLastName, byte licenseTypeId, string institutionName, int stateId, int countryId, string emailId, - DateTime subscriptionStartDate, DateTime subscriptionEndDate, bool isActive) + DateTime subscriptionStartDate, DateTime subscriptionEndDate, bool isActive, int pageNo, int pageLength, out int recordCount) { List LicenseList = new List(); LicenseModel LicenseObj = new LicenseModel(); - int i = 0; + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); + recordCount = 0; try { var result = dbContext.usp_GetLicenses( (subscriptionStartDate > DateTime.MinValue ? subscriptionStartDate.ToShortDateString() : "01/01/01"), (subscriptionEndDate > DateTime.MinValue ? subscriptionEndDate.ToShortDateString() : "01/01/01"), (accountNumber == null ? "" : accountNumber), (licenseeFirstName == null ? "" : licenseeFirstName), - (licenseeLastName == null ? "" : licenseeLastName), licenseTypeId, (institutionName == null ? "" : institutionName), - (emailId == null ? "" : emailId), stateId, countryId, isActive).ToList(); + (licenseeLastName == null ? "" : licenseeLastName), licenseTypeId, (institutionName == null ? "" : institutionName), + (emailId == null ? "" : emailId), stateId, countryId, isActive, pageNo, pageLength, spRecordCount).ToList(); if (result.Count > 0) { foreach (var item in result) @@ -97,9 +98,8 @@ namespace AIAHTML5.ADMIN.API.Models LicenseObj.ModifyDate = DateTime.ParseExact((item.ModifyDate == "" ? "01/01/0001" : item.ModifyDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); LicenseObj.IsActive = (item.LicenseStatus == "Active" ? true : false); LicenseList.Add(LicenseObj); - i++; - if (i >= 100) break; } + recordCount = (int)spRecordCount.Value; } } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts index c84b3ef..94f4f25 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts @@ -34,6 +34,7 @@ import { LicenseModestySettings } from './components/LicenseEntity/licensemodest import { LicenseModuleSettings } from './components/LicenseEntity/licensemodulesettings.component'; import { SiteLicenseAccount } from './components/LicenseEntity/sitelicenseaccount.component'; import { UserGroup } from './components/UserEntity/usergroup.component'; +import { PagerComponent } from './shared/Pager/pager.component'; import { AppComponent } from './app.component'; import { AppRoutingModule } from './app.routing.module'; @@ -61,7 +62,8 @@ import { LoadingService } from './shared/loading.service'; SubscriptionCancellationReport, NetAdSubscriptionReport, SiteLicenseUsageReport, DiscountCodeReport, ImageExportReport, EditLicenseBasicSettings, LicenseModestySettings, - LicenseModuleSettings, SiteLicenseAccount, UserGroup + LicenseModuleSettings, SiteLicenseAccount, UserGroup, + PagerComponent ], imports: [ BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule, diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html index 0b38faf..abecc3c 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html @@ -1,7 +1,8 @@
-

{{Mode}} Subscription Price

+

Subscription Price

+

{{Mode}} Subscription Price