From e5cdf18d436a38940b5ae4194803f9f623caa4f3 Mon Sep 17 00:00:00 2001 From: gagan.deep Date: Tue, 27 Feb 2018 13:13:02 +0530 Subject: [PATCH] Merge code --- 400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj | 10 ++++++++-- 400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs | 10 ++++++++-- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs | 8 +++++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs | 11 +++++++---- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs | 26 +++++++++++++++++++------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs | 269 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx | 375 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList1_Result.cs | 32 ++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList_Result.cs | 32 -------------------------------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUsers_Result.cs | 33 +++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetUsageReport_Result.cs | 1 + 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenses_Result.cs | 2 +- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs | 37 +++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs | 2 +- 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs | 14 +++++++------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs | 1 + 400-SOURCECODE/AIAHTML5.ADMIN.API/Web.config | 1 + 500-DBDump/AIA-StoredProcedures/dbo.GetSearchUsers.sql | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 500-DBDump/AIA-StoredProcedures/dbo.GetUsageReport.StoredProcedure.sql | Bin 11108 -> 0 bytes 500-DBDump/AIA-StoredProcedures/dbo.usp_GetUserType.sql | 30 ++++-------------------------- 500-DBDump/AIA-StoredProcedures/dbo.usp_GetlicensesList.sql | Bin 0 -> 16970 bytes 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupController.cs | 140 -------------------------------------------------------------------------------------------------------------------------------------------- 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupModel.cs | 112 ---------------------------------------------------------------------------------------------------------------- 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserModel.cs | 90 ------------------------------------------------------------------------------------------ 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/mergecode.txt | 62 -------------------------------------------------------------- 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.html | 204 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.ts | 267 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/users.component.ts | 324 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 500-DBDump/AIA-StoredProcedures/usp_GetAccountNumber.sql | Bin 1066 -> 1972 bytes 500-DBDump/AIA-StoredProcedures/usp_GetlicensesList.sql | Bin 0 -> 16970 bytes 30 files changed, 808 insertions(+), 1476 deletions(-) create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList1_Result.cs delete mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList_Result.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUsers_Result.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs create mode 100644 500-DBDump/AIA-StoredProcedures/dbo.GetSearchUsers.sql create mode 100644 500-DBDump/AIA-StoredProcedures/dbo.usp_GetlicensesList.sql delete mode 100644 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupController.cs delete mode 100644 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupModel.cs delete mode 100644 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserModel.cs delete mode 100644 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/mergecode.txt delete mode 100644 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.html delete mode 100644 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.ts delete mode 100644 500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/users.component.ts create mode 100644 500-DBDump/AIA-StoredProcedures/usp_GetlicensesList.sql diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj index 6f1085d..3c38f38 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj @@ -513,7 +513,10 @@ AIADBEntity.tt - + + AIADBEntity.tt + + AIADBEntity.tt @@ -726,7 +729,10 @@ AIADBEntity.tt - + + AIADBEntity.tt + + AIADBEntity.tt diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs index 164815d..af9553d 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/App_Start/WebApiConfig.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Configuration; using System.Linq; using System.Web.Http; using System.Web.Http.Cors; @@ -15,9 +16,14 @@ namespace AIAHTML5.ADMIN.API = Newtonsoft.Json.ReferenceLoopHandling.Ignore; GlobalConfiguration.Configuration.Formatters .Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter); - + string Enablecors = ConfigurationManager.AppSettings["Enablecors"]; + if (Enablecors == "false") + { + EnableCorsAttribute cors = new EnableCorsAttribute("http://localhost:4200", "*", "GET,POST"); + config.EnableCors(cors); + } // Configure cross domain access - config.EnableCors(); + // Web API routes config.MapHttpAttributeRoutes(); diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index 6b71f6e..909dcce 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -43,14 +43,15 @@ namespace AIAHTML5.ADMIN.API.Controllers [HttpGet] public HttpResponseMessage GetLicenses(string accountNumber, string licenseeFirstName, string licenseeLastName, byte licenseTypeId, string institutionName, int stateId, int countryId, string emailId, DateTime subscriptionStartDate, DateTime subscriptionEndDate, - bool isActive) + bool isActive, int pageNo, int pageLength) { List LicenseList = new List(); + int recordCount = 0; try { LicenseList = LicenseModel.GetLicenses(dbContext, accountNumber, licenseeFirstName, licenseeLastName, licenseTypeId, institutionName, - stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive); - return Request.CreateResponse(HttpStatusCode.OK, LicenseList); + stateId, countryId, emailId, subscriptionStartDate, subscriptionEndDate, isActive, pageNo, pageLength, out recordCount); + return Request.CreateResponse(HttpStatusCode.OK, new { LicenseList = LicenseList, RecordCount = recordCount }); } catch (Exception ex) { @@ -59,6 +60,7 @@ namespace AIAHTML5.ADMIN.API.Controllers } } + [Route("InsertLicense")] [HttpPost] public HttpResponseMessage InsertLicense(JObject jsonData) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs index 012acba..a964441 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs @@ -22,10 +22,13 @@ 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) + public IHttpActionResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, int iState, int iCountry, int pageNo, int pageLength) { - var lstUsageReport = dbContext.GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry).ToList(); - return Ok(lstUsageReport); + + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); + var lstUsageReport = dbContext.GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry,pageNo, pageLength, spRecordCount).ToList(); + return Ok(new { UserUsage = lstUsageReport, RecordCount = spRecordCount.Value }); + //return Ok(lstUsageReport); } [Route("GetCustomerSummeryReport")] @@ -39,7 +42,7 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetExpiringSubscriptionReport")] [HttpGet] - public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) + public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) { var lstExpiringSubscriptionReport = dbContext.GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList(); return Ok(lstExpiringSubscriptionReport); diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs index db89e2b..406c24c 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs @@ -142,15 +142,27 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("Users")] [HttpGet] - public IHttpActionResult UserList(string firstname, string lastname, string emailid, string accountnumber, string usertypeid, string accounttypeid) + public IHttpActionResult UserList(string firstname, string lastname, string emailid, string accountnumber, string usertypeid, string accounttypeid, + int pageNo, int pageLength) { - int UserTypeId = (!string.IsNullOrEmpty(usertypeid) ? Convert.ToInt32(usertypeid) : 0); - int AccountTypeId = (!string.IsNullOrEmpty(accounttypeid) ? Convert.ToInt32(accounttypeid) : 0); - dbContext.Configuration.ProxyCreationEnabled = false; - List Users = dbContext.usp_GetSearchUserList(firstname, lastname, emailid, accountnumber, UserTypeId, AccountTypeId, 1).ToList(); - return Ok(Users); + try + { + int UserTypeId = (!string.IsNullOrEmpty(usertypeid) ? Convert.ToInt32(usertypeid) : 0); + int AccountTypeId = (!string.IsNullOrEmpty(accounttypeid) ? Convert.ToInt32(accounttypeid) : 0); + int recordCount = 0; + 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.GetSearchUsers(firstname, lastname, emailid, accountnumber, UserTypeId, AccountTypeId, 1, + pageNo, pageLength, spRecordCount).ToList(); + return Ok(new { UserList = Users, RecordCount = spRecordCount.Value }); + } + catch(Exception ex) + { + return BadRequest(); + } } - [Route("UpdateUser")] [HttpPost] public HttpResponseMessage UpdateUser(JObject jsonUserData) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index 3883e6e..bb3942f 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -1466,7 +1466,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetSearchTerms"); } - public virtual ObjectResult GetSearchUserList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType) + public virtual int GetSearchUserList(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFirstNameParameter = sFirstName != null ? new ObjectParameter("sFirstName", sFirstName) : @@ -1496,7 +1496,15 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iLoginUserType", iLoginUserType) : new ObjectParameter("iLoginUserType", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetSearchUserList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter); + var pageNoParameter = pageNo.HasValue ? + new ObjectParameter("pageNo", pageNo) : + new ObjectParameter("pageNo", typeof(int)); + + var pageLengthParameter = pageLength.HasValue ? + new ObjectParameter("pageLength", pageLength) : + new ObjectParameter("pageLength", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetSearchUserList", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult GetSiteAccoutDetail(string strAccountNumber) @@ -1630,7 +1638,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction>("GetTotalLoginsByLicenseEditionId", licenseEditionIdParameter); } - public virtual ObjectResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, Nullable iState, Nullable iCountry) + public virtual ObjectResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, Nullable iState, Nullable iCountry, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -1656,7 +1664,15 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountry", iCountry) : new ObjectParameter("iCountry", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetUsageReport", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, sZipParameter, iStateParameter, iCountryParameter); + var pageNoParameter = pageNo.HasValue ? + new ObjectParameter("pageNo", pageNo) : + new ObjectParameter("pageNo", typeof(int)); + + var pageLengthParameter = pageLength.HasValue ? + new ObjectParameter("pageLength", pageLength) : + new ObjectParameter("pageLength", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetUsageReport", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, sZipParameter, iStateParameter, iCountryParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult GetUsageReport_OLD_PROC(string sFromDate, string sToDate, string sAccoutNumber, string sZip, Nullable iState, Nullable iCountry) @@ -3159,55 +3175,6 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseById", idParameter); } - public virtual ObjectResult usp_GetLicenses(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable iLicenseTypeId, string sInstituteName, string sEmail, Nullable iStateId, Nullable iCountryId, Nullable bisActive) - { - var sStartDateParameter = sStartDate != null ? - new ObjectParameter("sStartDate", sStartDate) : - new ObjectParameter("sStartDate", typeof(string)); - - var sEndDateParameter = sEndDate != null ? - new ObjectParameter("sEndDate", sEndDate) : - new ObjectParameter("sEndDate", typeof(string)); - - var sAccoutNumberParameter = sAccoutNumber != null ? - new ObjectParameter("sAccoutNumber", sAccoutNumber) : - new ObjectParameter("sAccoutNumber", typeof(string)); - - var sLicenseeFirstNameParameter = sLicenseeFirstName != null ? - new ObjectParameter("sLicenseeFirstName", sLicenseeFirstName) : - new ObjectParameter("sLicenseeFirstName", typeof(string)); - - var sLicenseeLastNameParameter = sLicenseeLastName != null ? - new ObjectParameter("sLicenseeLastName", sLicenseeLastName) : - new ObjectParameter("sLicenseeLastName", typeof(string)); - - var iLicenseTypeIdParameter = iLicenseTypeId.HasValue ? - new ObjectParameter("iLicenseTypeId", iLicenseTypeId) : - new ObjectParameter("iLicenseTypeId", typeof(byte)); - - var sInstituteNameParameter = sInstituteName != null ? - new ObjectParameter("sInstituteName", sInstituteName) : - new ObjectParameter("sInstituteName", typeof(string)); - - var sEmailParameter = sEmail != null ? - new ObjectParameter("sEmail", sEmail) : - new ObjectParameter("sEmail", typeof(string)); - - var iStateIdParameter = iStateId.HasValue ? - new ObjectParameter("iStateId", iStateId) : - new ObjectParameter("iStateId", typeof(int)); - - var iCountryIdParameter = iCountryId.HasValue ? - new ObjectParameter("iCountryId", iCountryId) : - new ObjectParameter("iCountryId", typeof(int)); - - var bisActiveParameter = bisActive.HasValue ? - new ObjectParameter("bisActive", bisActive) : - new ObjectParameter("bisActive", typeof(bool)); - - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenses", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter); - } - public virtual ObjectResult usp_GetLicenseTypes() { return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseTypes"); @@ -3530,5 +3497,201 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseUserGroupUsers", userGroupIdParameter, userIdsParameter, status); } + + public virtual ObjectResult usp_Getlicenses(string sStartDate, string sEndDate, string sAccoutNumber, string sLicenseeFirstName, string sLicenseeLastName, Nullable iLicenseTypeId, string sInstituteName, string sEmail, Nullable iStateId, Nullable iCountryId, Nullable bisActive, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + { + var sStartDateParameter = sStartDate != null ? + new ObjectParameter("sStartDate", sStartDate) : + new ObjectParameter("sStartDate", typeof(string)); + + var sEndDateParameter = sEndDate != null ? + new ObjectParameter("sEndDate", sEndDate) : + new ObjectParameter("sEndDate", typeof(string)); + + var sAccoutNumberParameter = sAccoutNumber != null ? + new ObjectParameter("sAccoutNumber", sAccoutNumber) : + new ObjectParameter("sAccoutNumber", typeof(string)); + + var sLicenseeFirstNameParameter = sLicenseeFirstName != null ? + new ObjectParameter("sLicenseeFirstName", sLicenseeFirstName) : + new ObjectParameter("sLicenseeFirstName", typeof(string)); + + var sLicenseeLastNameParameter = sLicenseeLastName != null ? + new ObjectParameter("sLicenseeLastName", sLicenseeLastName) : + new ObjectParameter("sLicenseeLastName", typeof(string)); + + var iLicenseTypeIdParameter = iLicenseTypeId.HasValue ? + new ObjectParameter("iLicenseTypeId", iLicenseTypeId) : + new ObjectParameter("iLicenseTypeId", typeof(byte)); + + var sInstituteNameParameter = sInstituteName != null ? + new ObjectParameter("sInstituteName", sInstituteName) : + new ObjectParameter("sInstituteName", typeof(string)); + + var sEmailParameter = sEmail != null ? + new ObjectParameter("sEmail", sEmail) : + new ObjectParameter("sEmail", typeof(string)); + + var iStateIdParameter = iStateId.HasValue ? + new ObjectParameter("iStateId", iStateId) : + new ObjectParameter("iStateId", typeof(int)); + + var iCountryIdParameter = iCountryId.HasValue ? + new ObjectParameter("iCountryId", iCountryId) : + new ObjectParameter("iCountryId", typeof(int)); + + var bisActiveParameter = bisActive.HasValue ? + new ObjectParameter("bisActive", bisActive) : + new ObjectParameter("bisActive", typeof(bool)); + + var pageNoParameter = pageNo.HasValue ? + new ObjectParameter("pageNo", pageNo) : + new ObjectParameter("pageNo", typeof(int)); + + var pageLengthParameter = pageLength.HasValue ? + new ObjectParameter("pageLength", pageLength) : + new ObjectParameter("pageLength", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_Getlicenses", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter, pageNoParameter, pageLengthParameter, recordCount); + } + + public virtual ObjectResult usp_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) + { + var sStartDateParameter = sStartDate != null ? + new ObjectParameter("sStartDate", sStartDate) : + new ObjectParameter("sStartDate", typeof(string)); + + var sEndDateParameter = sEndDate != null ? + new ObjectParameter("sEndDate", sEndDate) : + new ObjectParameter("sEndDate", typeof(string)); + + var sAccoutNumberParameter = sAccoutNumber != null ? + new ObjectParameter("sAccoutNumber", sAccoutNumber) : + new ObjectParameter("sAccoutNumber", typeof(string)); + + var sLicenseeFirstNameParameter = sLicenseeFirstName != null ? + new ObjectParameter("sLicenseeFirstName", sLicenseeFirstName) : + new ObjectParameter("sLicenseeFirstName", typeof(string)); + + var sLicenseeLastNameParameter = sLicenseeLastName != null ? + new ObjectParameter("sLicenseeLastName", sLicenseeLastName) : + new ObjectParameter("sLicenseeLastName", typeof(string)); + + var iLicenseTypeIdParameter = iLicenseTypeId.HasValue ? + new ObjectParameter("iLicenseTypeId", iLicenseTypeId) : + new ObjectParameter("iLicenseTypeId", typeof(byte)); + + var sInstituteNameParameter = sInstituteName != null ? + new ObjectParameter("sInstituteName", sInstituteName) : + new ObjectParameter("sInstituteName", typeof(string)); + + var sEmailParameter = sEmail != null ? + new ObjectParameter("sEmail", sEmail) : + new ObjectParameter("sEmail", typeof(string)); + + var iStateIdParameter = iStateId.HasValue ? + new ObjectParameter("iStateId", iStateId) : + new ObjectParameter("iStateId", typeof(int)); + + var iCountryIdParameter = iCountryId.HasValue ? + new ObjectParameter("iCountryId", iCountryId) : + new ObjectParameter("iCountryId", typeof(int)); + + var bisActiveParameter = bisActive.HasValue ? + new ObjectParameter("bisActive", bisActive) : + new ObjectParameter("bisActive", typeof(bool)); + + var pageNoParameter = pageNo.HasValue ? + new ObjectParameter("pageNo", pageNo) : + new ObjectParameter("pageNo", typeof(int)); + + var pageLengthParameter = pageLength.HasValue ? + new ObjectParameter("pageLength", pageLength) : + new ObjectParameter("pageLength", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetlicensesList", sStartDateParameter, sEndDateParameter, sAccoutNumberParameter, sLicenseeFirstNameParameter, sLicenseeLastNameParameter, iLicenseTypeIdParameter, sInstituteNameParameter, sEmailParameter, iStateIdParameter, iCountryIdParameter, bisActiveParameter, pageNoParameter, pageLengthParameter, recordCount); + } + + public virtual ObjectResult GetSearchUserList1(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + { + var sFirstNameParameter = sFirstName != null ? + new ObjectParameter("sFirstName", sFirstName) : + new ObjectParameter("sFirstName", typeof(string)); + + var sLastNameParameter = sLastName != null ? + new ObjectParameter("sLastName", sLastName) : + new ObjectParameter("sLastName", typeof(string)); + + var sEmailIdParameter = sEmailId != null ? + new ObjectParameter("sEmailId", sEmailId) : + new ObjectParameter("sEmailId", typeof(string)); + + var sAccoutNumberParameter = sAccoutNumber != null ? + new ObjectParameter("sAccoutNumber", sAccoutNumber) : + new ObjectParameter("sAccoutNumber", typeof(string)); + + var iUserTypeIdParameter = iUserTypeId.HasValue ? + new ObjectParameter("iUserTypeId", iUserTypeId) : + new ObjectParameter("iUserTypeId", typeof(int)); + + var iAccountTypeIdParameter = iAccountTypeId.HasValue ? + new ObjectParameter("iAccountTypeId", iAccountTypeId) : + new ObjectParameter("iAccountTypeId", typeof(int)); + + var iLoginUserTypeParameter = iLoginUserType.HasValue ? + new ObjectParameter("iLoginUserType", iLoginUserType) : + new ObjectParameter("iLoginUserType", typeof(int)); + + var pageNoParameter = pageNo.HasValue ? + new ObjectParameter("pageNo", pageNo) : + new ObjectParameter("pageNo", typeof(int)); + + var pageLengthParameter = pageLength.HasValue ? + new ObjectParameter("pageLength", pageLength) : + new ObjectParameter("pageLength", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetSearchUserList1", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, pageNoParameter, pageLengthParameter, recordCount); + } + + public virtual ObjectResult GetSearchUsers(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + { + var sFirstNameParameter = sFirstName != null ? + new ObjectParameter("sFirstName", sFirstName) : + new ObjectParameter("sFirstName", typeof(string)); + + var sLastNameParameter = sLastName != null ? + new ObjectParameter("sLastName", sLastName) : + new ObjectParameter("sLastName", typeof(string)); + + var sEmailIdParameter = sEmailId != null ? + new ObjectParameter("sEmailId", sEmailId) : + new ObjectParameter("sEmailId", typeof(string)); + + var sAccoutNumberParameter = sAccoutNumber != null ? + new ObjectParameter("sAccoutNumber", sAccoutNumber) : + new ObjectParameter("sAccoutNumber", typeof(string)); + + var iUserTypeIdParameter = iUserTypeId.HasValue ? + new ObjectParameter("iUserTypeId", iUserTypeId) : + new ObjectParameter("iUserTypeId", typeof(int)); + + var iAccountTypeIdParameter = iAccountTypeId.HasValue ? + new ObjectParameter("iAccountTypeId", iAccountTypeId) : + new ObjectParameter("iAccountTypeId", typeof(int)); + + var iLoginUserTypeParameter = iLoginUserType.HasValue ? + new ObjectParameter("iLoginUserType", iLoginUserType) : + new ObjectParameter("iLoginUserType", typeof(int)); + + var pageNoParameter = pageNo.HasValue ? + new ObjectParameter("pageNo", pageNo) : + new ObjectParameter("pageNo", typeof(int)); + + var pageLengthParameter = pageLength.HasValue ? + new ObjectParameter("pageLength", pageLength) : + new ObjectParameter("pageLength", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetSearchUsers", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, pageNoParameter, pageLengthParameter, recordCount); + } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index 7e4620b..f717949 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -2178,9 +2178,6 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does - - - @@ -2228,6 +2225,21 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + + + + + + + + + + @@ -2273,6 +2285,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + @@ -2644,7 +2659,7 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does - + @@ -2656,6 +2671,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + @@ -2668,15 +2686,6 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does - - - - - - - - - @@ -5843,7 +5852,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - + @@ -5851,6 +5860,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + @@ -5896,6 +5908,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + @@ -6324,19 +6339,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - - - - - - - - - - - - - @@ -6421,7 +6423,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - + @@ -6437,6 +6439,62 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6972,23 +7030,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - - - - - - - - - - - - - - - - - @@ -7071,6 +7112,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + @@ -7323,28 +7365,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - - - - - - - - - - - - - - - - - - - - - - @@ -7399,6 +7419,85 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9192,7 +9291,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - @@ -9287,27 +9385,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - - - - - - - - - - - - - - - - - - - - - @@ -9427,6 +9504,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + @@ -9740,30 +9818,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - - - - - - - - - - - - - - - - - - - - - - - - @@ -9814,32 +9868,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -9927,6 +9955,75 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList1_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList1_Result.cs new file mode 100644 index 0000000..e7850ba --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList1_Result.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AIAHTML5.ADMIN.API.Entity +{ + using System; + + public partial class GetSearchUserList1_Result + { + public Nullable 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 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; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList_Result.cs deleted file mode 100644 index b480457..0000000 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUserList_Result.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace AIAHTML5.ADMIN.API.Entity -{ - using System; - - public partial class GetSearchUserList_Result - { - public Nullable 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 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; } - } -} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUsers_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUsers_Result.cs new file mode 100644 index 0000000..e84584a --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetSearchUsers_Result.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AIAHTML5.ADMIN.API.Entity +{ + using System; + + public partial class GetSearchUsers_Result + { + public Nullable RowNum { get; set; } + public Nullable 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 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; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetUsageReport_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetUsageReport_Result.cs index ba66087..15871a2 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetUsageReport_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetUsageReport_Result.cs @@ -26,5 +26,6 @@ namespace AIAHTML5.ADMIN.API.Entity public string InstitutionName { get; set; } public Nullable TotalLogins { get; set; } public string LastLogin { get; set; } + public Nullable RowNum { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenses_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenses_Result.cs index 34defa5..f49aa89 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenses_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenses_Result.cs @@ -11,7 +11,7 @@ namespace AIAHTML5.ADMIN.API.Entity { using System; - public partial class usp_GetLicenses_Result + public partial class usp_Getlicenses_Result { public int LicenseId { get; set; } public string AccountNumber { 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 new file mode 100644 index 0000000..0f9b2e6 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetlicensesList_Result.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AIAHTML5.ADMIN.API.Entity +{ + using System; + + public partial class usp_GetlicensesList_Result + { + public int LicenseId { get; set; } + public string AccountNumber { get; set; } + public string LicenseType { get; set; } + public string AccountType { get; set; } + public string InstitutionName { get; set; } + public string LicenseState { get; set; } + public string LicenseCountry { get; set; } + public string EmailId { get; set; } + public Nullable CardNumber { get; set; } + public string ProductKey { get; set; } + public string ClientAdmin { get; set; } + public string LicenseeName { get; set; } + public string ContactAddress { get; set; } + public string 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 NoofImages { get; set; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs index a677a03..3611937 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs @@ -21,7 +21,7 @@ namespace AIAHTML5.ADMIN.API.Models DiscountCodeModel DiscountCodeObj = new DiscountCodeModel(); try { - var result = dbContext.GetDiscountCodes(discountCode, startDate.ToString(), endDate.ToString()).ToList(); + var result = dbContext.GetDiscountCodes(discountCode, startDate.ToString("MM/dd/yyyy"), endDate.ToString("MM/dd/yyyy")).ToList(); if (result.Count > 0) { foreach (var item in result) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index dae84e7..a3304dc 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -57,20 +57,21 @@ namespace AIAHTML5.ADMIN.API.Models public bool IsRenew { get; set; } 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) + 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) { List LicenseList = new List(); LicenseModel LicenseObj = new LicenseModel(); - int i = 0; + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); + recordCount = 0; try { - var result = dbContext.usp_GetLicenses( + var result = 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).ToList(); + (emailId == null ? "" : emailId), stateId, countryId, isActive, pageNo, pageLength, spRecordCount).ToList(); if (result.Count > 0) { foreach (var item in result) @@ -97,9 +98,8 @@ namespace AIAHTML5.ADMIN.API.Models LicenseObj.ModifyDate = DateTime.ParseExact((item.ModifyDate == "" ? "01/01/0001" : item.ModifyDate), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); LicenseObj.IsActive = (item.LicenseStatus == "Active" ? true : false); LicenseList.Add(LicenseObj); - i++; - if (i >= 100) break; } + recordCount = (int)spRecordCount.Value; } } catch (Exception ex) { } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs index e69af0f..5b33483 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs @@ -161,5 +161,6 @@ namespace AIAHTML5.ADMIN.API.Models return false; } } + } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Web.config b/400-SOURCECODE/AIAHTML5.ADMIN.API/Web.config index 5308430..7fa7593 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Web.config +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Web.config @@ -12,6 +12,7 @@ + diff --git a/500-DBDump/AIA-StoredProcedures/dbo.GetSearchUsers.sql b/500-DBDump/AIA-StoredProcedures/dbo.GetSearchUsers.sql new file mode 100644 index 0000000..b6542e5 --- /dev/null +++ b/500-DBDump/AIA-StoredProcedures/dbo.GetSearchUsers.sql @@ -0,0 +1,191 @@ + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetSearchUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[GetLicenseIdByUserId] +GO +alter PROCEDURE [dbo].[GetSearchUsers]--'','','','',0,0,0,1,10,0 + -- Add the parameters for the stored procedure here + @sFirstName varchar(100) = '', @sLastName varchar(100) = '', @sEmailId varchar(100) = '', + @sAccoutNumber varchar(100) ='', @iUserTypeId int, @iAccountTypeId int, @iLoginUserType int, + @pageNo int, @pageLength int, @recordCount int out +AS +BEGIN + IF 1=0 BEGIN + SET FMTONLY OFF + END + + DECLARE @SQL NVARCHAR(MAX) + -- create a temporary table to store the desired results of user on the basis of parameter + CREATE TABLE #UserResult + ( + RowNums int IDENTITY PRIMARY KEY, + Id INT, + FirstName VARCHAR(100), + LastName VARCHAR(100), + LoginId VARCHAR(50), + EmailId VARCHAR(50), + UserTypeTitle VARCHAR(50), + Password VARCHAR(50), + CreationDate DATETIME, + ModifiedDate DATETIME, + AccountNumber VARCHAR(50) DEFAULT '', + AccountTypeTitle VARCHAR(50) DEFAULT '', + EditionType VARCHAR(50) DEFAULT '', + UserStatus VARCHAR(8), + UserTypeId INT, + EditionTypeId INT DEFAULT '' + ) + /*SET @sFirstName = REPLACE(@sFirstName,' ',' OR ') + SET @sLastName = REPLACE(@sLastName,' ',' OR ')*/ + SET @SQL = '' + IF LEN(@sAccoutNumber) > 0 OR @iAccountTypeId > 0 + BEGIN + -- fetch account number, state, zip, country of the license to which the user is belonged + + SET @SQL = 'INSERT INTO #UserResult (Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate, + ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId) + SELECT AIAUser.Id, ISNULL(AIAUser.FirstName,''''), ISNULL(AIAUser.LastName,''''), AIAUser.LoginId, ISNULL(AIAUser.EmailId,'''') as EmailId, + UserType.Title as UserTypeTitle, AIAUser.Password, AIAUser.CreationDate, ISNULL(AIAUser.ModifiedDate,'''') as ModifiedDate, + ISNULL(License.AccountNumber,'''') as AccountNumber, ISNULL(AccountType.Title,'''') as AccountTypeTitle, + ISNULL(Edition.Title,'''') as EditionType, + (CASE AIAUser.IsActive WHEN 1 THEN ''Active'' ELSE ''Inactive'' END) as UserStatus, + UserType.Id as UserTypeId, ISNULL(Edition.Id,'''') as EditionTypeId + FROM AIAUser + INNER JOIN UserType ON UserType.Id = AIAUser.UserTypeId + INNER JOIN AIAUserToLicenseEdition ON AIAUser.Id = AIAUserToLicenseEdition.UserId + INNER JOIN LicenseToEdition ON AIAUserToLicenseEdition.LicenseEditionId = LicenseToEdition.Id + INNER JOIN License ON LicenseToEdition.LicenseId = License.Id + INNER JOIN AccountType ON AccountType.Id = License.AccountTypeId + INNER JOIN Edition ON Edition.Id = LicenseToEdition.EditionId + WHERE + License.IsActive = 1 + AND UserType.Priority >' +CONVERT(VARCHAR(20),@iLoginUserType) + + IF LEN(@sAccoutNumber)>0 + BEGIN + SET @SQL = @SQL + ' AND License.AccountNumber = '''+@sAccoutNumber+'''' + END + IF @iAccountTypeId > 0 + BEGIN + SET @SQL = @SQL + ' AND License.AccountTypeId = '''+CONVERT(VARCHAR(20),@iAccountTypeId)+'''' + END + IF LEN(@sFirstName)>0 + BEGIN + SET @SQL = @SQL + ' AND (AIAUser.FirstName LIKE ''%'+@sFirstName+'%'')' --CONTAINS(AIAUser.FirstName, '''+@sFirstName+''')' + END + IF LEN(@sLastName)>0 + BEGIN + SET @SQL = @SQL + ' AND (AIAUser.LastName LIKE ''%'+@sLastName+'%'')'--CONTAINS(AIAUser.LastName, '''+@sLastName+''')' + END + IF LEN(@sEmailId)>0 + BEGIN + SET @SQL = @SQL + ' AND AIAUser.EmailId = '''+@sEmailId+'''' + END + IF @iUserTypeId>0 + BEGIN + SET @SQL = @SQL + ' AND AIAUser.UserTypeId = '''+CONVERT(VARCHAR(20),@iUserTypeId)+'''' + END + -- select @SQL + EXEC SP_EXECUTESQL @SQL + + END + ELSE + BEGIN + + SET @SQL = 'INSERT INTO #UserResult (Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate, + ModifiedDate, UserStatus, UserTypeId) + SELECT AIAUser.Id, ISNULL(AIAUser.FirstName,''''), ISNULL(AIAUser.LastName,''''), + AIAUser.LoginId, ISNULL(AIAUser.EmailId,''''), UserType.Title, AIAUser.Password, AIAUser.CreationDate, + ISNULL(AIAUser.ModifiedDate,''''), (CASE AIAUser.IsActive WHEN 1 THEN ''Active'' ELSE ''Inactive'' END), + UserType.Id + FROM AIAUser + INNER JOIN UserType ON UserType.Id = AIAUser.UserTypeId + WHERE UserType.Title in (''General Admin'')' + + IF LEN(@sFirstName)>0 + BEGIN + SET @SQL = @SQL + ' AND (AIAUser.FirstName LIKE ''%'+@sFirstName+'%'')'--CONTAINS(AIAUser.FirstName, '''+@sFirstName+''')' + END + IF LEN(@sLastName)>0 + BEGIN + SET @SQL = @SQL + ' AND (AIAUser.LastName LIKE ''%'+@sLastName+'%'')'--CONTAINS(AIAUser.LastName, '''+@sLastName+''')' + END + IF LEN(@sEmailId)>0 + BEGIN + SET @SQL = @SQL + ' AND AIAUser.EmailId = '''+@sEmailId+'''' + END + IF @iUserTypeId>0 + BEGIN + SET @SQL = @SQL + ' AND AIAUser.UserTypeId = '''+CONVERT(VARCHAR(20),@iUserTypeId)+'''' + END + -- select @SQL + EXEC SP_EXECUTESQL @SQL + + -- fetch account number, state, zip, country of the license to which the user is belonged + SET @SQL = 'INSERT INTO #UserResult (Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate, + ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId) + SELECT AIAUser.Id, ISNULL(AIAUser.FirstName,''''), ISNULL(AIAUser.LastName,''''), AIAUser.LoginId, ISNULL(AIAUser.EmailId,''''), + UserType.Title, AIAUser.Password, AIAUser.CreationDate, ISNULL(AIAUser.ModifiedDate,''''), + License.AccountNumber, AccountType.Title, Edition.Title, + (CASE AIAUser.IsActive WHEN 1 THEN ''Active'' ELSE ''Inactive'' END), UserType.Id, Edition.Id + FROM AIAUser + INNER JOIN UserType ON UserType.Id = AIAUser.UserTypeId + INNER JOIN AIAUserToLicenseEdition ON AIAUser.Id = AIAUserToLicenseEdition.UserId + INNER JOIN LicenseToEdition ON AIAUserToLicenseEdition.LicenseEditionId = LicenseToEdition.Id + INNER JOIN License ON LicenseToEdition.LicenseId = License.Id + INNER JOIN AccountType ON AccountType.Id = License.AccountTypeId + INNER JOIN Edition ON Edition.Id = LicenseToEdition.EditionId + WHERE + UserType.Title NOT IN (''Super Admin'',''General Admin'') + AND License.IsActive = 1' + + IF LEN(@sAccoutNumber)>0 + BEGIN + SET @SQL = @SQL + ' AND License.AccountNumber = '''+@sAccoutNumber+'''' + END + IF @iAccountTypeId > 0 + BEGIN + SET @SQL = @SQL + ' AND License.AccountTypeId = '''+CONVERT(VARCHAR(20),@iAccountTypeId)+'''' + END + IF LEN(@sFirstName)>0 + BEGIN + SET @SQL = @SQL + ' AND (AIAUser.FirstName LIKE ''%'+@sFirstName+'%'')'--CONTAINS(AIAUser.FirstName, '''+@sFirstName+''')' + END + IF LEN(@sLastName)>0 + BEGIN + SET @SQL = @SQL + ' AND (AIAUser.LastName LIKE ''%'+@sLastName+'%'')'--CONTAINS(AIAUser.LastName, '''+@sLastName+''')' + END + IF LEN(@sEmailId)>0 + BEGIN + SET @SQL = @SQL + ' AND AIAUser.EmailId = '''+@sEmailId+'''' + END + IF @iUserTypeId>0 + BEGIN + SET @SQL = @SQL + ' AND AIAUser.UserTypeId = '''+CONVERT(VARCHAR(20),@iUserTypeId)+'''' + END + --select @SQL + EXEC SP_EXECUTESQL @SQL + + END + -- Selecting the desired result from temporary table + Select RowNum,Id, FirstName, LastName,LoginId, EmailId,UserTypeTitle, Password, CreationDate, + ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId,EditionTypeId + from ( + SELECT ROW_NUMBER() OVER (ORDER BY Id) AS RowNum ,Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate, + ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId FROM #UserResult) as usr + WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo order by Id --RowNum BETWEEN @pageNo AND (@pageNo - 1) * @pageLength +--SELECT RowNum, Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate, +-- ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId FROM #UserResult +-- where RowNum > (@pageLength * (@pageNo - 1)) AND (RowNo <= (@pageLength * @pageNo)) order by RowNum + -- order by Id + -- order by Id OFFSET ((@pageNo - 1) * @pageLength) ROWS FETCH NEXT @pageLength ROWS ONLY; + + + + --Calculate total number of records + select @recordCount = count(ResultTable.Id) from (SELECT Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate, + ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId FROM #UserResult) as ResultTable; + + -- Dropping the temporary table + DROP TABLE #UserResult +END + diff --git a/500-DBDump/AIA-StoredProcedures/dbo.GetUsageReport.StoredProcedure.sql b/500-DBDump/AIA-StoredProcedures/dbo.GetUsageReport.StoredProcedure.sql index 5d4b28f..3503e1a 100644 Binary files a/500-DBDump/AIA-StoredProcedures/dbo.GetUsageReport.StoredProcedure.sql and b/500-DBDump/AIA-StoredProcedures/dbo.GetUsageReport.StoredProcedure.sql differ diff --git a/500-DBDump/AIA-StoredProcedures/dbo.usp_GetUserType.sql b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetUserType.sql index 50044ee..715969f 100644 --- a/500-DBDump/AIA-StoredProcedures/dbo.usp_GetUserType.sql +++ b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetUserType.sql @@ -1,20 +1,5 @@ - -SET QUOTED_IDENTIFIER ON -GO -SET ANSI_NULLS ON -GO - -if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetUserType]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) -drop procedure [dbo].[usp_GetUserType] -GO - - --- ============================================= --- Author: magic --- Create date: 7/4/2009 --- Description: Fetch AccountType List --- ============================================= -CREATE PROCEDURE [dbo].[usp_GetUserType] + +alter PROCEDURE [dbo].[usp_GetUserType] -- Add the parameters for the stored procedure here @id int AS @@ -31,18 +16,11 @@ BEGIN else begin select Id,Title - from UserType where IsActive=1 + from UserType where IsActive=1 and Id > 1 +ORDER BY Priority end END -GO -SET QUOTED_IDENTIFIER OFF -GO -SET ANSI_NULLS ON -GO - - - \ No newline at end of file diff --git a/500-DBDump/AIA-StoredProcedures/dbo.usp_GetlicensesList.sql b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetlicensesList.sql new file mode 100644 index 0000000..bfe91ba Binary files /dev/null and b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetlicensesList.sql differ diff --git a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupController.cs b/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupController.cs deleted file mode 100644 index c4c2cd5..0000000 --- a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupController.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Web.Http; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using AIAHTML5.ADMIN.API.Models; -using System.Web.Http.Cors; -using System.Web.Cors; -using AIAHTML5.Server.Constants; -using log4net; -using System.Text; -using AIAHTML5.ADMIN.API.Entity; - -namespace AIAHTML5.ADMIN.API.Controllers -{ - [EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] - [RoutePrefix("UserGroup")] - public class UserGroupController : ApiController - { - AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); - - [Route("LicenseUserGroups")] - [HttpGet] - public HttpResponseMessage GetLicenseUserGroups(int LicenseId) - { - List UserGroupList = new List(); - try - { - UserGroupList = UserGroupModel.GetLicenseUserGroups(dbContext, LicenseId); - return Request.CreateResponse(HttpStatusCode.OK, UserGroupList); - } - catch (Exception ex) - { - // Log exception code goes here - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); - } - } - - [Route("LicenseUserGroupUsers")] - [HttpGet] - public HttpResponseMessage GetLicenseUserGroupUsers(int LicenseId, int UserGroupId) - { - List UserList = new List(); - try - { - UserList = UserGroupModel.GetLicenseUserGroupUsers(dbContext, LicenseId, UserGroupId); - return Request.CreateResponse(HttpStatusCode.OK, UserList); - } - catch (Exception ex) - { - // Log exception code goes here - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); - } - } - - [Route("InsertUpdateLicenseUserGroup")] - [HttpPost] - public HttpResponseMessage InsertUpdateLicenseUserGroup(JObject jsonData) - { - bool Status = false; - UserGroupModel UserGroupEntity = new UserGroupModel(); - UserGroupEntity.Id = jsonData["id"].Value(); - UserGroupEntity.LicenseId = jsonData["licenseId"].Value(); - UserGroupEntity.Title = jsonData["title"].Value(); - UserGroupEntity.IsActive = jsonData["isActive"].Value(); - UserGroupEntity.CreationDate = jsonData["creationDate"].Value(); - UserGroupEntity.ModifiedDate = jsonData["modifiedDate"].Value(); - try - { - Status = UserGroupModel.InsertUpdateLicenseUserGroup(dbContext, UserGroupEntity); - if (Status) - { - return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); - } - else - { - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); - } - } - catch (Exception ex) - { - // Log exception code goes here - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); - } - } - - [Route("UpdateLicenseUserGroupUsers")] - [HttpPost] - public HttpResponseMessage UpdateLicenseUserGroupUsers(JObject jsonData) - { - bool Status = false; - int UserGroupId = jsonData["userGroupId"].Value(); - string UserIds = jsonData["userIds"].Value(); - try - { - Status = UserGroupModel.UpdateLicenseUserGroupUsers(dbContext, UserGroupId, UserIds); - if (Status) - { - return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); - } - else - { - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); - } - } - catch (Exception ex) - { - // Log exception code goes here - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); - } - } - - [Route("DeleteLicenseUserGroup")] - [HttpGet] - public HttpResponseMessage DeleteLicenseUserGroup(int UserGroupId) - { - bool Status = false; - try - { - Status = UserGroupModel.DeleteLicenseUserGroup(dbContext, UserGroupId); - if (Status) - { - return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); - } - else - { - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); - } - } - catch (Exception ex) - { - // Log exception code goes here - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); - } - } - } -} diff --git a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupModel.cs b/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupModel.cs deleted file mode 100644 index 634d6c6..0000000 --- a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserGroupModel.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using AIAHTML5.ADMIN.API.Entity; - -namespace AIAHTML5.ADMIN.API.Models -{ - public class UserGroupModel - { - public int Id { get; set; } - public int LicenseId { get; set; } - public string Title { get; set; } - public DateTime? CreationDate { get; set; } - public DateTime? ModifiedDate { get; set; } - public bool? IsActive { get; set; } - public int? TotalUsers { get; set; } - - public static List GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int LicenseId) - { - List UserGroupList = new List(); - UserGroupModel UserGroupObj = new UserGroupModel(); - try - { - var result = dbContext.usp_GetLicenseUserGroups(LicenseId).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); - } - } - catch (Exception ex) { } - return UserGroupList; - } - - public static List GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int LicenseId, int UserGroupId) - { - List UserList = new List(); - UserModel UserModelObj = new UserModel(); - try - { - var result = dbContext.GetAllUserWithGroup(LicenseId, UserGroupId).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); - } - } - catch (Exception ex) { } - return UserList; - } - - public static bool InsertUpdateLicenseUserGroup(AIADatabaseV5Entities dbContext, UserGroupModel UserGroupEntity) - { - var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); - try - { - dbContext.usp_InsertUpdateLicenseUserGroup(UserGroupEntity.Id, UserGroupEntity.LicenseId, UserGroupEntity.Title, - UserGroupEntity.CreationDate, UserGroupEntity.ModifiedDate, UserGroupEntity.IsActive, spStatus); - return (bool)spStatus.Value; - } - catch (Exception ex) - { - return false; - } - } - - public static bool UpdateLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int UserGroupId, string UserIds) - { - var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); - try - { - dbContext.usp_UpdateLicenseUserGroupUsers(UserGroupId, UserIds, spStatus); - return (bool)spStatus.Value; - } - catch (Exception ex) - { - return false; - } - } - - public static bool DeleteLicenseUserGroup(AIADatabaseV5Entities dbContext, int UserGroupId) - { - var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); - try - { - dbContext.usp_DeleteLicenseUserGroup(UserGroupId, spStatus); - return (bool)spStatus.Value; - } - catch (Exception ex) - { - return false; - } - } - - } - -} \ No newline at end of file diff --git a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserModel.cs b/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserModel.cs deleted file mode 100644 index f73ebbf..0000000 --- a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/UserModel.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using AIAHTML5.ADMIN.API.Entity; - -namespace AIAHTML5.ADMIN.API.Models -{ - public class UserModel - { - public int Id { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - public string EmailId { get; set; } - public string LoginId { get; set; } - public string NewLoginId { get; set; } - public string Password { get; set; } - public int SecurityQuestionId { get; set; } - public string SecurityAnswer { get; set; } - public int CreatorId { get; set; } - public DateTime CreationDate { get; set; } - public DateTime DeactivationDate { get; set; } - public int ModifierId { get; set; } - public DateTime ModifiedDate { get; set; } - public int UserTypeId { get; set; } - public bool IsActive { get; set; } - public string ProductEdition { get; set; } - public int InGroup { get; set; } - - public static bool UpdateUserProfile(AIADatabaseV5Entities dbContext, int intUserID, string strFirstName, string strLastName, string strEmailID) - { - var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); - try - { - dbContext.UpdateUserProfile(intUserID, strFirstName, strLastName, strEmailID, spStatus); - if (spStatus.Value.ToString() == "1") - { - return true; - } - else - { - return false; - } - } - catch (Exception ex) - { - return false; - } - } - public static bool UpdateUserPassword(AIADatabaseV5Entities dbContext, int intUserID, string newPassword) - { - var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); - try - { - dbContext.UpdateAiaUserPassword(intUserID, newPassword, spStatus); - return (bool)spStatus.Value; - } - catch (Exception ex) - { - return false; - } - } - public static string UpdateUserId(AIADatabaseV5Entities dbContext, int id, string userId, string oldUserId) - { - var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); - try - { - dbContext.usp_UpdateUserId(id, userId, oldUserId, spStatus); - if (spStatus.Value.ToString() == "1") - { - // return "success"; - return "1"; - } - else if (spStatus.Value.ToString() == "2") - { - return "2"; - // return "Already Exist Userid"; - } - else - { - return "fail"; - } - } - catch (Exception ex) - { - return ex.Message; - } - } - } -} \ No newline at end of file diff --git a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/mergecode.txt b/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/mergecode.txt deleted file mode 100644 index 434a2f5..0000000 --- a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/mergecode.txt +++ /dev/null @@ -1,62 +0,0 @@ -//user.service.ts - - GetLicenseUserGroups(licensId: number) { - return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/LicenseUserGroups?LicenseId=" + licensId) - .map(this.extractData) - .catch((res: Response) => this.handleError(res)); - } - - GetLicenseUserGroupUsers(licensId: number, UserGroupId: number) { - return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/LicenseUserGroupUsers?LicenseId=" + licensId + "&UserGroupId=" + UserGroupId) - .map(this.extractData) - .catch((res: Response) => this.handleError(res)); - } - - InsertUpdateLicenseUserGroup(obj: any) { - //let options = new RequestOptions({ headers: this.headers }); - var jsonData = {'id': obj.id, 'licenseId': obj.licenseId, 'creationDate': obj.creationDate, 'modifiedDate': obj.modifiedDate, 'title': obj.title, 'isActive': obj.isActive }; - var headers = new Headers({ - 'Content-Type': 'application/json' - }); - return this.http.post(this.commonService.resourceBaseUrl + "UserGroup/InsertUpdateLicenseUserGroup", - JSON.stringify(jsonData), {headers: headers}) - .map(this.extractData) - .catch((res: Response) => this.handleError(res)); - } - - UpdateLicenseUserGroupUsers(userGroupId: number, userIds: string) { - //let options = new RequestOptions({ headers: this.headers }); - var jsonData = {'userGroupId': userGroupId, 'userIds': userIds }; - var headers = new Headers({ - 'Content-Type': 'application/json' - }); - return this.http.post(this.commonService.resourceBaseUrl + "UserGroup/UpdateLicenseUserGroupUsers", - JSON.stringify(jsonData), {headers: headers}) - .map(this.extractData) - .catch((res: Response) => this.handleError(res)); - } - - DeleteLicenseUserGroup(userGroupId: number) { - return this.http.get(this.commonService.resourceBaseUrl + "UserGroup/DeleteLicenseUserGroup?UserGroupId=" + userGroupId) - .map(this.extractData) - .catch((res: Response) => this.handleError(res)); -} - - -//app.routing.module - -import { UserGroup } from './components/UserEntity/usergroup.component'; - - - { path: 'usergroup', component: UserGroup } - - -//app.module.ts - -import { UserGroup } from './components/UserEntity/usergroup.component'; - -UserGroup - -//app.component.html - -
  • User Group
  • diff --git a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.html b/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.html deleted file mode 100644 index 9de3fd8..0000000 --- a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.html +++ /dev/null @@ -1,204 +0,0 @@ - -
    - -
    -

    {{mode}} User Group

    -
    - - - - - - - - - - - - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    - -
    -
    - - - - - - - - - - - - - - - - - -
    Group NameNumber of User(s)Created DateLast Modified Date
    - {{item.Title}} - {{item.TotalUsers}}{{item.CreationDate | date: 'MM/dd/yyyy'}}{{item.ModifiedDate | date: 'MM/dd/yyyy'}}
    -
    - -
    -
    - - - -
    -
    - -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    User group name is required
    -
    -
    -
    -
    -
    -
    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - -
    SelectFirst NameLast NameUser IDEmail IDProduct Edition
    - - - {{item.FirstName}}{{item.LastName}}{{item.UserId}}{{item.EmailId}}{{item.ProductEdition}}
    - -
    - -
    -
    - - -
    -
    - -
    - -
    - -
    -
    -
    - \ No newline at end of file diff --git a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.ts b/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.ts deleted file mode 100644 index 22449dd..0000000 --- a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/usergroup.component.ts +++ /dev/null @@ -1,267 +0,0 @@ -import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core'; -import { UserService } from './user.service'; -import { Router, ActivatedRoute } from '@angular/router'; -import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { License } from '../UserEntity/datamodel'; -import { BsDatepickerModule } from 'ngx-bootstrap'; -import { Http, Response } from '@angular/http'; -import { DatePipe } from '@angular/common'; -import { BsModalService } from 'ngx-bootstrap/modal'; -import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; - -declare var $:any; - -@Component({ - templateUrl: './usergroup.component.html' -}) - -export class UserGroup implements OnInit { - - lstAccountNumbers: any; - lstLicenseUserGroups: any; - licenseUserGroup: any; - lstLicenseUserGroupUsers: any; - lstAllUsers: any; - mode: string = 'Search'; - license: License; - updateUserGroupFrm: FormGroup; - error: any; - alerts: string; - modalAlerts: string; - divClass: string = ''; - topPos: string = '2000px'; - selectedRow: number = 0; - selectedId: number = 0; - modalRef: BsModalRef; - checkedRecords: Array; - - constructor(private userService: UserService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder, private modalService: BsModalService) { } - - ngOnInit(): void - { - this.selectedRow = 0; - this.divClass = 'col-sm-12'; - this.license = new License(); - this.alerts = ''; - this.updateUserGroupFrm = this.fb.group({ - userGroupName: ['', Validators.required], - }); - this.GetLicenseAccounts(); - - $('#fixed_hdr2').fxdHdrCol({ - fixedCols: 0, - width: "100%", - height: 330, - colModal: [ - { width: 80, align: 'center' }, - { width: 200, align: 'center' }, - { width: 200, align: 'Center' }, - { width: 200, align: 'Center' }, - { width: 200, align: 'Center' }, - { width: 250, align: 'Center' }, - ], - sort: true - }); - if(document.getElementById("fixed_table_rc") != undefined){ - 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); - } - - openModal(template: TemplateRef) { - this.modalRef = this.modalService.show(template); - } - - onChange(Idx: number, Id: number, isChecked: boolean){ - if(isChecked){ - this.checkedRecords[Idx] = Id; - } - else{ - this.checkedRecords[Idx] = 0; - } - } - - SetClickedRow(i: number, item: any) { - this.selectedRow = i; - this.selectedId = item['Id']; - this.licenseUserGroup = item; - } - - BindFormFields(data){ - this.lstLicenseUserGroups = data; - this.licenseUserGroup = this.lstLicenseUserGroups[this.selectedRow]; - this.selectedId = this.licenseUserGroup['Id']; - } - - BindUserFormFields(data){ - this.lstLicenseUserGroupUsers = data; - if(this.mode == 'Edit'){ - this.checkedRecords = new Array(this.lstLicenseUserGroupUsers.length); - for (let i = 0; i < this.lstLicenseUserGroupUsers.length ; i++) { - if(this.lstLicenseUserGroupUsers[i].InGroup > 0){ - this.checkedRecords[i] = this.lstLicenseUserGroupUsers[i].Id; - } - } - } - else{ - this.lstLicenseUserGroupUsers = this.lstLicenseUserGroupUsers.filter(C => C.InGroup> 0); - } - } - - GetLicenseAccounts() { - this.userService.GetAccountNumber() - .subscribe(st => { this.lstAccountNumbers = st; }, error => this.error = error); - } - - GetLicenseUserGroups() { - this.alerts = ''; - this.userService.GetLicenseUserGroups(this.license.LicenseId) - .subscribe(st => { this.BindFormFields(st); }, error => this.error = error); - } - - GetLicenseUserGroupUsers() { - this.alerts = ''; - this.userService.GetLicenseUserGroupUsers(this.license.LicenseId, this.selectedId) - .subscribe(st => { this.BindUserFormFields(st); }, error => this.error = error); - } - - AccountNumberChanged(LicenseId: number){ - this.license.LicenseId = LicenseId; - this.lstLicenseUserGroups = null; - this.GetLicenseUserGroups(); - } - - AfterDeleteData(data, template) { - if (data.Status == "false") { - this.alerts = "License user group delete unsuccessfull"; - } else { - this.modalAlerts = "

    License user group deleted successfully

    "; - this.modalRef = this.modalService.show(template); - this.GetLicenseUserGroups(); - } - } - - AfterInsertData(data, template) { - if (data.Status == "false") { - this.alerts = "License user group save unsuccessfull"; - } else { - this.modalAlerts = "

    License user group saved successfully

    "; - this.modalRef = this.modalService.show(template); - this.GetLicenseUserGroups(); - } - } - - AfterUpdateData(data, template) { - if (data.Status == "false") { - this.alerts = "License user group update unsuccessfull"; - } else { - this.modalAlerts = "

    License user group updated successfully

    "; - this.modalRef = this.modalService.show(template); - this.GetLicenseUserGroups(); - } - } - - InsertLicenseUserGroup(title: string, template: TemplateRef) { - this.alerts = ''; - if(title == '' || title == undefined){ - this.alerts = "Please enter a name for user group."; - return; - } - var obj = { - 'id': 0, 'licenseId': this.license.LicenseId, 'title': title, - 'isActive': true, 'creationDate': new Date(), - 'modifiedDate': new Date() - }; - if(this.alerts == ''){ - return this.userService.InsertUpdateLicenseUserGroup(obj) - .subscribe( - n => (this.AfterInsertData(n, template)), - error => this.error = error); - } - } - - UpdateLicenseUserGroup(template: TemplateRef) { - this.alerts = ''; - var obj = { - 'id': this.licenseUserGroup.Id, - 'licenseId': this.license.LicenseId, - 'title': this.updateUserGroupFrm.controls['userGroupName'].value, - 'isActive': this.licenseUserGroup.IsActive, - 'creationDate': this.licenseUserGroup.CreationDate, - 'modifiedDate': this.licenseUserGroup.ModifiedDate - }; - if(this.alerts == ''){ - return this.userService.InsertUpdateLicenseUserGroup(obj) - .subscribe( - n => ( - this.UpdateLicenseUserGroupUsers(template) - ), - error => this.error = error); - } - } - - UpdateLicenseUserGroupUsers(template: TemplateRef) { - var userIds = ''; - this.checkedRecords.filter(C => C > 0).forEach(element => { - if(element > 0){ - userIds += element + ','; - } - }); - if(userIds!=''){ - userIds = userIds.substr(0, userIds.length - 1); - } - return this.userService.UpdateLicenseUserGroupUsers(this.selectedId, userIds) - .subscribe( - n => ( - this.AfterUpdateData(n, template) - ), - error => this.error = error); - } - - DeleteLicenseUserGroup(template: TemplateRef){ - this.modalRef.hide(); - this.alerts = ''; - if(this.selectedId == 0){ - this.alerts = "Please select a license user group"; - } - if(this.alerts == ''){ - return this.userService.DeleteLicenseUserGroup(this.selectedId) - .subscribe( - data => (this.AfterDeleteData(data, template)), - error => { - this.error = error; - this.alerts = "License user group delete unsuccessfull"; - }); - } - } - - EditLicenseUserGroup(){ - $('.ft_r thead tr th:eq(0)').show(); - this.mode = 'Edit'; - this.topPos = '100px'; - this.alerts = ''; - this.updateUserGroupFrm.controls['userGroupName'].setValue(this.licenseUserGroup.Title); - this.GetLicenseUserGroupUsers(); - } - - ViewLicenseUserGroup(){ - $('.ft_r thead tr th:eq(0)').hide(); - this.mode = 'View'; - this.topPos = '100px'; - this.alerts = ''; - this.updateUserGroupFrm.controls['userGroupName'].setValue(this.licenseUserGroup.Title); - this.GetLicenseUserGroupUsers(); - } - - CancelAddEdit(){ - this.mode = 'Search'; - this.topPos = '2000px'; - this.GetLicenseUserGroups(); - this.selectedRow = this.lstLicenseUserGroups.findIndex(C => C.Id == this.selectedId); - this.SetClickedRow(this.selectedRow, this.lstLicenseUserGroups.find(C => C.Id == this.selectedId)); - } -} diff --git a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/users.component.ts b/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/users.component.ts deleted file mode 100644 index aa39cec..0000000 --- a/500-DBDump/AIA-StoredProcedures/usergroupmergecode/usergroupmergecode/users.component.ts +++ /dev/null @@ -1,324 +0,0 @@ -import { Component, OnInit, AfterViewInit,ViewChild } from '@angular/core'; -import { UserService } from './user.service'; -import { Router } from '@angular/router'; -import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { User } from '../UserEntity/datamodel'; -import { UserManageRightsModel } from '../UserEntity/datamodel'; -import { Http, Response } from '@angular/http'; -//import { Global } from '../../Shared/global'; -//import { DBOperation } from 'S'; -import { Observable } from 'rxjs/Observable'; -import { ConfirmService } from '../../Shared/Confirm/confirm.service'; -import 'rxjs/Rx'; -import 'rxjs/add/operator/map'; -import 'rxjs/add/operator/filter'; -import { LoadingService } from '../../shared/loading.service'; -declare var $: any; -import { DatePipe } from '@angular/common'; -import { GlobalService } from '../../Shared/global'; -@Component({ - templateUrl:'./users.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html' -}) - -export class UsersList implements OnInit { - - Mode: string = 'Manage'; - modalTitle: string; - Users: FormGroup; - adduserFrm: FormGroup; - managerightFrm: FormGroup; - alerts: string; - public UserTypeList: any; - public AccountTypeList: any; - public UserList: any; - public UserManageRightsList: Array; - emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"; - public UserTypeListByLicense: any; - public AccountNumberList: any; - public ProductEditionList: any; - UserEntity: User; - public UserManageRightsEntity: UserManageRightsModel; - topPos: string = '2000px'; - datePipe: DatePipe = new DatePipe('en-US'); - error; - selectedRow: number = 0; - selectedId: number = 0; - divClass: string; - isActive: boolean; - NoRecord: string; - //@ViewChild("profileModal") - //profileModal: ModalComponent; - //errorMessage: any; - constructor(private _loadingService: LoadingService,private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http, - private _confirmService: ConfirmService,private global:GlobalService - ) { } - - ngOnInit(): void { - this.modalTitle = 'LIST USER'; - this.alerts = ''; - this.NoRecord = this.global.NoRecords; - this.Users = this.fb.group({ - FirstName:[''], - LastName: [''], - EmailId: [''], - AccountNumber: [''], - UserTypeId: [0], //bug#28162 - AccountTypeId: [0] - // Gender: ['', Validators.required], - // Email: [''] - - }); - this.adduserFrm = this.fb.group({ - id: [''], - UserName: ['', Validators.required], - Password: ['', [Validators.required, Validators.minLength(8)]], - ConfirmPassword: ['', Validators.required], - FirstName: ['', Validators.required], - LastName: ['', Validators.required], - EmailId: ['', Validators.required], - AccountNumber: [''], - UserType: [''], - AccountType: [''], - Createddate: [''], - LastModifiedDate: [''], - Createdby: [''], - Modifiedby: [''], - DeactivationDate: [''], - isActive: [false], - UserStatusActive: ['false'], - UserStatusInActive:[''] - }); - this.managerightFrm = this.fb.group({ - id: [''], - UserTypeTitle: [''] - }); - this._loadingService.ShowLoading("global-loading"); - this.GetUserType(); - this.GetAccountType(); - this._loadingService.HideLoading("global-loading"); - $('#fixed_hdr2').fxdHdrCol({ - fixedCols: 0, - width: "100%", - height: 300, - colModal: [ - { width: 180, align: 'center' }, - { width: 230, align: 'center' }, - { width: 150, align: 'Center' }, - { width: 150, align: 'Center' }, - { width: 350, align: 'Center' }, - { width: 200, align: 'Center' }, - { width: 130, align: 'Center' }, - { width: 120, align: 'center' }, - { width: 280, align: 'Center' }, - { width: 180, align: 'center' }, - { width: 200, align: 'center' }, - { width: 170, align: 'center' }, - { width: 80, 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' }, - ], - sort: true - }); - 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); - this._loadingService.ShowLoading("global-loading"); - //this.bindUsers(); - this._loadingService.HideLoading("global-loading"); - - //this.GetUserList(); - } - handleChange(evt) { - debugger; - var target = evt.target; - if (target.value == 'true') { - this.isActive = true; - } - else if (target.value == 'false') { - this.isActive = false; - } - } - - public SetClickedRow(i: number, item: any) { - this.selectedRow = i; - this.selectedId = item['Id']; - this.UserEntity = item; - } - public SetClickedRowManageRight(j: number, item: any) { - this.selectedRow = j; - this.selectedId = item['Id']; - this.UserManageRightsList = item; - } - redirect() { - this.router.navigate(['/']); - } - - GetUserType() { - this.userservice.GetUserType().subscribe(x => { this.UserTypeList = x; }, error => this.error = error); - } - 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, - UserType: this.managerightFrm.controls['UserTypeTitle'].value - }) - .subscribe(x => { console.log(x); this.UserManageRightsList = x }, error => { - this.error = error; - this.alerts = "" + this.error + ""; - }); - } - SearchUserList(this) - { - this._loadingService.ShowLoading("global-loading"); - var UserFilterControl = this.Users.value; - 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), - - - }) - - .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); - - } - BindFormFields(data) { - this.UserList = data; - 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"); - } - } - EditUser() { - debugger; - this.Mode = 'Edit'; - this.modalTitle = 'Edit USER'; - this.topPos = '100px'; - this.divClass = 'col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3'; - this.alerts = ''; - this.adduserFrm.controls['id'].setValue(this.UserEntity.Id) - this.adduserFrm.controls['FirstName'].setValue(this.UserEntity.FirstName) - this.adduserFrm.controls['LastName'].setValue(this.UserEntity.LastName) - this.adduserFrm.controls['EmailId'].setValue(this.UserEntity.EmailId) - this.adduserFrm.controls['UserName'].setValue(this.UserEntity.LoginId) - this.adduserFrm.controls['Password'].setValue(this.UserEntity.Password) - this.adduserFrm.controls['ConfirmPassword'].setValue(this.UserEntity.Password) - this.adduserFrm.controls['AccountNumber'].setValue(this.UserEntity.AccountNumber) - this.adduserFrm.controls['UserType'].setValue(this.UserEntity.UserTypeTitle) - this.adduserFrm.controls['AccountType'].setValue(this.UserEntity.AccountTypeTitle) - this.adduserFrm.controls['Createddate'].setValue(this.datePipe.transform(this.UserEntity.CreationDate, 'MM/dd/yyyy')) - this.adduserFrm.controls['LastModifiedDate'].setValue(this.datePipe.transform(this.UserEntity.ModifiedDate, 'MM/dd/yyyy')) - this.adduserFrm.controls['Createdby'].setValue(this.UserEntity.Createdby) - this.adduserFrm.controls['Modifiedby'].setValue(this.UserEntity.Modifiedby) - this.adduserFrm.controls['DeactivationDate'].setValue(this.datePipe.transform(this.UserEntity.DeactivationDate, 'MM/dd/yyyy')) - if (this.UserEntity.UserStatus == 'Active') { - this.adduserFrm.controls['UserStatusActive'].setValue('true') - } - else { - this.adduserFrm.controls['UserStatusActive'].setValue('false') - } - //this.adduserFrm.controls['UserStatusActive'].setValue(true) - //this.adduserFrm.controls['UserStatusInActive'].setValue(false) - this.isActive = (this.UserEntity.UserStatus=='Active'?true :false) - - } - - EditManageUserRights() { - this.Mode = 'ManageRight'; - this.modalTitle = 'MANAGE USER Right'; - this.topPos = '100px'; - this.divClass = 'col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3'; - this.alerts = ''; - this.managerightFrm.controls['id'].setValue(this.UserEntity.Id); - this.managerightFrm.controls['UserTypeTitle'].setValue(this.UserEntity.UserTypeTitle); - this.GetUserRights(); - } - - public UpdateUser(this) { - this.alerts = ''; - if (this.adduserFrm.value.UserName == '') { - this.alerts += 'User Name is required.'; - } - if (this.adduserFrm.value.Password == '') { - this.alerts += '
    Password of minimum 8 characters is required.'; - } - if (this.adduserFrm.value.ConfirmPassword == '') { - this.alerts += '
    Confirm Password is required.'; - } - if (this.adduserFrm.value.EmailId == '') { - this.alerts += '
    Email Id is required.'; - } - if (this.adduserFrm.value.FirstName == '') { - this.alerts += '
    First Name is required.'; - } - if (this.adduserFrm.value.LastName == '') { - this.alerts += '
    Last Name is required.'; - } - if (this.adduserFrm.value.newPassword != this.adduserFrm.value.confirmPassword) { - this.alerts += '
    Password and confirm password must be same'; - } - - if (this.adduserFrm.valid && this.alerts == '') { - this.adduserFrm.controls['isActive'].setValue(this.adduserFrm.value.UserStatusActive) - - var UserEntity = this.adduserFrm.value; - - return this.userservice.UpdateUserEntity(UserEntity) - .subscribe( - n => (this.AfterInsertData(n)), - error => { - this.error = error; - this.alerts = "" + this.error + ""; - }); - } - - } - - //public DeleteUnblockedUser(this) { - // this.alerts = ''; - //} - - AfterInsertData(data) { - - if (data == "User updated successfully") { - this.alerts = ''; - this._confirmService.activate("User updated successfully.", "alertMsg"); - } - //if (this.closeflag) { - // this.close.emit(null); - //} - //else { - //} - } - - ResetFormFields() { - //this.ChangeUserIdFrm.reset() - //this.ChangeUserIdFrm.controls['id'].setValue(this.user.Id) - //this.ChangeUserIdFrm.controls['loginid'].setValue(this.user.LoginId) - //this.ChangeUserIdFrm.controls['newloginid'].setValue('') - //this.ChangeUserIdFrm.controls['confirmloginid'].setValue('') - this.alerts = ''; - } - -} diff --git a/500-DBDump/AIA-StoredProcedures/usp_GetAccountNumber.sql b/500-DBDump/AIA-StoredProcedures/usp_GetAccountNumber.sql index 9102522..7942094 100644 Binary files a/500-DBDump/AIA-StoredProcedures/usp_GetAccountNumber.sql and b/500-DBDump/AIA-StoredProcedures/usp_GetAccountNumber.sql differ diff --git a/500-DBDump/AIA-StoredProcedures/usp_GetlicensesList.sql b/500-DBDump/AIA-StoredProcedures/usp_GetlicensesList.sql new file mode 100644 index 0000000..bfe91ba Binary files /dev/null and b/500-DBDump/AIA-StoredProcedures/usp_GetlicensesList.sql differ -- libgit2 0.21.4