From a7a8cc8b7381afcb723fc2d3c54b0467d2f23030 Mon Sep 17 00:00:00 2001 From: Birendra Date: Tue, 9 Nov 2021 09:19:09 +0530 Subject: [PATCH] add sorting on report tables --- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs | 6 +++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs | 6 +++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs | 12 ++++++------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs | 12 ++++++------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SubscriptionPriceController.cs | 6 +++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs | 12 ++++++------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs | 12 ++++++------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs | 9 ++++----- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountCodes_Result.cs | 6 +++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExportedImageDetails_Result.cs | 6 ++---- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroupUsers_Result.cs | 5 ++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs | 1 - 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs | 14 ++++++-------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscriptionPlans_Result.cs | 6 +++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs | 7 +++---- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsersList_Result.cs | 13 ++++++------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs | 11 +++++------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs | 22 ++++------------------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs | 73 +++++++++++++------------------------------------------------------------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SubscriptionPriceModel.cs | 22 ++++------------------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs | 39 ++++++++------------------------------- 400-SOURCECODE/Admin/src/app/app.component.ts | 2 +- 400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts | 48 +++++++++++++++++++++++++++++------------------- 400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts | 3 ++- 400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.html | 77 +++++++++++++++++++++++++++++++++++------------------------------------------ 400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts | 253 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------ 400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html | 20 ++++++++++---------- 400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------- 400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.html | 16 +++++++--------- 400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------- 400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts | 15 ++++++++++++++- 400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html | 87 +++++++++++++++++++++++++++++++++------------------------------------------------------ 400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html | 24 ------------------------ 400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html | 40 +++++++++++++++++++--------------------- 400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts | 32 +++++++++++++++++++------------- 400-SOURCECODE/Admin/src/app/components/Reports/reportdatamodel.ts | 13 ++++++------- 400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html | 21 --------------------- 400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts | 272 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.html | 12 ++++++------ 400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.ts | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------- 400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.service.ts | 7 ++++++- 400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts | 1 + 400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts | 38 ++++++++++++++++++++++++++------------ 400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.html | 42 +++++++++++++++++++++--------------------- 400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.ts | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------- 400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html | 4 +--- 400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------- 400-SOURCECODE/Admin/src/app/shared/global.ts | 14 +++++++++++--- 400-SOURCECODE/Admin/src/assets/scripts/fixed_table_rc.js | 28 ++++++++++++++-------------- 400-SOURCECODE/Admin/src/assets/styles/fixed_table_rc.css | 2 +- 55 files changed, 1725 insertions(+), 1139 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs index 3b4ef5d..3e87f6a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs @@ -90,12 +90,12 @@ namespace AIAHTML5.ADMIN.API.Controllers public IHttpActionResult GetDiscountCode() { dbContext.Configuration.ProxyCreationEnabled = false; - List lstDiscountCode1 = new List(); + List lstDiscountCode1 = new List(); string sStartDate = DateTime.MinValue.ToShortDateString(); string sEndDate = DateTime.MaxValue.ToShortDateString(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstDiscountCode = dbContext.usp_GetDiscountCodes("", "", "", 1, 1, spRecordCount).ToList(); - lstDiscountCode1 = lstDiscountCode.Select(l => new DiscountCodeModel { Id = l.Id, DiscountCode = l.DiscountCode }).ToList(); + var lstDiscountCode = dbContext.usp_GetDiscountCodes("", "", "","Id","asc", 1, 1, spRecordCount).ToList(); + lstDiscountCode1 = lstDiscountCode.Select(l => new usp_GetDiscountCodes_Result { Id = l.Id, DiscountCode = l.DiscountCode }).ToList(); return Ok(lstDiscountCode1); } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs index 23e14af..29a90cb 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs @@ -25,13 +25,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetDiscountCodes")] [HttpGet] - public HttpResponseMessage GetDiscountCodes(string discountCode, DateTime startDate, DateTime endDate, int pageNo, int pageLength) + public HttpResponseMessage GetDiscountCodes(string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List DiscountCodeList = new List(); + List DiscountCodeList; int recordCount = 0; try { - DiscountCodeList = DiscountCodeModel.GetDiscountCodes(dbContext, discountCode, startDate, endDate, pageNo, pageLength, out recordCount); + DiscountCodeList = DiscountCodeModel.GetDiscountCodes(dbContext, discountCode, startDate, endDate, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { DiscountCodeList = DiscountCodeList, RecordCount = recordCount }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index 1745af0..e451ffe 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -43,14 +43,14 @@ 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, int pageNo, int pageLength) + bool isActive, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List LicenseList = new List(); + List LicenseList; int recordCount = 0; try { LicenseList = LicenseModel.GetLicenses(dbContext, accountNumber, licenseeFirstName, licenseeLastName, licenseTypeId, institutionName, - stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive, pageNo, pageLength, out recordCount); + stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { LicenseList = LicenseList, RecordCount = recordCount }); } catch (Exception ex) @@ -236,13 +236,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("LicenseSites")] [HttpGet] - public HttpResponseMessage GetLicenseSites(string AccountNo, int pageNo, int pageLength) + public HttpResponseMessage GetLicenseSites(string AccountNo, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List LicenseSiteList = new List(); + List LicenseSiteList; int recordCount = 0; try { - LicenseSiteList = LicenseModel.GetLicenseSites(dbContext, AccountNo, pageNo, pageLength, out recordCount); + LicenseSiteList = LicenseModel.GetLicenseSites(dbContext, AccountNo, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { LicenseSiteList = LicenseSiteList, RecordCount = recordCount }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs index fe97ff7..1efd752 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs @@ -22,21 +22,21 @@ namespace AIAHTML5.ADMIN.API.Controllers AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); [Route("GetUsageReport")] [HttpGet] - public IHttpActionResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, int iState, int iCountry, int pageNo, int pageLength) + public IHttpActionResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, int iState, int iCountry, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstUsageReport = dbContext.usp_GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry, pageNo, pageLength, spRecordCount).ToList(); + var lstUsageReport = dbContext.usp_GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { UserUsage = lstUsageReport, RecordCount = spRecordCount.Value }); //return Ok(lstUsageReport); } [Route("GetCustomerSummeryReport")] [HttpGet] - public IHttpActionResult GetCustomerSummeryReport(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, int iLicenseType, int iAccountType, string sZip, int iState, int iCountry, int pageNo, int pageLength) + public IHttpActionResult GetCustomerSummeryReport(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, int iLicenseType, int iAccountType, string sZip, int iState, int iCountry, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstCustomerSummeryReport = dbContext.usp_GetCustomerSummary(sAccoutNumber, sLicenseeFullName, iStartPrice, iEndPrice, (byte)iLicenseType, (byte)iAccountType, sZip, iState, iCountry, pageNo, pageLength, spRecordCount).ToList(); + var lstCustomerSummeryReport = dbContext.usp_GetCustomerSummary(sAccoutNumber, sLicenseeFullName, iStartPrice, iEndPrice, (byte)iLicenseType, (byte)iAccountType, sZip, iState, iCountry, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { CustomerSummery = lstCustomerSummeryReport, RecordCount = spRecordCount.Value }); //return Ok(lstCustomerSummeryReport); } @@ -121,13 +121,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetImageExportReport")] [HttpGet] - public IHttpActionResult GetImageExportReport(string sFromDate, string sToDate, string sAccountNumber, int pageNo, int pageLength) + public IHttpActionResult GetImageExportReport(string sFromDate, string sToDate, string sAccountNumber, string sortColumn, string sortOrder, int pageNo, int pageLength) { try { if (sAccountNumber == null) sAccountNumber = string.Empty; var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstImageExportReport = dbContext.usp_GetExportedImageDetails(sFromDate, sToDate, sAccountNumber, pageNo, pageLength, spRecordCount).ToList(); + var lstImageExportReport = dbContext.usp_GetExportedImageDetails(sFromDate, sToDate, sAccountNumber, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { ImageExportList = lstImageExportReport, RecordCount = spRecordCount.Value }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SubscriptionPriceController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SubscriptionPriceController.cs index 8ffa76d..136a422 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SubscriptionPriceController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SubscriptionPriceController.cs @@ -25,13 +25,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetSubscriptionPrices")] [HttpGet] - public HttpResponseMessage GetSubscriptionPrices(int editionId, int pageNo, int pageLength) + public HttpResponseMessage GetSubscriptionPrices(int editionId, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List SubscriptionPriceList = new List(); + List SubscriptionPriceList; int recordCount = 0; try { - SubscriptionPriceList = SubscriptionPriceModel.GetSubscriptionPrices(dbContext, editionId, pageNo, pageLength, out recordCount); + SubscriptionPriceList = SubscriptionPriceModel.GetSubscriptionPrices(dbContext, editionId, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { SubscriptionPriceList = SubscriptionPriceList, RecordCount = recordCount }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs index b811649..c34c366 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs @@ -186,7 +186,7 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("Users")] [HttpGet] - public IHttpActionResult UserList(string firstname, string lastname, string emailid, string accountnumber, string usertypeid, string accounttypeid, string userLoginStatus, + public IHttpActionResult UserList(string firstname, string lastname, string emailid, string accountnumber, string usertypeid, string accounttypeid, string userLoginStatus, string sortColumn, string sortOrder, int pageNo, int pageLength, int iLoginUserType,string loggedIn="") { try @@ -198,16 +198,16 @@ namespace AIAHTML5.ADMIN.API.Controllers dbContext.Configuration.ProxyCreationEnabled = false; //var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - //recordCount = (int)spRecordCount.Value; - List Users = dbContext.usp_GetUsersList(firstname, lastname, emailid, accountnumber, UserTypeId, AccountTypeId, iLoginUserType, loginStatus, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; + List Users = dbContext.usp_GetUsersList(firstname, lastname, emailid, accountnumber, UserTypeId, AccountTypeId, iLoginUserType, loginStatus, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); if (!string.IsNullOrEmpty(loggedIn)) - { + { if (Users.Where(s => s.LoginId == loggedIn).Count() > 0) - { + { Users = Users.Where(s => s.LoginId != loggedIn).ToList(); spRecordCount.Value = (int)spRecordCount.Value - 1; } - + } return Ok(new { UserList = Users, RecordCount = spRecordCount.Value }); } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs index 0f804ed..64968a4 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs @@ -24,13 +24,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("LicenseUserGroups")] [HttpGet] - public HttpResponseMessage GetLicenseUserGroups(int? LicenseId, int pageNo, int pageLength) + public HttpResponseMessage GetLicenseUserGroups(int? LicenseId, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List UserGroupList = new List(); + List UserGroupList; int recordCount = 0; try { - UserGroupList = UserGroupModel.GetLicenseUserGroups(dbContext, LicenseId, pageNo, pageLength, out recordCount); + UserGroupList = UserGroupModel.GetLicenseUserGroups(dbContext, LicenseId, sortColumn, sortOrder,pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { UserGroupList = UserGroupList, RecordCount = recordCount }); } catch (Exception ex) @@ -42,13 +42,13 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("LicenseUserGroupUsers")] [HttpGet] - public HttpResponseMessage GetLicenseUserGroupUsers(int? LicenseId, int UserGroupId, bool AllUsers, int pageNo, int pageLength) + public HttpResponseMessage GetLicenseUserGroupUsers(int? LicenseId, int UserGroupId, bool AllUsers, string sortColumn, string sortOrder, int pageNo, int pageLength) { - List UserList = new List(); + List UserList ; int recordCount = 0; try { - UserList = UserGroupModel.GetLicenseUserGroupUsers(dbContext, LicenseId, UserGroupId, AllUsers, pageNo, pageLength, out recordCount); + UserList = UserGroupModel.GetLicenseUserGroupUsers(dbContext, LicenseId, UserGroupId, AllUsers, sortColumn, sortOrder, pageNo, pageLength, out recordCount); return Request.CreateResponse(HttpStatusCode.OK, new { UserList = UserList, 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 d486a00..c50e14b 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -3095,7 +3095,7 @@ namespace AIAHTML5.ADMIN.API.Entity 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_GetlicensesList(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) + public virtual ObjectResult usp_GetlicensesList(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable iLicenseTypeId, string sInstituteName, string sEmail, Nullable iStateId, Nullable iCountryId, Nullable bisActive, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sStartDateParameter = sStartDate != null ? new ObjectParameter("sStartDate", sStartDate) : @@ -3141,6 +3141,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("bisActive", bisActive) : new ObjectParameter("bisActive", typeof(bool)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3149,7 +3157,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetlicensesList", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetlicensesList", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetLicenseTypes() @@ -3157,12 +3165,20 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseTypes"); } - public virtual ObjectResult usp_GetLicenseUserGroups(Nullable licenseId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetLicenseUserGroups(Nullable licenseId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var licenseIdParameter = licenseId.HasValue ? new ObjectParameter("LicenseId", licenseId) : new ObjectParameter("LicenseId", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3171,7 +3187,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseUserGroups", licenseIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseUserGroups", licenseIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetManageRights(Nullable userId, string roleName) @@ -3218,12 +3234,20 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteById", siteIdParameter); } - public virtual ObjectResult usp_GetSubscriptionPlans(Nullable iEditionId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetSubscriptionPlans(Nullable iEditionId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var iEditionIdParameter = iEditionId.HasValue ? new ObjectParameter("iEditionId", iEditionId) : new ObjectParameter("iEditionId", typeof(byte)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3232,7 +3256,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSubscriptionPlans", iEditionIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSubscriptionPlans", iEditionIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetUserType(Nullable id) @@ -3638,7 +3662,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("uspInsertBulkRow"); } - public virtual ObjectResult usp_GetLicenseUserGroupUsers(Nullable licenseId, Nullable groupId, Nullable allUsers, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetLicenseUserGroupUsers(Nullable licenseId, Nullable groupId, Nullable allUsers, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var licenseIdParameter = licenseId.HasValue ? new ObjectParameter("licenseId", licenseId) : @@ -3652,6 +3676,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("allUsers", allUsers) : new ObjectParameter("allUsers", typeof(bool)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3660,7 +3692,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseUserGroupUsers", licenseIdParameter, groupIdParameter, allUsersParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseUserGroupUsers", licenseIdParameter, groupIdParameter, allUsersParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_InsertResellerLicenseAccount(string sLicenseeFname, string sLicenseeLname, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sInstitutionName, string sAddress1, string sAddress2, string sCity, string sZip, Nullable iStateId, Nullable iCountryId, string sPhone, string sEmailId, Nullable iTotalLogins, string sStartDate, string sEndDate, string sEditionList, Nullable iTotalPrice, Nullable iCreatorId, string sProductKey, Nullable iNoofImages) @@ -3783,12 +3815,20 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteAccountAdmin", accountNumberParameter); } - public virtual ObjectResult usp_GetSiteAccountSites(string strAccountNumber, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetSiteAccountSites(string strAccountNumber, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var strAccountNumberParameter = strAccountNumber != null ? new ObjectParameter("strAccountNumber", strAccountNumber) : new ObjectParameter("strAccountNumber", typeof(string)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3797,7 +3837,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteAccountSites", strAccountNumberParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteAccountSites", strAccountNumberParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_DeleteLicense(Nullable iLicenseId) @@ -3900,7 +3940,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCancelledLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetCustomerSummary(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseType, Nullable iAccountType, string sZip, Nullable iState, Nullable iCountry, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetCustomerSummary(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseType, Nullable iAccountType, string sZip, Nullable iState, Nullable iCountry, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sAccoutNumberParameter = sAccoutNumber != null ? new ObjectParameter("sAccoutNumber", sAccoutNumber) : @@ -3938,6 +3978,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountry", iCountry) : new ObjectParameter("iCountry", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3946,10 +3994,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCustomerSummary", sAccoutNumberParameter, sLicenseeFullNameParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeParameter, iAccountTypeParameter, sZipParameter, iStateParameter, iCountryParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCustomerSummary", sAccoutNumberParameter, sLicenseeFullNameParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeParameter, iAccountTypeParameter, sZipParameter, iStateParameter, iCountryParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetDiscountCodes(string sDiscountCode, string sStartDate, string sEndDate, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetDiscountCodes(string sDiscountCode, string sStartDate, string sEndDate, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sDiscountCodeParameter = sDiscountCode != null ? new ObjectParameter("sDiscountCode", sDiscountCode) : @@ -3963,6 +4011,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("sEndDate", sEndDate) : new ObjectParameter("sEndDate", typeof(string)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3971,7 +4027,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountCodes", sDiscountCodeParameter, sStartDateParameter, sEndDateParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountCodes", sDiscountCodeParameter, sStartDateParameter, sEndDateParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetDiscountReport(string sStartDate, string sEndDate, Nullable intDiscountID, string sAccoutNumber, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) @@ -4052,7 +4108,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetExpiringLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetExportedImageDetails(string sStartDate, string sEndDate, string sAccoutNumber, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetExportedImageDetails(string sStartDate, string sEndDate, string sAccoutNumber, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sStartDateParameter = sStartDate != null ? new ObjectParameter("sStartDate", sStartDate) : @@ -4066,6 +4122,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("sAccoutNumber", sAccoutNumber) : new ObjectParameter("sAccoutNumber", typeof(string)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4074,7 +4138,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetExportedImageDetails", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetExportedImageDetails", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult> usp_GetIncorrectLoginAttempt(Nullable iUserId) @@ -4341,7 +4405,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSubscribedLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, Nullable iState, Nullable iCountry, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, Nullable iState, Nullable iCountry, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4367,6 +4431,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountry", iCountry) : new ObjectParameter("iCountry", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4375,7 +4447,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUsageReport", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, sZipParameter, iStateParameter, iCountryParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUsageReport", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, sZipParameter, iStateParameter, iCountryParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetUserList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) @@ -4419,7 +4491,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUserList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetUsersList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable iLoginStatus, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetUsersList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable iLoginStatus, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFirstNameParameter = sFirstName != null ? new ObjectParameter("sFirstName", sFirstName) : @@ -4453,6 +4525,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iLoginStatus", iLoginStatus) : new ObjectParameter("iLoginStatus", typeof(bool)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4461,7 +4541,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUsersList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, iLoginStatusParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUsersList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, iLoginStatusParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetUserTyeByAccountNumber(Nullable iUserTypeId, Nullable iLicenseId) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index 9527612..2267912 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -644,10 +644,6 @@ - - - - @@ -994,6 +990,8 @@ + + @@ -1002,6 +1000,8 @@ + + @@ -1034,6 +1034,8 @@ + + @@ -1082,6 +1084,8 @@ + + @@ -1089,6 +1093,8 @@ + + @@ -1097,6 +1103,8 @@ + + @@ -1150,6 +1158,8 @@ + + @@ -1198,6 +1208,8 @@ + + @@ -1209,6 +1221,8 @@ + + @@ -1234,6 +1248,8 @@ + + @@ -2460,6 +2476,8 @@ + + @@ -2467,6 +2485,8 @@ + + @@ -2487,6 +2507,8 @@ + + @@ -2626,6 +2648,8 @@ + + @@ -2667,6 +2691,8 @@ + + @@ -2709,6 +2735,8 @@ + + @@ -2717,6 +2745,8 @@ + + @@ -2748,6 +2778,8 @@ + + @@ -2840,6 +2872,8 @@ + + @@ -2865,6 +2899,8 @@ + + @@ -3907,26 +3943,25 @@ - - - - - - - + + + + + + + - + - - - - - - - - + + + + + + + + - @@ -3941,7 +3976,6 @@ - @@ -3985,12 +4019,12 @@ - - - + + + @@ -4057,14 +4091,13 @@ - - - + + @@ -4091,18 +4124,16 @@ - - - - - + + - - - - + + + + + @@ -4148,31 +4179,30 @@ - - + - - - + - - - + + + + + - + - - - + + + @@ -4199,16 +4229,14 @@ - - - - - - - - - - + + + + + + + + @@ -4318,41 +4346,39 @@ - - - + + - + - + - - + - - + + - - - + + + - + @@ -5530,7 +5556,6 @@ - @@ -5749,7 +5774,6 @@ - @@ -5772,7 +5796,6 @@ - @@ -5836,12 +5859,12 @@ - - + + @@ -5920,14 +5943,13 @@ - - + @@ -5968,18 +5990,16 @@ - - - - - - - + + + + + @@ -6058,15 +6078,12 @@ - - - @@ -6075,7 +6092,9 @@ - + + + @@ -6086,7 +6105,7 @@ - + @@ -6125,8 +6144,6 @@ - - @@ -6287,7 +6304,6 @@ - @@ -6308,7 +6324,6 @@ - diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs index 93416fc..4c626fc 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCustomerSummary_Result.cs @@ -13,22 +13,21 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetCustomerSummary_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string LicenseeName { get; set; } public string LicenseType { get; set; } public string AccountType { get; set; } public string Edition { get; set; } public string Email { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } public string LicenseStatus { get; set; } public Nullable Price { get; set; } public string LicenseZip { get; set; } public string LicenseState { get; set; } public string LicenseCountry { get; set; } public string InstitutionName { get; set; } - public string LicenseCreationDate { get; set; } - public int CardNumber { get; set; } + public Nullable LicenseCreationDate { get; set; } + public Nullable CardNumber { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountCodes_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountCodes_Result.cs index 36b4aa7..0198a94 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountCodes_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountCodes_Result.cs @@ -16,8 +16,8 @@ namespace AIAHTML5.ADMIN.API.Entity public int Id { get; set; } public string DiscountCode { get; set; } public decimal Percentage { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - public string Status { get; set; } + public System.DateTime StartDate { get; set; } + public System.DateTime EndDate { get; set; } + public bool IsActive { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExportedImageDetails_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExportedImageDetails_Result.cs index 380c81c..9b29604 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExportedImageDetails_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExportedImageDetails_Result.cs @@ -13,15 +13,13 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetExportedImageDetails_Result { - public Nullable RowNum { get; set; } - public int LicenseId { get; set; } - public string ExportedDate { get; set; } + public System.DateTime ExportedDate { get; set; } public string ImageName { get; set; } public string AccountNumber { get; set; } public string OriginalFileName { get; set; } public string Title { get; set; } public string ModuleName { get; set; } - public int ExportLimit { get; set; } + public Nullable ExportLimit { get; set; } public string UserName { get; set; } public Nullable imageCount { get; set; } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroupUsers_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroupUsers_Result.cs index f129818..a4aa96d 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroupUsers_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroupUsers_Result.cs @@ -13,13 +13,12 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetLicenseUserGroupUsers_Result { - public Nullable RowNo { get; set; } public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string LoginId { get; set; } public string EmailId { get; set; } - public string Title { get; set; } - public int InGroup { get; set; } + public bool InGroup { get; set; } + public string ProductEdition { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs index 8269798..4e88bff 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs @@ -20,6 +20,5 @@ namespace AIAHTML5.ADMIN.API.Entity public Nullable ModifiedDate { get; set; } public bool IsActive { get; set; } public Nullable TotalUsers { get; set; } - public Nullable RowNo { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs index 8510c4b..a98b3b7 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs @@ -14,16 +14,14 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetSiteAccountSites_Result { public int Id { get; set; } - public string SiteIp { get; set; } public string Title { get; set; } - public string SiteIPTo { get; set; } - public string SiteMasterIPTo { get; set; } - public string CreationDate { get; set; } - public string ModifiedDate { get; set; } + public Nullable CreationDate { get; set; } + public Nullable ModifiedDate { get; set; } public string InstituteName { get; set; } public string Department { get; set; } - public int UserId { get; set; } - public string FirstName { get; set; } - public string EmailId { get; set; } + public string Ip { get; set; } + public string SiteIpTo { get; set; } + public string SiteUserFirstName { get; set; } + public string SiteUserEmailId { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscriptionPlans_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscriptionPlans_Result.cs index 6bc11dd..e41c7eb 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscriptionPlans_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscriptionPlans_Result.cs @@ -13,11 +13,11 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetSubscriptionPlans_Result { - public Nullable price { get; set; } - public string title { get; set; } - public short Id { get; set; } + public int Id { get; set; } public byte EditionId { get; set; } public byte Duration { get; set; } public bool IsActive { get; set; } + public string Title { get; set; } + public Nullable Price { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs index ec4b6a5..93612db 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsageReport_Result.cs @@ -13,19 +13,18 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetUsageReport_Result { - public Nullable Serial_No { get; set; } public string LoginId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string AccountNumber { get; set; } - public int CardNumber { get; set; } + public Nullable CardNumber { get; set; } public string UserType { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public string LicenseZip { get; set; } public string LicenseState { get; set; } public string LicenseCountry { get; set; } public string InstitutionName { get; set; } public Nullable TotalLogins { get; set; } - public string LastLogin { get; set; } + public Nullable LastLogin { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsersList_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsersList_Result.cs index 46f0615..a525c5a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsersList_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetUsersList_Result.cs @@ -13,23 +13,22 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetUsersList_Result { - public Nullable RowNum { get; set; } - public Nullable Id { get; set; } + public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string LoginId { get; set; } public string EmailId { get; set; } public string UserTypeTitle { get; set; } public string Password { get; set; } - public Nullable CreationDate { get; set; } - public Nullable ModifiedDate { get; set; } + public System.DateTime CreationDate { get; set; } + public System.DateTime ModifiedDate { get; set; } public string AccountNumber { get; set; } public string AccountTypeTitle { get; set; } public string EditionType { get; set; } public string UserStatus { get; set; } - public Nullable UserTypeId { get; set; } - public Nullable EditionTypeId { get; set; } - public Nullable LoginStatus { get; set; } + public int UserTypeId { get; set; } + public int EditionTypeId { get; set; } + public bool LoginStatus { get; set; } public string TotalLogin { get; set; } public string LicenseStatus { get; set; } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs index 4c646af..e039b57 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs @@ -26,13 +26,12 @@ namespace AIAHTML5.ADMIN.API.Entity public string ClientAdmin { get; set; } public string LicenseeName { get; set; } public string ContactAddress { get; set; } - public string EntryDate { get; set; } + public Nullable EntryDate { get; set; } public string LicenseStatus { get; set; } - public string ModifyDate { get; set; } - public string StartDate { get; set; } - public string RenewDate { get; set; } - public string EndDate { get; set; } + public Nullable ModifyDate { get; set; } + public Nullable StartDate { get; set; } + public Nullable RenewDate { get; set; } + public Nullable EndDate { get; set; } public Nullable NoofImages { get; set; } - public Nullable RowNo { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs index 179be65..1ea92bd 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs @@ -15,29 +15,15 @@ namespace AIAHTML5.ADMIN.API.Models public bool IsActive { get; set; } public decimal Percentage { get; set; } - public static List GetDiscountCodes(AIADatabaseV5Entities dbContext, string discountCode, DateTime startDate, DateTime endDate, int pageNo, int pageLength, out int recordCount) + public static List GetDiscountCodes(AIADatabaseV5Entities dbContext, string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List DiscountCodeList = new List(); - DiscountCodeModel DiscountCodeObj = new DiscountCodeModel(); + List DiscountCodeList = new List(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetDiscountCodes(discountCode, startDate.ToString("MM/dd/yyyy"), endDate.ToString("MM/dd/yyyy"), pageNo, pageLength, spRecordCount).ToList(); - if (result.Count > 0) - { - foreach (var item in result) - { - DiscountCodeObj = new DiscountCodeModel(); - DiscountCodeObj.Id = item.Id; - DiscountCodeObj.DiscountCode = item.DiscountCode; - DiscountCodeObj.StartDate = DateTime.ParseExact(item.StartDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - DiscountCodeObj.EndDate = DateTime.ParseExact(item.EndDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - DiscountCodeObj.Percentage = item.Percentage; - DiscountCodeObj.IsActive = (item.Status == "Active" ? true : false); - DiscountCodeList.Add(DiscountCodeObj); - } - } + DiscountCodeList = dbContext.usp_GetDiscountCodes(discountCode, startDate.ToString("MM/dd/yyyy"), endDate.ToString("MM/dd/yyyy"), sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index ec8b34a..39014ec 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -47,6 +47,7 @@ namespace AIAHTML5.ADMIN.API.Models public int? TotalLogins { get; set; } public string EditionLogins { get; set; } public decimal Price { get; set; } + public int? SiteUserId { get; set; } public string LoginId { get; set; } public string Password { get; set; } public byte? SecurityQuestionId { get; set; } @@ -59,50 +60,23 @@ namespace AIAHTML5.ADMIN.API.Models public byte? TestLicenseEditionId { get; set; } public bool IsRenew { get; set; } - public static List GetLicenses(AIADatabaseV5Entities dbContext, string accountNumber, string licenseeFirstName, + 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, int pageNo, int pageLength, out int recordCount) + DateTime subscriptionStartDate, DateTime subscriptionEndDate, bool isActive, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List LicenseList = new List(); - LicenseModel LicenseObj = new LicenseModel(); + List LicenseList=new List(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetlicensesList( + LicenseList = dbContext.usp_GetlicensesList( (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, pageNo, pageLength, spRecordCount).ToList(); - if (result.Count > 0) + (emailId == null ? "" : emailId), stateId, countryId, isActive, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + if (LicenseList.Count > 0) { - foreach (var item in result) - { - LicenseObj = new LicenseModel(); - LicenseObj.LicenseId = item.LicenseId; - LicenseObj.AccountNumber = item.AccountNumber; - LicenseObj.AccountTypeName = item.AccountType; - LicenseObj.LicenseeName = item.LicenseeName; - LicenseObj.LicenseState = item.LicenseState; - LicenseObj.LicenseCountry = item.LicenseCountry; - LicenseObj.Address = item.ContactAddress; - LicenseObj.InstitutionName = item.InstitutionName; - LicenseObj.LicenseTypeName = item.LicenseType; - LicenseObj.EmailId = item.EmailId; - LicenseObj.NoOfImages = item.NoofImages; - LicenseObj.ClientAdmin = item.ClientAdmin; - LicenseObj.CardNumber = item.CardNumber; - LicenseObj.ProductKey = item.ProductKey; - LicenseObj.SubscriptionStartDate = DateTime.ParseExact(item.StartDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - LicenseObj.SubscriptionEndDate = DateTime.ParseExact(item.EndDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - LicenseObj.EntryDate = DateTime.ParseExact(item.EntryDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - LicenseObj.RenewDate = DateTime.ParseExact((item.RenewDate == "" ? "01/01/0001" : item.RenewDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - 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); - LicenseObj.LicStatus = item.LicenseStatus; - LicenseList.Add(LicenseObj); - } recordCount = (int)spRecordCount.Value; } } @@ -162,6 +136,7 @@ namespace AIAHTML5.ADMIN.API.Models LicenseObj.MasterSiteUrl = result[0].SiteUrl; LicenseObj.SiteUrlTo = result[0].SitToUrl; LicenseObj.SiteUrlFrom = result[0].SiteMasterUrl; + LicenseObj.SiteUserId = result[0].UserId; LicenseObj.LoginId = result[0].Login; LicenseObj.Password = result[0].Password; LicenseObj.SecurityQuestionId = (byte?)result[0].SecurityQuestionId; @@ -177,38 +152,16 @@ namespace AIAHTML5.ADMIN.API.Models return LicenseObj; } - public static List GetLicenseSites(AIADatabaseV5Entities dbContext, string AccountNo, int pageNo, int pageLength, out int recordCount) + public static List GetLicenseSites(AIADatabaseV5Entities dbContext, string AccountNo, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List LicenseSiteList = new List(); - SiteModel SiteModelObj = new SiteModel(); + List LicenseSiteList = new List(); + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetSiteAccountSites(AccountNo, pageNo, pageLength, spRecordCount).ToList(); - if (result.Count > 0) - { - foreach (var item in result) - { - SiteModelObj = new SiteModel(); - SiteModelObj.Id = item.Id; - SiteModelObj.Ip = item.SiteIp; - SiteModelObj.SiteIpTo = item.SiteIPTo; - SiteModelObj.MasterIpTo = item.SiteMasterIPTo; - SiteModelObj.InstituteName = item.InstituteName; - SiteModelObj.Department = item.Department; - SiteModelObj.SiteUserId = item.UserId; - SiteModelObj.SiteUserEmailId = item.EmailId; - SiteModelObj.SiteUserFirstName = item.FirstName; - SiteModelObj.Title = item.Title; - SiteModelObj.CreationDate = DateTime.ParseExact(item.CreationDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - if (!string.IsNullOrEmpty(item.ModifiedDate)) - { - SiteModelObj.ModifiedDate = DateTime.ParseExact(item.ModifiedDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); - } - LicenseSiteList.Add(SiteModelObj); - } - } + LicenseSiteList = dbContext.usp_GetSiteAccountSites(AccountNo, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SubscriptionPriceModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SubscriptionPriceModel.cs index d58129f..b115353 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SubscriptionPriceModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SubscriptionPriceModel.cs @@ -15,29 +15,15 @@ namespace AIAHTML5.ADMIN.API.Models public int EditionId { get; set; } public bool IsActive { get; set; } - public static List GetSubscriptionPrices(AIADatabaseV5Entities dbContext, int editionId, int pageNo, int pageLength, out int recordCount) + public static List GetSubscriptionPrices(AIADatabaseV5Entities dbContext, int editionId, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List SubscriptionPriceList = new List(); - SubscriptionPriceModel SubscriptionPriceObj = new SubscriptionPriceModel(); + List SubscriptionPriceList = new List(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetSubscriptionPlans((byte?)editionId, pageNo, pageLength, spRecordCount).ToList(); - if (result.Count > 0) - { - foreach (var item in result) - { - SubscriptionPriceObj = new SubscriptionPriceModel(); - SubscriptionPriceObj.Id = item.Id; - SubscriptionPriceObj.Title = item.title; - SubscriptionPriceObj.Price = item.price.Value; - SubscriptionPriceObj.Duration = item.Duration; - SubscriptionPriceObj.EditionId = item.EditionId; - SubscriptionPriceObj.IsActive = item.IsActive; - SubscriptionPriceList.Add(SubscriptionPriceObj); - } - } + SubscriptionPriceList = dbContext.usp_GetSubscriptionPlans((byte?)editionId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs index e0a646f..a383de3 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs @@ -16,54 +16,31 @@ namespace AIAHTML5.ADMIN.API.Models public bool? IsActive { get; set; } public int? TotalUsers { get; set; } - public static List GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int? LicenseId, int pageNo, int pageLength, out int recordCount) + public static List GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int? LicenseId, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List UserGroupList = new List(); - UserGroupModel UserGroupObj = new UserGroupModel(); + List UserGroupList = new List(); + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetLicenseUserGroups(LicenseId, pageNo, pageLength, spRecordCount).ToList(); - foreach (var item in result) - { - UserGroupObj = new UserGroupModel(); - UserGroupObj.Id = item.Id; - UserGroupObj.LicenseId = item.LicenseId; - UserGroupObj.Title = item.Title; - UserGroupObj.IsActive = item.IsActive; - UserGroupObj.ModifiedDate = item.ModifiedDate; - UserGroupObj.CreationDate = item.CreationDate; - UserGroupObj.TotalUsers = item.TotalUsers; - UserGroupList.Add(UserGroupObj); - } + UserGroupList = dbContext.usp_GetLicenseUserGroups(LicenseId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); + recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } return UserGroupList; } - public static List GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int? LicenseId, int UserGroupId, bool AllUsers, int pageNo, int pageLength, out int recordCount) + public static List GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int? LicenseId, int UserGroupId, bool AllUsers, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) { - List UserList = new List(); + List UserList = new List(); UserModel UserModelObj = new UserModel(); var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); recordCount = 0; try { - var result = dbContext.usp_GetLicenseUserGroupUsers(LicenseId, UserGroupId, AllUsers, pageNo, pageLength, spRecordCount).ToList(); - foreach (var item in result) - { - UserModelObj = new UserModel(); - UserModelObj.Id = item.Id; - UserModelObj.FirstName = item.FirstName; - UserModelObj.LastName = item.LastName; - UserModelObj.LoginId = item.LoginId; - UserModelObj.EmailId = item.EmailId; - UserModelObj.ProductEdition = item.Title; - UserModelObj.InGroup = item.InGroup; - UserList.Add(UserModelObj); - } + UserList = dbContext.usp_GetLicenseUserGroupUsers(LicenseId, UserGroupId, AllUsers, sortColumn, sortOrder,pageNo, pageLength, spRecordCount).ToList(); recordCount = (int)spRecordCount.Value; } catch (Exception ex) { } diff --git a/400-SOURCECODE/Admin/src/app/app.component.ts b/400-SOURCECODE/Admin/src/app/app.component.ts index a7fca5e..57163da 100644 --- a/400-SOURCECODE/Admin/src/app/app.component.ts +++ b/400-SOURCECODE/Admin/src/app/app.component.ts @@ -104,7 +104,7 @@ export class AppComponent implements OnInit { UserId: this.global.UserId, UserType: this.global.UserTypeName }).subscribe(x => { - console.log(x); this.UserManageRightsList = x; + //console.log(x); this.UserManageRightsList = x; this.objMenuGernal = this.obj[i].HeaderMenu; //this.objMenuGernal = this.objMenu; //this.objMenu=''; diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts index c048d99..4a51d79 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts @@ -16,23 +16,28 @@ export class LicenseService{ constructor(private http: Http, private commonService: GlobalService ) { } - GetLicenses(obj: any, pageNo: number, pageLength: number) { - if(obj.subscriptionStartDate == ''){ + GetLicenses(obj: any) { + if(obj.subscriptionStartDate == '' || obj.subscriptionStartDate == null){ obj.subscriptionStartDate = '1/1/1'; } - if(obj.subscriptionEndDate == ''){ + if(obj.subscriptionEndDate == '' || obj.subscriptionEndDate == null){ obj.subscriptionEndDate = '1/1/9999'; } - obj.subscriptionStartDate = this.datePipe.transform(obj.subscriptionStartDate, 'MM/dd/yyyy'); - obj.subscriptionEndDate = this.datePipe.transform(obj.subscriptionEndDate, 'MM/dd/yyyy'); - return this.http.get(this.commonService.resourceBaseUrl + "License/Licenses?accountNumber=" + obj.accountNumber + - "&licenseeFirstName=" + obj.licenseeFirstName + "&licenseeLastName=" + obj.licenseeLastName + - "&licenseTypeId=" + obj.licenseTypeId + "&institutionName=" + obj.institutionName + - "&stateId=" + obj.stateId + "&countryId=" + obj.countryId + "&emailId=" + obj.emailId + - "&subscriptionStartDate=" + obj.subscriptionStartDate + "&subscriptionEndDate=" + obj.subscriptionEndDate + - "&isActive=" + obj.isActive + "&pageNo=" + pageNo + "&pageLength=" + pageLength) - .map(this.extractData) - .catch((res: Response) => this.handleError(res)); + + obj.subscriptionStartDate = this.datePipe.transform(obj.subscriptionStartDate, 'MM/dd/yyyy'); + obj.subscriptionEndDate = this.datePipe.transform(obj.subscriptionEndDate, 'MM/dd/yyyy'); + return this.http.get(this.commonService.resourceBaseUrl + "License/Licenses?accountNumber=" + obj.accountNumber + + "&licenseeFirstName=" + obj.licenseeFirstName + "&licenseeLastName=" + obj.licenseeLastName + + "&licenseTypeId=" + obj.licenseTypeId + "&institutionName=" + obj.institutionName + + "&stateId=" + obj.stateId + "&countryId=" + obj.countryId + "&emailId=" + obj.emailId + + "&subscriptionStartDate=" + obj.subscriptionStartDate + "&subscriptionEndDate=" + obj.subscriptionEndDate + + "&isActive=" + obj.isActive + + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + "&pageLength=" + obj.pageLength) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } GetLicenseById(Id: number){ @@ -96,11 +101,16 @@ export class LicenseService{ .map(this.extractData) .catch((res: Response) => this.handleError(res)); } - - GetLicenseSites(accountNo: string, pageNo: number, pageLength: number) { - return this.http.get(this.commonService.resourceBaseUrl + "License/LicenseSites?AccountNo=" + accountNo + "&pageNo=" + pageNo + "&pageLength=" + pageLength) - .map(this.extractData) - .catch((res: Response) => this.handleError(res)); + + GetLicenseSites(obj: any) { + return this.http.get(this.commonService.resourceBaseUrl + "License/LicenseSites?AccountNo=" + obj.AccountNumber + + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength + ) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); } GetLicenseSiteAdmin(accountNo: string) { @@ -367,7 +377,7 @@ export class LicenseService{ DeleteSiteAccount(obj: any) { return this.http.get(this.commonService.resourceBaseUrl + "Site/DeleteSiteAccount?SiteId=" + - obj.Id + "&LicenseId=" + obj.LicenseId + "&UserId=" + obj.SiteUserId) + obj.siteId + "&LicenseId=" + obj.LicenseId + "&UserId=" + obj.SiteUserId) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts index 6773236..eaeeaf7 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts @@ -100,7 +100,8 @@ export class LicenseModestySettings implements OnInit { this.GetLicenseEditionModesty(); } else { - this.licenseService.GetLicenseSites(this.AccountNumber, 1, 1000) + //this service function also use in building level account + this.licenseService.GetLicenseSites({AccountNumber:this.AccountNumber,sortColumn:'Id',sortOrder:'asc',pageNo:1,pageLength:1000}) .subscribe(st => { this.lstLicenseSites = st.LicenseSiteList; if (this.lstLicenseSites.length == 0) { diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.html index 93a2df2..e297439 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.html +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.html @@ -164,7 +164,6 @@
-
Email is invalid
@@ -180,9 +179,7 @@ - - -
Subscription start date requires date in mm/dd/yyyy format
+ @@ -198,9 +195,7 @@ - - -
Subscription end date requires date in mm/dd/yyyy format
+ @@ -223,22 +218,22 @@ Account No. Licensee Name - License Type - Account Type + License Type + Account Type Institution Name - Address + Address State (Only U.S.) Country Email ID - Subscription Start Date - Subscription Renewal Date - Subscription End Date - Status - Original Entry Date - Last Modified Date - No. of Export Images + Subs. Start Date + Subs. Renewal Date + Subs. End Date + Status + Org. Entry Date + Modified Date + Export Images Admin - Credit Card No. + Card No. Product Key @@ -249,33 +244,31 @@ - + {{item.AccountNumber}} - {{item.LicenseeName}} - {{item.LicenseTypeName}} - {{item.AccountTypeName}} - {{item.InstitutionName}} - {{item.Address}} - {{item.LicenseState}} - {{item.LicenseCountry}} - {{item.EmailId}} - {{item.SubscriptionStartDate == '0001-01-01T00:00:00' ? '' : item.SubscriptionStartDate | date: 'MM/dd/yyyy'}} - {{item.RenewDate == '0001-01-01T00:00:00' ? '' : item.RenewDate | date: 'MM/dd/yyyy'}} - {{item.SubscriptionEndDate == '0001-01-01T00:00:00' ? '' : item.SubscriptionEndDate | date: 'MM/dd/yyyy'}} - - Active - Inactive - Expired - + {{item.LicenseeName}} + {{item.LicenseType}} + {{item.AccountType}} + {{item.InstitutionName}} + {{item.ContactAddress}} + {{item.LicenseState}} + {{item.LicenseCountry}} + {{item.EmailId}} + {{item.StartDate| date: 'MM/dd/yyyy'}} + {{item.RenewDate | date: 'MM/dd/yyyy'}} + {{item.EndDate | date: 'MM/dd/yyyy'}} + + Active + Inactive + Expired - {{item.EntryDate == '0001-01-01T00:00:00' ? '' : item.EntryDate | date: 'MM/dd/yyyy'}} - {{item.ModifyDate == '0001-01-01T00:00:00' ? '' : item.ModifyDate | date: 'MM/dd/yyyy'}} - {{item.NoOfImages}} - {{item.ClientAdmin}} - {{item.CardNumber}} - {{item.ProductKey}} + {{item.EntryDate| date: 'MM/dd/yyyy'}} + {{item.ModifyDate| date: 'MM/dd/yyyy'}} + {{item.NoofImages}} + {{item.ClientAdmin}} + {{item.CardNumber}} + {{item.ProductKey}} diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts index 1c50b7c..a78e1af 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/searchlicense.component.ts @@ -52,12 +52,46 @@ export class SearchLicense implements OnInit, AfterViewChecked { returnFrom: boolean; dateStartInvalid: boolean = false; dateEndInvalid: boolean = false; - tempSearchParams: any; + tempSearchParams: any = { + accountNumber:'', + licenseeFirstName:'', + licenseeLastName:'', + licenseTypeId:0, + institutionName:'', + stateId:0, + countryId:0, + subscriptionStartDate:'', + subscriptionEndDate:'', + isActive:true, + emailId:'', + sortColumn:'EntryDate', + sortOrder:'asc', + Id: 0, + row: -1, + pageNo: 1, + pageLength: 10 + }; // Declare height and width variables scrHeight:any; scrWidth:any; - fieldName:string; - sortType:string; + SearchField:any={ + accountNumber:'', + licenseeFirstName:'', + licenseeLastName:'', + licenseTypeId:0, + institutionName:'', + stateId:0, + countryId:0, + subscriptionStartDate:'', + subscriptionEndDate:'', + isActive:true, + emailId:'', + sortColumn:'EntryDate', + sortOrder:'asc', + pageNo:1, + pageLength:10 + } + @HostListener('window:resize', ['$event']) getScreenSize(event?) { @@ -69,8 +103,9 @@ export class SearchLicense implements OnInit, AfterViewChecked { { this.scrHeight = window.innerHeight-460; } - - // $(".ft_container").css("height",this.scrHeight) + if(this.scrHeight<=300) this.scrHeight=300; + + $(".ft_container").css("height",this.scrHeight); } constructor(private licenseService: LicenseService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder, @@ -92,7 +127,7 @@ export class SearchLicense implements OnInit, AfterViewChecked { institutionName: [''], stateId: [0], countryId: [0], - emailId: ['', Validators.email], + emailId: [''], subscriptionStartDate: [''], subscriptionEndDate: [''], isActive: [true], @@ -123,6 +158,44 @@ export class SearchLicense implements OnInit, AfterViewChecked { this.selectedRow = +params['row']; this.pageNo = params['pageNo']; this.pageLength = params['pageLength']; + + var sortColumn=params['sortColumn']; + var sortOrder=params['sortOrder']; + + this.tempSearchParams.accountNumber=params['accountNumber']; + this.tempSearchParams.licenseeFirstName=params['licenseeFirstName']; + this.tempSearchParams.licenseeLastName=params['licenseeLastName']; + this.tempSearchParams.licenseTypeId=params['licenseTypeId']; + this.tempSearchParams.institutionName=params['institutionName']; + this.tempSearchParams.stateId=params['stateId']; + this.tempSearchParams.countryId=params['countryId']; + this.tempSearchParams.subscriptionStartDate=params['subscriptionStartDate']; + this.tempSearchParams.subscriptionEndDate=params['subscriptionEndDate']; + this.tempSearchParams.isActive=params['isActive']; + this.tempSearchParams.emailId=params['emailId']; + this.tempSearchParams.Id=this.selectedId; + this.tempSearchParams.row=this.selectedId; + this.tempSearchParams.sortColumn=sortColumn; + this.tempSearchParams.sortOrder=sortOrder; + this.tempSearchParams.pageNo=this.pageNo; + this.tempSearchParams.pageLength=this.pageLength; + + this.SearchField.accountNumber=params['accountNumber']; + this.SearchField.licenseeFirstName=params['licenseeFirstName']; + this.SearchField.licenseeLastName=params['licenseeLastName']; + this.SearchField.licenseTypeId=params['licenseTypeId']; + this.SearchField.institutionName=params['institutionName']; + this.SearchField.stateId=params['stateId']; + this.SearchField.countryId=params['countryId']; + this.SearchField.subscriptionStartDate=params['subscriptionStartDate']; + this.SearchField.subscriptionEndDate=params['subscriptionEndDate']; + this.SearchField.isActive=params['isActive']; + this.SearchField.emailId=params['emailId']; + this.SearchField.sortColumn=sortColumn; + this.SearchField.sortOrder=sortOrder; + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + this.returnFrom = true; } else { @@ -141,8 +214,8 @@ export class SearchLicense implements OnInit, AfterViewChecked { width: "100%", height: this.scrHeight, colModal: [ - { width: 150, align: 'center' }, - { width: 150, align: 'center' }, + { width: 120, align: 'center' }, + { width: 130, align: 'center' }, { width: 150, align: 'Center' }, { width: 150, align: 'Center' }, { width: 150, align: 'Center' }, @@ -150,44 +223,43 @@ export class SearchLicense implements OnInit, AfterViewChecked { { width: 150, align: 'Center' }, { width: 150, align: 'center' }, { width: 150, align: 'Center' }, - { width: 200, align: 'center' }, - { width: 200, align: 'center' }, - { width: 200, align: 'center' }, + { width: 130, align: 'center' }, { width: 150, align: 'center' }, - { width: 200, align: 'center' }, - { width: 200, align: 'center' }, - { width: 200, align: 'Center' }, + { width: 130, align: 'center' }, + { width: 90, align: 'center' }, + { width: 130, align: 'center' }, + { width: 120, align: 'center' }, + { width: 120, align: 'Center' }, { width: 150, align: 'Center' }, - { width: 150, align: 'center' }, - { width: 150, align: 'center' }, + { width: 100, align: 'center' }, + { width: 120, align: 'center' }, ], sort: true }); - if ($('fixed_table_rc').length > 0) { - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } - // $("#fixed_hdr2 thead tr th").unbind("click"); - // $(".ft_rwrapper table thead tr th").on("click",function(event){ - - // this.fieldName=event.currentTarget.id; - // var isAscSort = $(".ft_rwrapper table thead tr #"+this.fieldName).hasClass('fx_sort_asc'); - // $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); - - // if (isAscSort) { - // $(".ft_rwrapper table thead tr #"+this.fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); - // this.sortType="desc"; - // } else { - // $(".ft_rwrapper table thead tr #"+this.fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); - // this.sortType="asc"; - // } + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); - // }); + } + + }); } @@ -205,6 +277,31 @@ export class SearchLicense implements OnInit, AfterViewChecked { this.license = item; this.tempSearchParams.Id = this.selectedId; this.tempSearchParams.row = this.selectedRow; + + this.tempSearchParams.pageNo = this.pageNo; + this.tempSearchParams.pageLength = this.pageLength; + + this.tempSearchParams.sortColumn = this.SearchField.sortColumn; + this.tempSearchParams.sortOrder = this.SearchField.sortOrder; + } + + GetLicenseList() { + + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (this.SearchField.sortOrder=='asc') { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } else + { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } + + this._loadingService.ShowLoading("global-loading"); + this.licenseService.GetLicenses(this.SearchField) + .subscribe(x => { this.BindFormFields(x); + + }, error => this.error = error); + } BindFormFields(data) { @@ -216,13 +313,12 @@ export class SearchLicense implements OnInit, AfterViewChecked { this.license = this.searchLicenseFrm.controls['licenses'].value.find(C => C.LicenseId == this.selectedId); } if (this.licenses.length > 0) { - this.NoRecord = ''; - this._loadingService.HideLoading("global-loading"); + this.NoRecord = ''; } if (this.licenses.length == 0) { this.NoRecord = this.global.NoRecords; - this._loadingService.HideLoading("global-loading"); } + this._loadingService.HideLoading("global-loading"); } DateChange(dateValue: any) { @@ -237,8 +333,14 @@ export class SearchLicense implements OnInit, AfterViewChecked { this.dateStartInvalid = false; } } - else { - this.dateStartInvalid = false; + else + { + this.dateStartInvalid = false; + if(dateValue._bsValue=='Invalid Date') + { + this.dateStartInvalid = true; + } + this.searchLicenseFrm.controls['subscriptionStartDate'].setValue(dateValue._bsValue); } } @@ -248,12 +350,18 @@ export class SearchLicense implements OnInit, AfterViewChecked { if (dateValue._datepicker._elementRef.nativeElement.value != '') { this.dateEndInvalid = true; } - else { + else + { this.dateEndInvalid = false; } } - else { - this.dateEndInvalid = false; + else + { + this.dateEndInvalid = false; + if(dateValue._bsValue=='Invalid Date') + { + this.dateEndInvalid = true; + } this.searchLicenseFrm.controls['subscriptionEndDate'].setValue(dateValue._bsValue); } } @@ -269,19 +377,36 @@ export class SearchLicense implements OnInit, AfterViewChecked { } public SearchLicenses(evt: any) { - if (this.alerts != '') return; if (!this.returnFrom) { this.selectedRow = -1; this.selectedId = -1; } if (this.returnFrom) this.returnFrom = false; - this._loadingService.ShowLoading("global-loading"); var tempArr = evt.split(','); this.pageNo = parseInt(tempArr[0]); this.pageLength = parseInt(tempArr[1]); - this.licenseService.GetLicenses(this.searchLicenseFrm.value, this.pageNo, this.pageLength) - .subscribe(x => { this.BindFormFields(x); - this.tempSearchParams = { + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetLicenseList(); + + } + + SortTableRecords(fieldName:string,sortType:string) { + this.selectedRow = -1; + + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetLicenseList(); + } + + SearchRecords() { + this.selectedRow = -1; + this.pageNo=1; + + this.tempSearchParams = { 'accountNumber': this.searchLicenseFrm.controls['accountNumber'].value, 'licenseeFirstName': this.searchLicenseFrm.controls['licenseeFirstName'].value, 'licenseeLastName': this.searchLicenseFrm.controls['licenseeLastName'].value, @@ -297,14 +422,22 @@ export class SearchLicense implements OnInit, AfterViewChecked { 'row': this.selectedRow, 'pageNo': this.pageNo, 'pageLength': this.pageLength - }; - this._loadingService.HideLoading("global-loading"); + }; - }, error => this.error = error); - } - - SearchRecords() { - this.SearchLicenses('1, ' + this.pageLength); + this.SearchField.accountNumber=this.searchLicenseFrm.controls['accountNumber'].value; + this.SearchField.licenseeFirstName=this.searchLicenseFrm.controls['licenseeFirstName'].value; + this.SearchField.licenseeLastName=this.searchLicenseFrm.controls['licenseeLastName'].value; + this.SearchField.licenseTypeId=this.searchLicenseFrm.controls['licenseTypeId'].value; + this.SearchField.institutionName=this.searchLicenseFrm.controls['institutionName'].value; + this.SearchField.stateId=this.searchLicenseFrm.controls['stateId'].value; + this.SearchField.countryId=this.searchLicenseFrm.controls['countryId'].value; + this.SearchField.subscriptionStartDate=this.searchLicenseFrm.controls['subscriptionStartDate'].value; + this.SearchField.subscriptionEndDate=this.searchLicenseFrm.controls['subscriptionEndDate'].value; + this.SearchField.isActive=this.searchLicenseFrm.controls['isActive'].value; + this.SearchField.emailId=this.searchLicenseFrm.controls['emailId'].value; + this.SearchField.pageNo=this.pageNo; + + this.GetLicenseList(); } GetLicenseType() { @@ -338,7 +471,7 @@ EditLicense() { this._confirmService.activate("License deleted successfully.", "alertMsg"); // this.modalAlerts = "

License deleted successfully

"; //this.modalRef = this.modalService.show(template); - this.SearchRecords(); + this.GetLicenseList(); } } diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html index 52137f8..1959c0b 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html @@ -75,18 +75,18 @@
- +
- - - - - - - - - + + + + + + + + + diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts index 8f49b40..c716043 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts @@ -49,6 +49,13 @@ export class SiteLicenseAccount implements OnInit { // Declare height and width variables scrHeight:any; scrWidth:any; + SearchField:any={ + AccountNumber:'', + sortColumn:'Id', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; @HostListener('window:resize', ['$event']) getScreenSize(event?) { @@ -60,6 +67,9 @@ export class SiteLicenseAccount implements OnInit { { this.scrHeight = window.innerHeight-360; } + if(this.scrHeight<=300) this.scrHeight=300; + + $(".ft_container").css("height",this.scrHeight); } constructor(private licenseService: LicenseService, @@ -136,14 +146,14 @@ export class SiteLicenseAccount implements OnInit { height: this.scrHeight, colModal: [ { width: 200, align: 'center' }, - { width: 200, align: 'center' }, + { width: 180, align: 'center' }, { width: 200, align: 'Center' }, { width: 200, align: 'Center' }, { width: 250, align: 'Center' }, { width: 200, align: 'Center' }, { width: 200, align: 'Center' }, - { width: 200, align: 'Center' }, - { width: 200, align: 'Center' }, + { width: 180, align: 'Center' }, + { width: 170, align: 'Center' }, ], sort: true }); @@ -154,15 +164,30 @@ export class SiteLicenseAccount implements OnInit { this.NoRecord = ''; this.recordCount = 0; this.pagerComponent = new PagerComponent(); - - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } public noWhitespaceValidator(control: FormControl) { // new validation for intial whaite space @@ -241,7 +266,7 @@ export class SiteLicenseAccount implements OnInit { public SetClickedRow(i: number, item: any) { this.selectedRow = i; this.selectedId = item['Id']; - this.licenseSite = item; + this.licenseSite = []; } BindFormFields(data){ @@ -249,11 +274,11 @@ export class SiteLicenseAccount implements OnInit { this.lstLicenseSites = data.LicenseSiteList; if(this.recordCount > 0){ if(this.selectedRow > -1){ - this.selectedId = this.lstLicenseSites[this.selectedRow].siteId; + this.selectedId = this.lstLicenseSites[this.selectedRow].Id; this.SetClickedRow(this.selectedRow, this.lstLicenseSites[this.selectedRow]); } } - this.GetLicenseSiteAdmin(); + if (this.lstLicenseSites.length > 0) { this.NoRecord = ''; this._loadingService.HideLoading("global-loading"); @@ -277,6 +302,8 @@ export class SiteLicenseAccount implements OnInit { }); }); this.lstClientAdmin = tempArr; + this._loadingService.HideLoading("global-loading"); + } GetLicenseAccounts() { @@ -367,19 +394,38 @@ export class SiteLicenseAccount implements OnInit { }, error => this.error = error); } + SortTableRecords(fieldName:string,sortType:string) { + this.selectedRow = -1; + + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetLicenseSitesList(); + } + GetLicenseSites(evt: any) { if (this.alerts != '') return; if(this.license.LicenseId == 0){ return; } - this._loadingService.ShowLoading("global-loading"); var tempArr = evt.split(','); this.pageNo = parseInt(tempArr[0]); this.pageLength = parseInt(tempArr[1]); - this._loadingService.ShowLoading("global-loading"); - this.licenseService.GetLicenseSites(this.license.AccountNumber, this.pageNo, this.pageLength) - .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetLicenseSitesList(); + } + + GetLicenseSitesList() + { + this.SearchField.AccountNumber=this.license.AccountNumber; + this._loadingService.ShowLoading("global-loading"); + this.licenseService.GetLicenseSites(this.SearchField) + .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + } + GetLicenseSiteAdmin() { this.licenseService.GetLicenseSiteAdmin(this.license.AccountNumber) @@ -389,7 +435,10 @@ export class SiteLicenseAccount implements OnInit { SearchRecords() { this.selectedRow = -1; this.selectedId = -1; - this.GetLicenseSites('1, ' + this.pageLength); + this.pageNo=1; + this.SearchField.pageNo=this.pageNo; + + this.GetLicenseSitesList(); } GetEditions() { @@ -430,7 +479,8 @@ export class SiteLicenseAccount implements OnInit { }); }); this.insertUpdateSiteLicenseFrm.setControl('editionLoginArr', this.fb.array(this.lstEditionLogins)); - this._loadingService.HideLoading("global-loading"); + + this.GetLicenseSiteAdmin(); }, error => this.error = error); } @@ -441,8 +491,6 @@ export class SiteLicenseAccount implements OnInit { this.alerts = "Site account delete unsuccessfull"; } else { this._confirmService.activate("Site account deleted successfully.", "alertMsg"); - //this.modalAlerts = "

Site account deleted successfully

"; - //this.modalRef = this.modalService.show(template); this.SearchRecords(); } } @@ -452,11 +500,7 @@ export class SiteLicenseAccount implements OnInit { this.alerts = "License site save unsuccessfull."; } else { this.mode = 'Edit'; - this.selectedId = data; - this.GetSiteById(); - //this.modalAlerts = "

License site saved successfully.

"; this._confirmService.activate("License site saved successfully.", "alertMsg"); - // this.modalRef = this.modalService.show(template); } } @@ -504,15 +548,20 @@ export class SiteLicenseAccount implements OnInit { this.modalRef.hide(); this.alerts = ''; if(this.alerts == ''){ - var obj = this.licenseSite; - obj.LicenseId = this.license.LicenseId; - return this.licenseService.DeleteSiteAccount(obj) + if(this.selectedRow > -1){ + var siteId = this.lstLicenseSites[this.selectedRow].Id; + var LicenseId = this.license.LicenseId; + var SiteUserId = this.license.SiteUserId; + return this.licenseService.DeleteSiteAccount({siteId:siteId,LicenseId:LicenseId,SiteUserId:SiteUserId}) .subscribe( data => (this.AfterDeleteData(data, template)), error => { this.error = error; this.alerts = "" + this.error + ""; }); + + } + } } @@ -545,34 +594,22 @@ export class SiteLicenseAccount implements OnInit { if (this.lstCountry.find(C => C.Id == this.license.CountryId).CountryName != "United States") { this.license.StateId = this.lstState.find(C => C.StateName == "Other").Id; this.insertUpdateSiteLicenseFrm.controls['stateId'].setValue(this.license.StateId); - // this.insertUpdateSiteLicenseFrm.controls['phone'].clearValidators(); - // this.insertUpdateSiteLicenseFrm.controls['phone'].setValidators([Validators.required,this.noWhitespaceValidator]); } else { this.license.StateId = 0; this.insertUpdateSiteLicenseFrm.controls['stateId'].setValue(this.license.StateId); - // this.insertUpdateSiteLicenseFrm.controls['phone'].clearValidators(); - // this.insertUpdateSiteLicenseFrm.controls['phone'].setValidators([Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$'),this.noWhitespaceValidator]); - } - // this.insertUpdateSiteLicenseFrm.controls['phone'].updateValueAndValidity(); + } } OnStateChange(element: any) { this.license.StateId = parseInt(element.value); if (this.lstState.find(C => C.Id == this.license.StateId).StateName != "Other") { this.license.CountryId = this.lstCountry.find(C => C.CountryName == "United States").Id; - this.insertUpdateSiteLicenseFrm.controls['countryId'].setValue(this.license.CountryId); - // this.insertUpdateSiteLicenseFrm.controls['phone'].clearValidators(); - // this.insertUpdateSiteLicenseFrm.controls['phone'].setValidators([Validators.required, Validators.pattern('^([0-9]{3})-([0-9]{3})-([0-9]{4})$'),this.noWhitespaceValidator]); - } + this.insertUpdateSiteLicenseFrm.controls['countryId'].setValue(this.license.CountryId); + } else { this.license.CountryId = 0; - this.insertUpdateSiteLicenseFrm.controls['countryId'].setValue(this.license.CountryId); - // this.insertUpdateSiteLicenseFrm.controls['phone'].clearValidators(); - // this.insertUpdateSiteLicenseFrm.controls['phone'].setValidators([Validators.required,this.noWhitespaceValidator]); } - // this.insertUpdateSiteLicenseFrm.controls['phone'].updateValueAndValidity(); - } EditLicenseSite(){ @@ -585,6 +622,6 @@ export class SiteLicenseAccount implements OnInit { CancelAddEdit(){ this.mode = 'Search'; this.topPos = '2000px'; - this.GetLicenseSites(this.pageNo + ', ' + this.pageLength); + this.GetLicenseSitesList(); } } diff --git a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.html b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.html index ceddb41..776a2b1 100644 --- a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.html +++ b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.html @@ -67,7 +67,6 @@ -
Discount start date requires date in mm/dd/yyyy format
@@ -88,7 +87,6 @@ -
Discount end date requires date in mm/dd/yyyy format
@@ -103,7 +101,7 @@
- +
@@ -113,14 +111,14 @@
-
Site UrlSite Url ToAccount NameInstitution NameDepartment NameClient AdminClient Admin Email IDOriginal Entry DateLast Modified DateSite UrlSite Url ToAccount NameInstitution NameDepartment NameClient AdminClient Admin Email IDOriginal Entry DateLast Modified Date
+
- - - - - + + + + + diff --git a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts index c776af0..c59d863 100644 --- a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts @@ -55,6 +55,15 @@ pageLength: number; // Declare height and width variables scrHeight:any; scrWidth:any; + SearchField:any={ + discountCode:'', + startDate:'', + endDate:'', + sortColumn:'Id', + sortOrder:'asc', + pageNo:1, + pageLength:10 + } @HostListener('window:resize', ['$event']) getScreenSize(event?) { @@ -66,6 +75,9 @@ getScreenSize(event?) { { this.scrHeight = window.innerHeight-350; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private manageDiscountCodeService: ManageDiscountCodeService, private router: Router, @@ -91,7 +103,7 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat discountCode: [''], startDate: ['', Validators.required], endDate: ['', Validators.required], - percentage: ['', [Validators.required, Validators.pattern('[0-9.]*')]], + percentage: ['', [Validators.required, Validators.pattern('[0-9.]*'),Validators.min(0),Validators.max(100)]], isActive: ['true'] }); $('#fixed_hdr2').fxdHdrCol({ @@ -114,15 +126,30 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat this.NoRecord = this.global.NoRecords; this.recordCount = 0; this.pagerComponent = new PagerComponent(); - - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } public SetClickedRow(i: number, item: any) { @@ -235,32 +262,43 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat } } + SortTableRecords(fieldName:string,sortType:string) { + this.selectedRow = -1; + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetDiscountCodeList(); + } + + GetDiscountCodeList() { + this._loadingService.ShowLoading("global-loading"); + this.manageDiscountCodeService.GetDiscountCodes(this.SearchField) + .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + + } + public SearchDiscountCodes(evt: any) { - if (this.global.ValidationMsg != '') { - this.Searchalerts = this.global.ValidationMsg - } - if (this.alerts != '' && this.Searchalerts != '') return; - this.global.compareTwoDates(this.manageDiscountCodeFrm.controls['searchEndDate'].value, this.manageDiscountCodeFrm.controls['searchStartDate'].value); - this._loadingService.ShowLoading("global-loading"); + var tempArr = evt.split(','); this.pageNo = parseInt(tempArr[0]); this.pageLength = parseInt(tempArr[1]); - this._loadingService.ShowLoading("global-loading"); - this.manageDiscountCodeService.GetDiscountCodes( - { - discountCode: this.manageDiscountCodeFrm.controls['searchDiscountCode'].value, - startDate: this.datePipe.transform(this.manageDiscountCodeFrm.controls['searchStartDate'].value, 'MM/dd/yyyy'), - endDate: this.datePipe.transform(this.manageDiscountCodeFrm.controls['searchEndDate'].value, 'MM/dd/yyyy'), - pageNo: this.pageNo, - pageLength: this.pageLength - }) - .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetDiscountCodeList(); + } SearchRecords() { - this.selectedRow = -1; - this.selectedId = -1; - this.SearchDiscountCodes('1, ' + this.pageLength); + this.selectedRow = -1; + this.pageNo=1; + this.SearchField.discountCode=this.manageDiscountCodeFrm.controls['searchDiscountCode'].value; + this.SearchField.startDate=this.manageDiscountCodeFrm.controls['searchStartDate'].value; + this.SearchField.endDate=this.manageDiscountCodeFrm.controls['searchEndDate'].value; + + this.SearchField.pageNo=this.pageNo; + + this.GetDiscountCodeList(); } openModal(template: TemplateRef) { @@ -276,11 +314,15 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat Date.parse(this.insertUpdateDiscountCodeFrm.controls['endDate'].value)){ this.alerts += 'Discount start date must be lower than discount end date'; } + if (this.insertUpdateDiscountCodeFrm.valid && this.alerts == '') { + this._loadingService.ShowLoading("global-loading"); this.manageDiscountCodeService.GetDiscountCodes( { discountCode: this.insertUpdateDiscountCodeFrm.controls['discountCode'].value, - startDate: this.datePipe.transform('1/1/1', 'MM/dd/yyyy'), - endDate: this.datePipe.transform('1/1/9999', 'MM/dd/yyyy'), + startDate: '', + endDate: '', + sortColumn:'Id', + sortOrder:'asc', pageNo: 1, pageLength: 5 }) @@ -290,6 +332,7 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat if(obj.discountId == 0){ if(x.RecordCount > 0){ this.alerts += 'Discount code already exists. Enter a different code.'; + this._loadingService.HideLoading("global-loading"); } if(this.alerts == ''){ return this.manageDiscountCodeService.InsertDiscountCode(obj) @@ -301,6 +344,7 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat else{ if(x.RecordCount > 0 && obj.discountId != x.DiscountCodeList[0].Id){ this.alerts += 'Discount code already exists. Enter a different code.'; + this._loadingService.HideLoading("global-loading"); } if(this.alerts == ''){ return this.manageDiscountCodeService.UpdateDiscountCode(obj) @@ -309,8 +353,12 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat error => this.error = error); } } + + }, error => this.error = error); - } + + } + } AfterInsertData(data, template) { if (data.Status == "false") { @@ -321,6 +369,7 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat //this.modalAlerts = "

Discount code saved successfully

"; //this.modalRef = this.modalService.show(template); } + this._loadingService.HideLoading("global-loading"); } AfterUpdateData(data, template) { @@ -332,6 +381,7 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat //this.modalAlerts = "

Discount code updated successfully

"; //this.modalRef = this.modalService.show(template); } + this._loadingService.HideLoading("global-loading"); } AddDiscountCode(){ @@ -370,7 +420,7 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat this.Mode = 'Manage'; this.topPos = '2000px'; this.divClass = 'col-sm-12'; - this.SearchDiscountCodes(this.pageNo + ', ' + this.pageLength); + this.GetDiscountCodeList();; } } diff --git a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts index f7f7c10..6c11cd6 100644 --- a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts +++ b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts @@ -5,11 +5,13 @@ import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; import 'rxjs/add/observable/throw'; import 'rxjs/add/operator/do'; +import { DatePipe } from '@angular/common'; import { Observable } from 'rxjs/Observable'; import { GlobalService } from '../../shared/global'; @Injectable() export class ManageDiscountCodeService { + datePipe: DatePipe = new DatePipe('en-US'); constructor(private http: Http, public commonService:GlobalService ) { } @@ -20,8 +22,19 @@ export class ManageDiscountCodeService { if (obj.endDate == '' || obj.endDate == null) { obj.endDate = '1/1/9999'; } + obj.startDate = this.datePipe.transform(obj.startDate, 'MM/dd/yyyy'); + obj.endDate = this.datePipe.transform(obj.endDate, 'MM/dd/yyyy'); + return this.http.get(this.commonService.resourceBaseUrl + "DiscountCode/GetDiscountCodes?discountCode=" - + obj.discountCode + "&startDate=" + obj.startDate + "&endDate=" + obj.endDate + "&pageNo=" + obj.pageNo + "&pageLength=" + obj.pageLength) + + obj.discountCode + + "&startDate=" + obj.startDate + + "&endDate=" + obj.endDate + + "&endDate=" + obj.endDate + + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength + ) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html index c8a857b..8b2e075 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html @@ -120,27 +120,6 @@
- - -
@@ -152,25 +131,25 @@
-
Discount CodePercentageDiscount Start DateDiscount End DateStatusDiscount CodePercentageDiscount Start DateDiscount End DateStatus
+
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -179,22 +158,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
Account NumberLicensee NameLicense TypeAccount TypeEditionEmail IDStatusStart DateEnd DatePriceZipState(only U.S.)CountryInstitution NameOriginal Entry DateCredit Card NumberAccount NumberLicensee NameLicense TypeAccount TypeEditionEmail IDStatusStart DateEnd DatePriceZipStateCountryInstitution NameOrg. Entry DateCard Number
{{csr.AccountNumber}}{{csr.LicenseeName}}{{csr.LicenseType}}{{csr.AccountType}}{{csr.Edition}}{{csr.Email}}{{csr.LicenseStatus}}{{csr.StartDate}}{{csr.EndDate}}{{csr.Price | number:'1.2'}}{{csr.LicenseZip}}{{csr.LicenseState}}{{csr.LicenseCountry}}{{csr.InstitutionName}}{{csr.LicenseCreationDate}}{{csr.CardNumber}}{{csr.AccountNumber}}{{csr.LicenseeName}}{{csr.LicenseType}}{{csr.AccountType}}{{csr.Edition}}{{csr.Email}}{{csr.LicenseStatus}}{{csr.StartDate | date: 'MM/dd/yyyy'}}{{csr.EndDate | date: 'MM/dd/yyyy'}}{{csr.Price | number:'1.2'}}{{csr.LicenseZip}}{{csr.LicenseState}}{{csr.LicenseCountry}}{{csr.InstitutionName}}{{csr.LicenseCreationDate | date: 'MM/dd/yyyy'}}{{csr.CardNumber}}
diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts index 762050b..a929d23 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts @@ -32,11 +32,8 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked { public lstAccountType: any; CustomerSummaryReportForm: FormGroup; CustomerSummaryReports: CustomerSummaryReports[]; - numberOfCustomerSummaryReport: number; - limit: number; page: number = 1; error; - CustomerSummaryReport = new CustomerSummaryReports(); modalAlerts: string; divClass: string = ''; topPos: string = '2000px'; @@ -56,8 +53,25 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked { pageNo: number; pageLength: number; // Declare height and width variables - scrHeight:any; - scrWidth:any; + scrHeight:any; + scrWidth:any; + actualPageNo: number; + actualPageLength: number; + SearchField:any={ + sLicenseeName:'', + sLicenseType:0, + sAccountNumber:'', + sAccountType:0, + sZip:'', + sSubscriptionStart:0, + sSubscriptionEnd:-1, + iState:0, + iCountry:0, + sortColumn:'AccountNumber', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; @HostListener('window:resize', ['$event']) getScreenSize(event?) { @@ -69,6 +83,9 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked { { this.scrHeight = window.innerHeight-480; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, @@ -78,7 +95,6 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked { this.ExportingStart = false; this.buttonStatus = false; this.NoRecord = this.global.NoRecords; - let CustomerSummaryReport = new CustomerSummaryReports(); this.previousdate.setDate(this.previousdate.getDate()); this.CustomerSummaryReportForm = this.fb.group({ sLicenseeName: [''], @@ -87,7 +103,7 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked { sAccountNumber: [''], sAccountType: [0], iState: [0], - sSubscriptionStart: [0.00], + sSubscriptionStart: [''], sSubscriptionEnd: [''], iCountry: [0] }); @@ -106,37 +122,50 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked { width: "100%", height: this.scrHeight, colModal: [ - { width: 150, align: 'center' }, + { width: 140, align: 'center' }, { width: 200, align: 'center' }, { width: 150, align: 'Center' }, { width: 150, align: 'Center' }, { width: 150, align: 'Center' }, - { width: 150, align: 'Center' }, - { width: 150, align: 'Center' }, - { width: 150, align: 'center' }, - { width: 150, align: 'Center' }, - { width: 150, align: 'center' }, + { width: 170, align: 'Center' }, + { width: 100, align: 'Center' }, + { width: 130, align: 'center' }, + { width: 130, align: 'Center' }, + { width: 110, align: 'center' }, + { width: 100, align: 'center' }, + { width: 120, align: 'center' }, + { width: 130, align: 'center' }, { width: 150, align: 'center' }, - { width: 150, align: 'center' }, - { width: 150, align: 'center' }, - { width: 150, align: 'center' }, - { width: 200, align: 'center' }, - { width: 200, align: 'Center' }, - //{ width: 400, align: 'Center' }, - //{ width: 150, align: 'center' }, - //{ width: 110, align: 'center' }, + { width: 130, align: 'center' }, + { width: 110, align: 'Center' } + ], sort: true }); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } - + + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } ngAfterViewChecked() { $('#fixed_hdr2 thead').css('width', $('#fixed_hdr2 tbody tr:eq(0)').width()); @@ -156,34 +185,75 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked { this.reportservice.GetAccountType().subscribe(st => { this.lstAccountType = st; }, error => this.error = error); } + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetCustomerSummeryList(); + } + GetCustomerSummeryReport(evt: any) { - this._loadingService.ShowLoading("global-loading"); - var tempArr = evt.split(','); - this.pageNo = parseInt(tempArr[0]); - var actulalength=this.pageLength; + this.actualPageNo = this.pageNo; + this.actualPageLength =this.pageLength; + + var tempArr = evt.split(','); + this.pageNo = parseInt(tempArr[0]); this.pageLength = parseInt(tempArr[1]); - this.CustomerSummaryReport = this.CustomerSummaryReportForm.value; - var obj = this.CustomerSummaryReport; - if (this.ExportingStart) { - this.reportservice.GetCustomerSummeryReport(obj, this.pageNo, this.pageLength).subscribe((CustomerSummaryReports: CustomerSummaryReports[]) => { - //reset length after csvexport - this.pageLength=actulalength; - this.ExportService(CustomerSummaryReports); }, error => this.error = error); + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetCustomerSummeryList(); + } + + GetCustomerSummeryList() { + this._loadingService.ShowLoading("global-loading"); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (this.SearchField.sortOrder=='asc') { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } else + { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } + + if (this.ExportingStart) { + this.reportservice.GetCustomerSummeryReport(this.SearchField).subscribe((CustomerSummaryReports: CustomerSummaryReports[]) => { + //reset length after csvexport + this.pageNo = this.actualPageNo; + this.pageLength=this.actualPageLength; + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + this.ExportService(CustomerSummaryReports); }, error => this.error = error); } else { - this.reportservice.GetCustomerSummeryReport(obj, this.pageNo, this.pageLength).subscribe((CustomerSummaryReports: CustomerSummaryReports[]) => { this.BindFormFields(CustomerSummaryReports); }, error => this.error = error); + this.reportservice.GetCustomerSummeryReport(this.SearchField).subscribe((CustomerSummaryReports: CustomerSummaryReports[]) => { this.BindFormFields(CustomerSummaryReports); }, error => this.error = error); } - - } + + this.ExportingStart = false; + } + SearchRecords() { this.ExportingStart = false; - this.GetCustomerSummeryReport('1, ' + this.pageLength); + this.pageNo=1; + this.SearchField.sLicenseeName=this.CustomerSummaryReportForm.controls['sLicenseeName'].value; + this.SearchField.sLicenseType=this.CustomerSummaryReportForm.controls['sLicenseType'].value; + this.SearchField.sAccountNumber=this.CustomerSummaryReportForm.controls['sAccountNumber'].value; + this.SearchField.sAccountType=this.CustomerSummaryReportForm.controls['sAccountType'].value; + this.SearchField.sZip=this.CustomerSummaryReportForm.controls['sZip'].value; + this.SearchField.sSubscriptionStart=this.CustomerSummaryReportForm.controls['sSubscriptionStart'].value; + this.SearchField.sSubscriptionEnd=this.CustomerSummaryReportForm.controls['sSubscriptionEnd'].value; + this.SearchField.iState=this.CustomerSummaryReportForm.controls['iState'].value; + this.SearchField.iCountry=this.CustomerSummaryReportForm.controls['iCountry'].value; + this.SearchField.pageNo=this.pageNo; + + this.GetCustomerSummeryList(); + } BindFormFields(data) { this.recordCount = data.RecordCount; this.lstCustomerSummaryReport = data.CustomerSummery; - this.numberOfCustomerSummaryReport = this.lstCustomerSummaryReport.length; this.limit = this.lstCustomerSummaryReport.length; if (this.lstCustomerSummaryReport.length > 0) { this.NoRecord = ''; this.buttonStatus = true; @@ -199,17 +269,19 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked { if (this.buttonStatus) { this.ExportingStart = true; this.GetCustomerSummeryReport('1, ' + this.recordCount); - this.ExportingStart = false; } } ExportService(data: any) { - for (let c = 0; c < this.global.RemoveColumns.length; c++) { - for (let i = 0; i < data.CustomerSummery.length; i++) { - delete data.CustomerSummery[i][this.global.RemoveColumns[c].toString()]; - } - } + for (let i = 0; i < data.CustomerSummery.length; i++) { + data.CustomerSummery[i]['StartDate']= this.datePipe.transform(data.CustomerSummery[i]['StartDate'], 'MM/dd/yyyy'); + data.CustomerSummery[i]['EndDate']= this.datePipe.transform(data.CustomerSummery[i]['EndDate'], 'MM/dd/yyyy'); + data.CustomerSummery[i]['LicenseCreationDate']= this.datePipe.transform(data.CustomerSummery[i]['LicenseCreationDate'], 'MM/dd/yyyy'); + } + + var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() + this.global.ExportToCSV(data.CustomerSummery, "CustomerSummeryReport-"+reportname); + this._loadingService.HideLoading("global-loading"); - this.global.ExportToCSV(data.CustomerSummery, "CustomerSummeryReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds()) } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html index 1f036dd..d6b0367 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html @@ -141,27 +141,6 @@
- - -
@@ -173,9 +152,6 @@
- diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html index 73430a1..9185181 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html @@ -17,11 +17,11 @@
- +
-
- +
+ @@ -37,11 +37,11 @@
- +
-
- +
+ @@ -74,31 +74,29 @@
- +
- -

-
+
- - - - - - - - - + + + + + + + + + diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts index e956f80..ff42e16 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts @@ -32,7 +32,6 @@ export class ImageExportReport implements OnInit { limit: number; page: number = 1; error; - imageexportreport = new ImageExportReports(); modalAlerts: string; divClass: string = ''; topPos: string = '2000px'; @@ -56,6 +55,17 @@ export class ImageExportReport implements OnInit { // Declare height and width variables scrHeight:any; scrWidth:any; + actualPageNo: number; + actualPageLength: number; + SearchField:any={ + sFromDate:new Date(), + sToDate:new Date(), + sAccountNumber:'', + sortColumn:'LicenseId', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; @HostListener('window:resize', ['$event']) getScreenSize(event?) { @@ -67,6 +77,9 @@ export class ImageExportReport implements OnInit { { this.scrHeight = window.innerHeight-385; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, @@ -78,11 +91,10 @@ export class ImageExportReport implements OnInit { this.ExportingStart = false; this.bsConfig = Object.assign({}, { containerClass: 'theme-dark-blue' }); this.NoRecord = this.global.NoRecords; - let imageexportreport = new ImageExportReports(); this.previousdate.setDate(this.previousdate.getDate()); this.ImageExportReportForm = this.fb.group({ - sFromDate: [this.previousdate], - sToDate: [this.date], + sFromDate: [this.previousdate,[Validators.required]], + sToDate: [this.date,[Validators.required]], sAccountNumber: [''] }); this.alerts = ''; @@ -109,53 +121,107 @@ export class ImageExportReport implements OnInit { this.NoRecord = this.global.NoRecords; this.recordCount = 0; this.pagerComponent = new PagerComponent(); - - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } + + FromDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(this.ImageExportReportForm.controls['sToDate'].value, dateValue._bsValue); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + ToDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(dateValue._bsValue, this.ImageExportReportForm.controls['sFromDate'].value); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetImageExportReportList(); + } + GetImageExportReport(evt: any) { - var tempArr = evt.split(','); + this.actualPageNo = this.pageNo; + this.actualPageLength =this.pageLength; + + var tempArr = evt.split(','); this.pageNo = parseInt(tempArr[0]); - var actulalength=this.pageLength; this.pageLength = parseInt(tempArr[1]); - this.alerts = ''; - this.global.compareTwoDates(this.ImageExportReportForm.controls['sToDate'].value, this.ImageExportReportForm.controls['sFromDate'].value); - if (this.global.ValidationMsg != '') { - this.alerts = this.global.ValidationMsg - } - if (this.alerts == '') { - this._loadingService.ShowLoading("global-loading"); - this.imageexportreport = this.ImageExportReportForm.value; - var obj = this.imageexportreport; - if (this.ExportingStart) { - this.reportservice.GetImageExportReport(obj, this.pageNo, this.pageLength).subscribe((ImageExportReports: ImageExportReports[]) => { - //reset length after csvexport - this.pageLength=actulalength; - this.ExportService(ImageExportReports); }, error => this.error = error); - } - else { - this.reportservice.GetImageExportReport(obj, this.pageNo, this.pageLength).subscribe((ImageExportReports: ImageExportReports[]) => { this.BindFormFields(ImageExportReports); }, error => this.error = error); - } - } + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetImageExportReportList(); + + } + + GetImageExportReportList() { + this._loadingService.ShowLoading("global-loading"); + + if (this.ExportingStart) { + this.reportservice.GetImageExportReport(this.SearchField).subscribe((ImageExportReports: ImageExportReports[]) => { + //reset length after csvexport + this.pageNo = this.actualPageNo; + this.pageLength=this.actualPageLength; + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.ExportService(ImageExportReports); }, error => this.error = error); + } + else { + this.reportservice.GetImageExportReport(this.SearchField).subscribe((ImageExportReports: ImageExportReports[]) => { this.BindFormFields(ImageExportReports); }, error => this.error = error); + } + + this.ExportingStart = false; } + SearchRecords() { - this.ExportingStart = false; - this.GetImageExportReport('1, ' + this.pageLength); + this.ExportingStart = false; + this.pageNo=1; + this.SearchField.sFromDate=this.ImageExportReportForm.controls['sFromDate'].value; + this.SearchField.sToDate=this.ImageExportReportForm.controls['sToDate'].value; + this.SearchField.sAccountNumber=this.ImageExportReportForm.controls['sAccountNumber'].value; + this.SearchField.pageNo=this.pageNo; + + this.GetImageExportReportList(); } BindFormFields(data) { this.recordCount = data.RecordCount; - this.lstImageExportReport = data.ImageExportList; - //this.numberOfImageExportReport = this.lstImageExportReport.length; - //this.limit = this.lstImageExportReport.length; + this.lstImageExportReport = data.ImageExportList; if (this.lstImageExportReport.length > 0) { this.NoRecord = ''; this.buttonStatus = true; @@ -171,20 +237,20 @@ export class ImageExportReport implements OnInit { ExportEvent() { if (this.buttonStatus) { this.ExportingStart = true; - this.GetImageExportReport('1, ' + this.recordCount); - this.ExportingStart = false; + this.GetImageExportReport('1, ' + this.recordCount); } } - ExportService(data: any) { - for (let c = 0; c < this.global.RemoveColumns.length; c++) { - for (let i = 0; i < data.ImageExportList.length; i++) { - delete data.ImageExportList[i][this.global.RemoveColumns[c].toString()]; - } - } - this._loadingService.HideLoading("global-loading"); - this.global.ExportToCSV(data.ImageExportList, "ImageExportReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds()) - + ExportService(data: any) { + for (let i = 0; i < data.ImageExportList.length; i++) { + data.ImageExportList[i]['ExportedDate']= this.datePipe.transform(data.ImageExportList[i]['ExportedDate'], 'MM/dd/yyyy'); + } + + var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() + this.global.ExportToCSV(data.ImageExportList, "UsageReport-"+reportname); + + this._loadingService.HideLoading("global-loading"); + } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts b/400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts index ad9aa18..7cd317c 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts @@ -53,11 +53,11 @@ export class ReportService { .catch((res: Response) => this.handleError(res)); } - GetUsageReport(obj: any, pageNo: number, pageLength: number) { - if (obj.sFromDate == '') { + GetUsageReport(obj: any) { + if (obj.sFromDate == '' || obj.sFromDate == null) { obj.sFromDate = '1/1/1'; } - if (obj.sToDate == '') { + if (obj.sToDate == '' || obj.sToDate == null) { obj.sToDate = '1/1/9999'; } obj.sFromDate = this.datePipe.transform(obj.sFromDate, 'MM/dd/yyyy'); @@ -69,14 +69,16 @@ export class ReportService { "&sZip=" + obj.sZip + "&iState=" + obj.iState + "&iCountry=" + obj.iCountry + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength) + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } - GetCustomerSummeryReport(obj: any, pageNo: number, pageLength: number) { + GetCustomerSummeryReport(obj: any) { if (obj.sSubscriptionStart == undefined || obj.sSubscriptionStart === '') obj.sSubscriptionStart = -1; if (obj.sSubscriptionEnd == undefined || obj.sSubscriptionEnd === '') @@ -91,8 +93,10 @@ export class ReportService { "&sZip=" + obj.sZip + "&iState=" + obj.iState + "&iCountry=" + obj.iCountry + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength) + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } @@ -261,11 +265,11 @@ export class ReportService { } - GetImageExportReport(obj: any, pageNo: number, pageLength: number) { - if (obj.sFromDate == '') { + GetImageExportReport(obj: any) { + if (obj.sFromDate == '' || obj.sFromDate == null) { obj.sFromDate = '1/1/1'; } - if (obj.sToDate == '') { + if (obj.sToDate == '' || obj.sToDate == null) { obj.sToDate = '1/1/9999'; } obj.sFromDate = this.datePipe.transform(obj.sFromDate, 'MM/dd/yyyy'); @@ -277,8 +281,10 @@ export class ReportService { return this.http.get(this.commonService.resourceBaseUrl + "Report/GetImageExportReport?sFromDate=" + obj.sFromDate + "&sToDate=" + obj.sToDate + "&sAccountNumber=" + obj.sAccountNumber + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength) + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/reportdatamodel.ts b/400-SOURCECODE/Admin/src/app/components/Reports/reportdatamodel.ts index 4b3e22d..bba96ba 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/reportdatamodel.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/reportdatamodel.ts @@ -12,7 +12,7 @@ export class UsageReports { LicenseZip: string; LicenseCountry: string; TotalLogins: number; - LastLoginDate: string; + LastLogin: string; } export class CustomerSummaryReports { @@ -110,14 +110,13 @@ export class DiscountCodeReports { } export class ImageExportReports { - LicenseId: number; - ExportedDate: string; + Title: string; ImageName: string; + OriginalFileName: string; + ModuleName: string; + ExportedDate: string; AccountNumber: string; - OriginalFileName: string; - Title: string; - ModuleName: string; - UserName: string; + UserName: string; ExportLimit: string; imageCount: number; diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html index 8e62b0f..7fa4150 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html @@ -135,27 +135,6 @@
- - -
diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html index 05fe9e0..9c2e6d4 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html @@ -22,11 +22,12 @@
- +
-
- +
+ @@ -38,11 +39,12 @@
- +
-
- +
+ @@ -106,7 +108,7 @@
- + -
-
-
- +
+
+
@@ -139,49 +140,46 @@
- -
TitleImage NameOriginal NameModuleExported DateAccount NumberUser NameExport LimitNumber of export imageTitleImage NameOriginal NameModuleExported DateAccount NumberUser NameExport LimitNo. of export image
- - - - - - - - - - - - - - - - - - - +
User NameFirst NameLast NameAccount NumberInstitution NameCredit Card NumberUser TypeZipState(only U.S.)CountryTotal LoginOriginal Entry DateLast Login Date
+ + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - -
User NameFirst NameLast NameAccount NumberInstitution NameCard NumberUser TypeZipState(only U.S.)CountryTotal LoginOrg. Entry DateLast Login Date
{{usage.LoginId}}{{usage.FirstName}}{{usage.LastName}}{{usage.AccountNumber}}{{usage.InstitutionName}}{{usage.CardNumber}}{{usage.UserType}}{{usage.LicenseZip}}{{usage.LicenseState}}{{usage.LicenseCountry}}{{usage.TotalLogins}}{{usage.LicenseCreationDate}}{{usage.LastLogin}}
+ + + + {{usage.LoginId}} + {{usage.FirstName}} + {{usage.LastName}} + {{usage.AccountNumber}} + {{usage.InstitutionName}} + {{usage.CardNumber}} + {{usage.UserType}} + {{usage.LicenseZip}} + {{usage.LicenseState}} + {{usage.LicenseCountry}} + {{usage.TotalLogins}} + {{usage.LicenseCreationDate | date: 'MM/dd/yyyy'}} + {{usage.LastLogin | date: 'MM/dd/yyyy'}} + + +
diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts index b38afed..ced699f 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts @@ -37,7 +37,6 @@ export class UsageReport implements OnInit, AfterViewChecked { limit: number; page: number = 1; error; - usagereport = new UsageReports(); modalAlerts: string; divClass: string = ''; topPos: string = '2000px'; @@ -58,76 +57,20 @@ export class UsageReport implements OnInit, AfterViewChecked { recordCount: number; pageNo: number; pageLength: number; + actualPageNo: number; + actualPageLength: number; DisableAccountNumberControl: boolean; - //Smart Table Setting - settings = { - actions: { add: false, edit: false, delete: false }, - pager: { - display: true, - perPage: 50 - }, - attr: { - class: 'table table-condensed table-bordered table-striped table-hover' - }, - columns: { - LoginId: { - title: 'User Name', - width: '140px', - }, - FirstName: { - title: 'First Name', - width: '140px' - }, - LastName: { - title: 'Last Name', - width: '140px' - }, - AccountNumber: { - title: 'Account Number', - width: '140px' - }, - InstitutionName: { - title: 'Institution Name', - width: '140px' - }, - CardNumber: { - title: 'Credit Card Number', - width: '140px' - } - , - UserType: { - title: 'User Type', - width: '140px' - }, - Zip: { - title: 'Zip', - width: '140px' - }, - LicenseState: { - title: 'State(only U.S.)', - width: '140px' - } - , - LicenseCountry: { - title: 'Country', - width: '140px' - } - , - TotalLogins: { - title: 'Total Login', - width: '140px' - }, - LicenseCreationDate: { - title: 'Original Entry Date', - width: '140px' - }, - LastLogin: { - title: 'Last Login Date', - width: '140px' - } - - - } + SearchField:any={ + sFromDate:new Date(), + sToDate:new Date(), + sAccountNumber:'', + sZip:'', + iState:0, + iCountry:0, + sortColumn:'AccountNumber', + sortOrder:'asc', + pageNo:1, + pageLength:10 }; // Declare height and width variables @@ -144,6 +87,9 @@ export class UsageReport implements OnInit, AfterViewChecked { { this.scrHeight = window.innerHeight-440; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, @@ -156,11 +102,10 @@ export class UsageReport implements OnInit, AfterViewChecked { this.buttonStatus = false; this.bsConfig = Object.assign({}, { containerClass: 'theme-dark-blue' }); this.NoRecord = this.global.NoRecords; - let usagereport = new UsageReports(); this.previousdate.setDate(this.previousdate.getDate()); this.UsageReportForm = this.fb.group({ - sFromDate: [this.previousdate], - sToDate: [this.date], + sFromDate: [this.previousdate,[Validators.required]], + sToDate: [this.date,[Validators.required]], sAccountNumber: [''], sZip: [''], iState: [0], @@ -178,75 +123,140 @@ export class UsageReport implements OnInit, AfterViewChecked { this.pageNo = 0; this.pageLength = 10; this.pagerComponent = new PagerComponent(); - this.GetUsageReport('1, ' + this.pageLength); + $('#fixed_hdr2').fxdHdrCol({ fixedCols: 0, width: "100%", height: this.scrHeight, colModal: [ - { width: 150, align: 'center' }, - { width: 150, align: 'center' }, - { width: 150, align: 'Center' }, - { width: 150, align: 'Center' }, - { width: 300, align: 'Center' }, - { width: 150, align: 'Center' }, + { width: 140, align: 'center' }, + { width: 140, align: 'center' }, + { width: 140, align: 'Center' }, + { width: 140, align: 'Center' }, + { width: 200, align: 'Center' }, + { width: 120, align: 'Center' }, { width: 130, align: 'Center' }, - { width: 120, align: 'center' }, + { width: 90, align: 'center' }, { width: 150, align: 'Center' }, { width: 140, align: 'center' }, { width: 100, align: 'center' }, - { width: 150, align: 'center' }, - { width: 120, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 180, align: 'Center' }, - // { width: 400, align: 'Center' }, - // { width: 150, align: 'center' }, - // { width: 110, align: 'center' }, + { width: 130, align: 'center' }, + { width: 130, align: 'center' }, + ], sort: true }); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } - GetUsageReport(evt: any) { - var tempArr = evt.split(','); - this.pageNo = parseInt(tempArr[0]); - var actulalength=this.pageLength; - this.pageLength = parseInt(tempArr[1]); - this.alerts = ''; - this.global.compareTwoDates(this.UsageReportForm.controls['sToDate'].value, this.UsageReportForm.controls['sFromDate'].value); + + FromDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(this.UsageReportForm.controls['sToDate'].value, dateValue._bsValue); if (this.global.ValidationMsg != '') { - this.alerts = this.global.ValidationMsg - } - if (this.alerts == '') { - this._loadingService.ShowLoading("global-loading"); - this.usagereport = this.UsageReportForm.value; - var obj = this.usagereport; - if (this.ExportingStart) { - this.reportservice.GetUsageReport(obj,this.pageNo, this.pageLength).subscribe((UsageReports: UsageReports[]) => { - //reset length after csvexport - this.pageLength=actulalength; - this.ExportService(UsageReports); }, error => this.error = error); - } - else { - this.reportservice.GetUsageReport(obj, this.pageNo, this.pageLength).subscribe((UsageReports: UsageReports[]) => { this.BindFormFields(UsageReports); }, error => this.error = error); - } - - } + this.alerts = this.global.ValidationMsg; + } + } + ToDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(dateValue._bsValue, this.UsageReportForm.controls['sFromDate'].value); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetUsageReportList(); + } + + GetUsageReport(evt: any) { + this.actualPageNo = this.pageNo; + this.actualPageLength =this.pageLength; + + var tempArr = evt.split(','); + this.pageNo = parseInt(tempArr[0]); + this.pageLength = parseInt(tempArr[1]); + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetUsageReportList(); + } - SearchRecords() { + + GetUsageReportList() { + this._loadingService.ShowLoading("global-loading"); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (this.SearchField.sortOrder=='asc') { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } else + { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } + + if (this.ExportingStart) { + this.reportservice.GetUsageReport(this.SearchField).subscribe((UsageReports: UsageReports[]) => { + //reset length after csvexport + this.pageNo = this.actualPageNo; + this.pageLength=this.actualPageLength; + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.ExportService(UsageReports); }, error => this.error = error); + } + else { + this.reportservice.GetUsageReport(this.SearchField).subscribe((UsageReports: UsageReports[]) => { this.BindFormFields(UsageReports); }, error => this.error = error); + } + + this.ExportingStart = false; + } + + + SearchRecords() { this.ExportingStart = false; - this.GetUsageReport('1, ' + this.pageLength); + this.pageNo=1; + this.SearchField.sFromDate=this.UsageReportForm.controls['sFromDate'].value; + this.SearchField.sToDate=this.UsageReportForm.controls['sToDate'].value; + this.SearchField.sAccountNumber=this.UsageReportForm.controls['sAccountNumber'].value; + this.SearchField.sZip=this.UsageReportForm.controls['sZip'].value; + this.SearchField.iState=this.UsageReportForm.controls['iState'].value; + this.SearchField.iCountry=this.UsageReportForm.controls['iCountry'].value; + + this.SearchField.pageNo=this.pageNo; + + this.GetUsageReportList(); + } + GetCountry() { this.reportservice.GetCountry().subscribe(y => { this.lstCountry = y; }, error => this.error = error); } @@ -275,16 +285,18 @@ export class UsageReport implements OnInit, AfterViewChecked { if (this.buttonStatus) { this.ExportingStart = true; this.GetUsageReport('1,' + this.recordCount); - this.ExportingStart = false; } } ExportService(data: any) { - for (let c = 0; c < this.global.RemoveColumns.length; c++) { - for (let i = 0; i < data.UserUsage.length; i++) { - delete data.UserUsage[i][this.global.RemoveColumns[c].toString()]; - } - } + for (let i = 0; i < data.UserUsage.length; i++) { + data.UserUsage[i]['LicenseCreationDate']= this.datePipe.transform(data.UserUsage[i]['LicenseCreationDate'], 'MM/dd/yyyy'); + data.UserUsage[i]['LastLogin']= this.datePipe.transform(data.UserUsage[i]['LastLogin'], 'MM/dd/yyyy'); + } + + var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() + this.global.ExportToCSV(data.UserUsage, "UsageReport-"+reportname); + this._loadingService.HideLoading("global-loading"); - this.global.ExportToCSV(data.UserUsage, "UsageReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds()) + } } diff --git a/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.html b/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.html index f57ddfd..9e07daa 100644 --- a/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.html +++ b/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.html @@ -70,14 +70,14 @@
- +
- - - - - + + + + + diff --git a/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.ts b/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.ts index 4fd94d4..547cfe7 100644 --- a/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.ts @@ -44,6 +44,13 @@ RecordDeleted: number[]; // Declare height and width variables scrHeight:any; scrWidth:any; + SearchField:any={ + editionId:1, + sortColumn:'Id', + sortOrder:'asc', + pageNo:1, + pageLength:10 + } @HostListener('window:resize', ['$event']) getScreenSize(event?) { @@ -55,6 +62,9 @@ getScreenSize(event?) { { this.scrHeight = window.innerHeight-330; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private subscriptionPriceService: SubscriptionPriceService, private router: Router, @@ -97,15 +107,41 @@ getScreenSize(event?) { this.recordCount = 0; this.pagerComponent = new PagerComponent(); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + // if(document.getElementById("fixed_table_rc") != null){ + // document.getElementById("fixed_table_rc").remove(); + // var testScript = document.createElement("script"); + // testScript.setAttribute("id", "fixed_table_rc"); + // testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); + // testScript.setAttribute("type", "text/javascript"); + // document.body.appendChild(testScript); + // } + + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null && event.currentTarget.id!="unknown") + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + $(".ft_rwrapper table thead tr #unknown").removeClass('fx_sort_bg'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } + public noWhitespaceValidator(control: FormControl) { // new validation for intial whaite space //****Birendra *****/ @@ -134,29 +170,40 @@ getScreenSize(event?) { } + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetPriceList(); + } + public SearchSubscriptionPrices(evt: any) { - if (this.global.ValidationMsg != '') { - this.alerts = this.global.ValidationMsg - } - if (this.alerts != '') return; - this._loadingService.ShowLoading("global-loading"); var tempArr = evt.split(','); this.pageNo = parseInt(tempArr[0]); this.pageLength = parseInt(tempArr[1]); - this._loadingService.ShowLoading("global-loading"); - this.subscriptionPriceService.GetSubscriptionPrices( - { - editionId: this.selectedEditionId, - pageNo: this.pageNo, - pageLength: this.pageLength - }) - .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetPriceList(); + } SearchRecords(searchEditionId: number) { - this.selectedEditionId = searchEditionId; - this.SearchSubscriptionPrices('1, ' + this.pageLength); + this.selectedEditionId = searchEditionId; + this.pageNo=1; + this.SearchField.editionId=this.selectedEditionId; + this.SearchField.pageNo=this.pageNo; + + this.GetPriceList(); } + + GetPriceList() { + this._loadingService.ShowLoading("global-loading"); + $(".ft_rwrapper table thead tr #unknown").removeClass('fx_sort_bg'); + this.subscriptionPriceService.GetSubscriptionPrices(this.SearchField) + .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + + } openModal(template: TemplateRef) { if(this.checkedRecords.filter(C => C > 0).length == 0) return; @@ -174,7 +221,6 @@ getScreenSize(event?) { AfterDeleteData(data, template) { if (data.Status == "false") { - //this.alerts = "Subscription prices delete unsuccessfull"; this._confirmService.activate("Subscription prices delete unsuccessfull", "alertMsg"); } else { this.modalAlerts = "

Subscription prices deleted successfully

"; @@ -185,29 +231,26 @@ getScreenSize(event?) { AfterInsertData(data, template) { if (data.Status == "false") { - // this.alerts = "Subscription price save unsuccessfull"; this.modalAlerts = "

Subscription insert unsuccessfull

"; this.modalRef = this.modalService.show(template); - // this._confirmService.activate("Subscription insert unsuccessfull", "alertMsg"); + this._loadingService.HideLoading("global-loading"); } else { this._confirmService.activate("Subscription saved successfull", "alertMsg"); - //this.modalAlerts = "

Subscriptions saved successfully

"; this.CancelAdd(); - //this.modalRef = this.modalService.show(template); + } + } AfterUpdateData(data, template) { if (data.Status == "false") { this.modalAlerts = "

Subscription prices update unsuccessfull

"; this.modalRef = this.modalService.show(template); - //this.alerts = "Subscription prices update unsuccessfull\n"; - //this._confirmService.activate("Subscription prices update unsuccessfull", "alertMsg"); + } else { this._confirmService.activate("Subscriptions updated successfully", "alertMsg"); - //this.modalAlerts = "

Subscriptions updated successfully

"; - //this.modalRef = this.modalService.show(template); } + this._loadingService.HideLoading("global-loading"); } BindFormFields(data){ @@ -229,10 +272,12 @@ getScreenSize(event?) { console.log(this.subscriptionPriceFrm.value); this.alerts = ''; if(this.alerts == ''){ + this._loadingService.ShowLoading("global-loading"); var obj = this.subscriptionPriceFrm.controls['subscriptionPrices'].value; this.subscriptionPriceService.UpdateSubscriptionPrices(obj).subscribe( data => (this.AfterUpdateData(data, template)), error => { + this._loadingService.HideLoading("global-loading"); this.error = error; this.alerts = "" + this.error + ""; }); @@ -243,6 +288,7 @@ getScreenSize(event?) { console.log(this.insertSubscriptionPriceFrm.value); this.alerts = ''; if(this.alerts == ''){ + this._loadingService.ShowLoading("global-loading"); var obj = this.insertSubscriptionPriceFrm.value; return this.subscriptionPriceService.InsertSubscriptionPrice(obj) .subscribe( @@ -262,6 +308,7 @@ getScreenSize(event?) { var unDeletedSubscriptions = ''; let cnt = 0; if(this.alerts == ''){ + this._loadingService.ShowLoading("global-loading"); this.RecordDeleted = []; this.checkedRecords.filter(C => C > 0).forEach(element => { this.subscriptionPriceService.CheckSubscriptionPlanForLicense(element) diff --git a/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.service.ts b/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.service.ts index e75bc8e..8ba2d3c 100644 --- a/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.service.ts +++ b/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.service.ts @@ -16,7 +16,12 @@ export class SubscriptionPriceService { GetSubscriptionPrices(obj: any) { return this.http.get(this.commonService.resourceBaseUrl + "SubscriptionPrice/GetSubscriptionPrices?editionId=" - + obj.editionId + "&pageNo=" + obj.pageNo + "&pageLength=" + obj.pageLength) + + obj.editionId + + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength + ) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts index b90c10f..16ffe9c 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/datamodel.ts @@ -71,6 +71,7 @@ export class License { MasterSiteUrl: string; SiteUrlFrom: string; SiteUrlTo: string; + SiteUserId: number; LoginId: string; Password: string; SecurityQuestionId: number; diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts index 8753b3f..fdb8fa1 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts @@ -57,7 +57,7 @@ export class UserService { //////////Manage UserLogin Status/////////// ManageUserLoginStatus(obj: any) { var jsonData = { 'userId': obj.userId, 'tagName': obj.tagName,'SessionId': obj.SessionId,'isSiteUser': obj.isSiteUser,'isAdmin': obj.isAdmin }; - console.log(obj); + //console.log(obj); var headers = new Headers({ 'Content-Type': 'application/json' }); @@ -93,7 +93,7 @@ export class UserService { .map(this.extractData) .catch((res: Response) => this.handleError(res)); } - GetUserList(obj: any, pageNo: number, pageLength: number) { + GetUserList(obj: any) { return this.http.get(this.commonService.resourceBaseUrl + "User/Users?firstname=" + obj.FirstName + "&lastname=" + obj.LastName + "&emailid=" + obj.EmailId + @@ -101,8 +101,10 @@ export class UserService { "&usertypeid=" + obj.UserTypeId + "&accounttypeid=" + obj.AccountTypeId + "&userLoginStatus=" + obj.LoginStatus + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength + + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength + "&iLoginUserType=" + this.commonService.UserType + "&loggedIn="+this.commonService.LoginId) @@ -213,16 +215,28 @@ export class UserService { /// End/////// //// User Group//////// - GetLicenseUserGroups(licensId: number, pageNo: number, pageLength: number) { - return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/LicenseUserGroups?LicenseId=" + licensId + "&pageNo=" + pageNo + "&pageLength=" + pageLength) - .map(this.extractData) - .catch((res: Response) => this.handleError(res)); + GetLicenseUserGroups(obj: any) { + return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/LicenseUserGroups?LicenseId=" + obj.LicenseId + + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength + ) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); } - GetLicenseUserGroupUsers(licensId: number, UserGroupId: number, allUsers: boolean, pageNo: number, pageLength: number) { - return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/LicenseUserGroupUsers?LicenseId=" + licensId + "&UserGroupId=" + UserGroupId + "&AllUsers=" + allUsers + "&pageNo=" + pageNo + "&pageLength=" + pageLength) - .map(this.extractData) - .catch((res: Response) => this.handleError(res)); + GetLicenseUserGroupUsers(obj: any) { + return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/LicenseUserGroupUsers?LicenseId=" + obj.LicenseId + + "&UserGroupId=" + obj.selectedId + + "&AllUsers=" + obj.AllUsers + + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength + ) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); } InsertUpdateLicenseUserGroup(obj: any) { //let options = new RequestOptions({ headers: this.headers }); diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.html index 73e3e1c..433f5cb 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.html +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.html @@ -94,14 +94,14 @@
-
-
SelectSubscription TypeDuration(in Month)PriceActiveSelectSubscription TypeDuration(in Month)PriceActive
+
+
- - - - + + + + @@ -151,7 +151,7 @@
- +
User group name is required
@@ -162,16 +162,16 @@
-
-
Group NameNumber of User(s)Created DateLast Modified DateGroup NameNumber of User(s)Created DateLast Modified Date
+
+
- - - - - - + + + + + + @@ -179,15 +179,15 @@ - - - - - - + + + + +
SelectFirst NameLast NameUser IDEmail IDProduct EditionSelectFirst NameLast NameUser IDEmail IDProduct Edition
+ {{item.FirstName}}{{item.LastName}}{{item.UserId}}{{item.EmailId}}{{item.ProductEdition}}{{item.FirstName}}{{item.LastName}}{{item.LoginId}}{{item.EmailId}}{{item.ProductEdition}}
diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.ts index f47495a..992756c 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/usergroup.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, AfterViewInit, AfterViewChecked, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef, ViewChild } from '@angular/core'; +import { Component, OnInit, AfterViewInit, AfterViewChecked, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef, ViewChild,HostListener } from '@angular/core'; import { UserService } from './user.service'; import { Router, ActivatedRoute } from '@angular/router'; import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; @@ -50,10 +50,46 @@ export class UserGroup implements OnInit, AfterViewChecked { pageLengthUser: number; loopIdx: number; userGroupName: string; - + scrHeight:any; + scrWidth:any; + SearchField:any={ + LicenseId:0, + sortColumn:'Id', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; + SearchUserField:any={ + LicenseId:0, + selectedId:0, + AllUsers:false, + sortColumn:'Id', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; + @HostListener('window:resize', ['$event']) + getScreenSize(event?) { + + var $ua = navigator.userAgent; + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { + this.scrHeight = window.innerHeight-500; + } + else + { + this.scrHeight = window.innerHeight-420; + + } + + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); + } constructor(private userService: UserService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder, private modalService: BsModalService, - private _confirmService: ConfirmService, public global: GlobalService, private _loadingService: LoadingService) { } + private _confirmService: ConfirmService, public global: GlobalService, private _loadingService: LoadingService) { + this.getScreenSize(); + } ngOnInit(): void { this._loadingService.ShowLoading("global-loading"); @@ -67,7 +103,6 @@ export class UserGroup implements OnInit, AfterViewChecked { this.loopIdx = 0; this.userGroupName = ''; this.NoRecord = this.global.NoRecords; - this._loadingService.ShowLoading("global-loading"); this.recordCount = 0; this.pageNo = 1; this.pageLength = 10; @@ -97,9 +132,83 @@ export class UserGroup implements OnInit, AfterViewChecked { $('#accountSelect') .on('change', (e, args) => { var selectedValue = Number(args.selected); - //var selectedText= $(".chosen-single span" ).text(); this.AccountNumberChanged(selectedValue); }); + + jQuery('#fixed_hdr2').fxdHdrCol({ + fixedCols: 0, + width: "100%", + height: this.scrHeight, + colModal: [ + { width: 500, align: 'center' }, + { width: 400, align: 'center' }, + { width: 400, align: 'Center' }, + { width: 400, align: 'Center' }, + ], + sort: true + }); + + jQuery('#fixed_hdr3').fxdHdrCol({ + fixedCols: 0, + width: "100%", + height: this.scrHeight, + colModal: [ + { width: 100, align: 'center' }, + { width: 300, align: 'center' }, + { width: 300, align: 'Center' }, + { width: 300, align: 'Center' }, + { width: 400, align: 'Center' }, + { width: 300, align: 'Center' }, + ], + sort: true + }); + + var thisObject=this;//class object + jQuery(".groupName .ft_container .ft_rel_container .ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = jQuery(".groupName .ft_container .ft_rel_container .ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + jQuery(".groupName .ft_container .ft_rel_container .ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + jQuery(".groupName .ft_container .ft_rel_container .ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + jQuery(".groupName .ft_container .ft_rel_container .ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); + + jQuery(".groupList .ft_container .ft_rel_container .ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = jQuery(".groupList .ft_container .ft_rel_container .ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + jQuery(".groupList .ft_container .ft_rel_container .ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + jQuery(".groupList .ft_container .ft_rel_container .ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + jQuery(".groupList .ft_container .ft_rel_container .ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableUserRecords(fieldName,sortType); + + } + + }); } @@ -175,19 +284,51 @@ export class UserGroup implements OnInit, AfterViewChecked { }, error => this.error = error); } + SortTableRecords(fieldName:string,sortType:string) { + this.selectedRow = -1; + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.LicenseUserGroupList(); + } + GetLicenseUserGroups(evt: any) { this.alerts = ''; - this._loadingService.ShowLoading("global-loading"); + this.selectedRow = -1; var tempArr = evt.split(','); this.pageNo = parseInt(tempArr[0]); this.pageLength = parseInt(tempArr[1]); - this.userService.GetLicenseUserGroups(this.license.LicenseId, this.pageNo, this.pageLength) - .subscribe(st => { this.BindFormFields(st); }, error => this.error = error); + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + this.LicenseUserGroupList(); + } SearchRecords() { - this.GetLicenseUserGroups('1, ' + this.pageLength); + this.selectedRow = -1; + this.pageNo=1; + this.SearchField.pageNo=this.pageNo; + this.LicenseUserGroupList(); + } + + LicenseUserGroupList() { + if(this.license.LicenseId>0) + { + + this._loadingService.ShowLoading("global-loading"); + this.SearchField.LicenseId=this.license.LicenseId; + this.userService.GetLicenseUserGroups(this.SearchField) + .subscribe(st => { this.BindFormFields(st); }, error => this.error = error); + } + } + + SortTableUserRecords(fieldName:string,sortType:string) { + this.SearchUserField.sortColumn=fieldName; + this.SearchUserField.sortOrder=sortType; + + this.LicenseUserGroupUserList(); + } GetLicenseUserGroupUsers(evt: any) { this.alerts = ''; @@ -195,16 +336,41 @@ export class UserGroup implements OnInit, AfterViewChecked { var tempArr = evt.split(','); this.pageNoUser = parseInt(tempArr[0]); this.pageLengthUser = parseInt(tempArr[1]); - var AllUsers = false; - if (this.mode == 'Edit') { - AllUsers = true; - } - this.userService.GetLicenseUserGroupUsers(this.license.LicenseId, this.selectedId, AllUsers, this.pageNoUser, this.pageLengthUser) - .subscribe(st => { this.BindUserFormFields(st); }, error => this.error = error); + this.SearchUserField.pageNo=this.pageNoUser; + this.SearchUserField.pageLength=this.pageLengthUser; + this.LicenseUserGroupUserList(); + + } + + LicenseUserGroupUserList() { + + if(this.license.LicenseId>0) + { + + this._loadingService.ShowLoading("global-loading"); + this.SearchUserField.AllUsers=false; + if (this.mode == 'Edit') { + this.SearchUserField.AllUsers=true; + } + this.SearchUserField.LicenseId=this.license.LicenseId; + this.SearchUserField.selectedId=this.selectedId; + + this.userService.GetLicenseUserGroupUsers(this.SearchUserField) + .subscribe(st => { this.BindUserFormFields(st); }, error => this.error = error); + } + } + SearchUserRecords() { - this.GetLicenseUserGroupUsers('1, ' + this.pageLengthUser); + this.pageNoUser=1; + this.pageLengthUser = 10; + this.SearchUserField.pageNo=this.pageNoUser; + this.SearchUserField.pageLength=this.pageLengthUser; + this.SearchUserField.sortColumn='Id'; + this.SearchUserField.sortOrder='asc'; + jQuery(".groupList .ft_container .ft_rel_container .ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + this.LicenseUserGroupUserList(); } AccountNumberChanged(LicenseId: number) { @@ -222,8 +388,6 @@ export class UserGroup implements OnInit, AfterViewChecked { this.alerts = "License user group delete unsuccessfull"; } else { this._confirmService.activate("License user group deleted successfully.", "alertMsg"); - // this.modalAlerts = "

License user group deleted successfully

"; - //this.modalRef = this.modalService.show(template); this.selectedRow = -1; this.selectedId = -1; this.SearchRecords(); @@ -361,32 +525,32 @@ export class UserGroup implements OnInit, AfterViewChecked { } EditLicenseUserGroup() { - jQuery('.ft_r thead tr th:eq(0)').show(); + jQuery('.groupList .ft_container .ft_rel_container .ft_rwrapper table thead tr th:eq(0)').show(); + jQuery('#fixed_hdr3 thead tr th:eq(0)').show(); this.mode = 'Edit'; this.modalTitle = 'Edit User Group'; this.topPos = '100px'; this.alerts = ''; this.updateUserGroupFrm.controls['userGroupName'].setValue(this.licenseUserGroup.Title); this.recordCountUser = 0; - this.pageNoUser = 1; - this.pageLengthUser = 10; + this.lstLicenseUserGroupUsers=[]; this.SearchUserRecords(); } ngAfterViewChecked() { - jQuery('#tblUserGroupUsers thead').css('width', jQuery('#tblUserGroupUsers tbody tr:eq(0)').width()); + jQuery('#fixed_hdr3 thead').css('width', jQuery('#fixed_hdr3 tbody tr:eq(0)').width()); } ViewLicenseUserGroup() { - jQuery('.ft_r thead tr th:eq(0)').hide(); + jQuery('.groupList .ft_container .ft_rel_container .ft_rwrapper table thead tr th:eq(0)').hide(); + jQuery('#fixed_hdr3 thead tr th:eq(0)').hide(); this.mode = 'View'; this.modalTitle = 'View User Group'; this.topPos = '100px'; this.alerts = ''; this.updateUserGroupFrm.controls['userGroupName'].setValue(this.licenseUserGroup.Title); this.recordCountUser = 0; - this.pageNoUser = 1; - this.pageLengthUser = 10; + this.lstLicenseUserGroupUsers=[]; this.SearchUserRecords(); } diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html index 9bdab28..77154a3 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html @@ -157,7 +157,7 @@ Active Expired - + Inactive Logged-In, Active Session: {{UserEntity.TotalLogin}} @@ -165,8 +165,6 @@ - - diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts index 84b6ce8..157674d 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts @@ -70,6 +70,21 @@ export class UsersList implements OnInit, AfterViewChecked { // Declare height and width variables scrHeight:any; scrWidth:any; + + SearchField:any={ + FirstName:'', + LastName:'', + EmailId:'', + AccountNumber:'', + UserTypeId:0, + AccountTypeId:0, + LoginStatus:false, + sortColumn:'Id', + sortOrder:'asc', + pageNo:1, + pageLength:10 + } + @HostListener('window:resize', ['$event']) getScreenSize(event?) { @@ -83,7 +98,9 @@ export class UsersList implements OnInit, AfterViewChecked { } - // $(".ft_container").css("height",this.scrHeight); + if(this.scrHeight<=300) this.scrHeight=300; + + $(".ft_container").css("height",this.scrHeight); } constructor(private _loadingService: LoadingService,private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http, private _confirmService: ConfirmService, public global:GlobalService @@ -174,30 +191,38 @@ export class UsersList implements OnInit, AfterViewChecked { sort: true }); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + // if(document.getElementById("fixed_table_rc") != null){ + // document.getElementById("fixed_table_rc").remove(); + // var testScript = document.createElement("script"); + // testScript.setAttribute("id", "fixed_table_rc"); + // testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); + // testScript.setAttribute("type", "text/javascript"); + // document.body.appendChild(testScript); + // } - // $(".ft_rwrapper table thead tr th").on("click",function(event){ - - // this.fieldName=event.currentTarget.id; - // var isAscSort = $(".ft_rwrapper table thead tr #"+this.fieldName).hasClass('fx_sort_asc'); - // $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); - - // if (isAscSort) { - // $(".ft_rwrapper table thead tr #"+this.fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); - // this.sortType="desc"; - // } else { - // $(".ft_rwrapper table thead tr #"+this.fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); - // this.sortType="asc"; - // } + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); - // }); + } + + }); } @@ -280,9 +305,6 @@ export class UsersList implements OnInit, AfterViewChecked { GetAccountType() { this.userservice.GetAccountType().subscribe(x => { this.AccountTypeList = x; }, error => this.error = error); } - GetUserList() { - //this.userservice.GetUserList().subscribe(x => { this.UserList = x; }, error => this.error = error); - } GetUserRights() { this.userservice.GetManageUserRights({ UserId: this.managerightFrm.controls['id'].value, @@ -296,56 +318,76 @@ export class UsersList implements OnInit, AfterViewChecked { SearchUserList(evt: any) { this.NoRecord = ''; - this._loadingService.ShowLoading("global-loading"); var tempArr = evt.split(','); this.pageNo = parseInt(tempArr[0]); this.pageLength = parseInt(tempArr[1]); - var UserFilterControl = this.Users.value; + this.selectedRow = -1; + this.EditbuttonStatus=undefined; + this.logoutUserSession=undefined; + this.buttonStatus = null; + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetUserList(); + + } - this.userservice.GetUserList( - { - FirstName: this.Users.controls['FirstName'].value, - LastName: this.Users.controls['LastName'].value, - EmailId: this.Users.controls['EmailId'].value, - AccountNumber: this.Users.controls['AccountNumber'].value, - UserTypeId: (this.Users.controls['UserTypeId'].value != null && this.Users.controls['UserTypeId'].value !='' ? this.Users.controls['UserTypeId'].value:0), - AccountTypeId: (this.Users.controls['AccountTypeId'].value != null && this.Users.controls['AccountTypeId'].value != ''? this.Users.controls['AccountTypeId'].value : 0), - LoginStatus: this.Users.controls['LoginStatus'].value, - },this.pageNo, this.pageLength - ) - .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); - + SortTableRecords(fieldName:string,sortType:string) { + this.EditbuttonStatus=undefined; + this.logoutUserSession=undefined; + this.buttonStatus = null; + this.selectedRow = -1; + + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetUserList(); } + SearchRecords() { this.EditbuttonStatus=undefined; this.logoutUserSession=undefined; this.buttonStatus = null; this.selectedRow = -1; - this.SearchUserList('1, ' + this.pageLength); + this.pageNo=1; + this.SearchField.FirstName=this.Users.controls['FirstName'].value; + this.SearchField.LastName=this.Users.controls['LastName'].value; + this.SearchField.EmailId=this.Users.controls['EmailId'].value; + this.SearchField.AccountNumber=this.Users.controls['AccountNumber'].value; + this.SearchField.UserTypeId=(this.Users.controls['UserTypeId'].value != null && this.Users.controls['UserTypeId'].value !='' ? this.Users.controls['UserTypeId'].value:0); + this.SearchField.AccountTypeId=(this.Users.controls['AccountTypeId'].value != null && this.Users.controls['AccountTypeId'].value != ''? this.Users.controls['AccountTypeId'].value : 0); + this.SearchField.LoginStatus=this.Users.controls['LoginStatus'].value; + this.SearchField.pageNo=this.pageNo; + + this.GetUserList(); + } + + GetUserList() { + this._loadingService.ShowLoading("global-loading"); + this.userservice.GetUserList(this.SearchField) + .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + } + + BindFormFields(data) { this.recordCount = data.RecordCount; this.UserList = data.UserList; if (this.UserList.length > 0) { this.NoRecord = ''; - this._loadingService.HideLoading("global-loading"); } if (this.UserList.length == 0) { - this.NoRecord = this.global.NoRecords; - this._loadingService.HideLoading("global-loading"); + this.NoRecord = this.global.NoRecords; } + this._loadingService.HideLoading("global-loading"); } CancelEditUser() { - $("#searchform").css("display","block"); - this.SearchUserList(this.pageNo +','+ this.pageLength); + $("#searchform").css("display","block"); this.Mode = 'Manage'; this.modalTitle = 'LIST USER'; this.topPos = '2000px'; this.divClass = ''; - this.selectedRow = -1; - this.EditbuttonStatus=undefined; - this.buttonStatus=undefined; - this.logoutUserSession=undefined; + this.GetUserList(); } EditUser() { if (this.EditbuttonStatus) { @@ -422,7 +464,7 @@ export class UsersList implements OnInit, AfterViewChecked { this.logoutUserSession=undefined; this.buttonStatus = null; this.selectedRow = -1; - this.SearchUserList(this.pageNo +','+ this.pageLength); + this.GetUserList(); },error => console.log(error)); } diff --git a/400-SOURCECODE/Admin/src/app/shared/global.ts b/400-SOURCECODE/Admin/src/app/shared/global.ts index 9d6febc..696a196 100644 --- a/400-SOURCECODE/Admin/src/app/shared/global.ts +++ b/400-SOURCECODE/Admin/src/app/shared/global.ts @@ -147,12 +147,20 @@ export class GlobalService { if (fromdate ==null ||fromdate =='Invalid Date') { this.ValidationMsg = 'From date is Invalid.' + if(fromdate ==null) + { + this.ValidationMsg = 'From date is Required.' + } } else if (todate ==null ||todate =='Invalid Date') { - this.ValidationMsg = 'To date is Invalid.' + this.ValidationMsg = 'To date is Invalid.' + if(todate ==null) + { + this.ValidationMsg = 'To date is Required.' + } } - else if (new Date(todate) < new Date(fromdate)) { - this.ValidationMsg = 'The To date must be greater than the From date.' + else if (Date.parse(todate) < Date.parse(fromdate)) { + this.ValidationMsg = "'To date' must be greater than or equal to 'From date'." } else { this.ValidationMsg = ''; diff --git a/400-SOURCECODE/Admin/src/assets/scripts/fixed_table_rc.js b/400-SOURCECODE/Admin/src/assets/scripts/fixed_table_rc.js index f2c9214..be260ca 100644 --- a/400-SOURCECODE/Admin/src/assets/scripts/fixed_table_rc.js +++ b/400-SOURCECODE/Admin/src/assets/scripts/fixed_table_rc.js @@ -214,26 +214,26 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. $('table', lc.ft_container).addClass('sorttable'); - sorttable.makeSortable(this); + // sorttable.makeSortable(this); - var $sortableTh = $('.fx_sort_bg', lc.ft_rel_container); + // var $sortableTh = $('.fx_sort_bg', lc.ft_rel_container); - $sortableTh.click (function () { - var $this = $(this); - var isAscSort = $this.hasClass('fx_sort_asc'); + // $sortableTh.click (function () { + // var $this = $(this); + // var isAscSort = $this.hasClass('fx_sort_asc'); - $sortableTh.removeClass('fx_sort_asc fx_sort_desc'); + // $sortableTh.removeClass('fx_sort_asc fx_sort_desc'); - if (isAscSort) { - $this.addClass('fx_sort_desc').removeClass('fx_sort_asc'); - } else { - $this.addClass('fx_sort_asc').removeClass('fx_sort_desc'); - } + // if (isAscSort) { + // $this.addClass('fx_sort_desc').removeClass('fx_sort_asc'); + // } else { + // $this.addClass('fx_sort_asc').removeClass('fx_sort_desc'); + // } - var idx = $(this).index(); + // var idx = $(this).index(); - sorttable.innerSortFunction.apply(lc.ft_wrapper.find('th').get(idx), []); - }); + // sorttable.innerSortFunction.apply(lc.ft_wrapper.find('th').get(idx), []); + // }); } }); diff --git a/400-SOURCECODE/Admin/src/assets/styles/fixed_table_rc.css b/400-SOURCECODE/Admin/src/assets/styles/fixed_table_rc.css index 181a0dc..c6622ca 100644 --- a/400-SOURCECODE/Admin/src/assets/styles/fixed_table_rc.css +++ b/400-SOURCECODE/Admin/src/assets/styles/fixed_table_rc.css @@ -1,7 +1,7 @@ .ft_container {border: 1px solid #ddd;} .ft_container table { border-width: 0px; border-collapse: collapse; margin: 0; outline-style: none; font-size: 0.9em; background-color: #fff; } -.ft_container table tr th { font-weight: bold; background: #7166b7; color: #fff; } +.ft_container table tr th { font-weight: bold; background: #0095da; color: #fff; } .ft_container table thead { -moz-user-select: none;-webkit-user-select: none;} .ft_container table tr th, -- libgit2 0.21.4