From e3e725ed15ee945d684f3994c5813f030f52e243 Mon Sep 17 00:00:00 2001 From: gagan.deep Date: Tue, 20 Mar 2018 16:20:47 +0530 Subject: [PATCH] Testing on AIA Admin --- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs | 17 +++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs | 32 ++++++++++++++++++-------------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx | 33 +++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs | 13 +++++++++++++ 500-DBDump/AIA-StoredProcedures/dbo.GetCancelledLicenses.StoredProcedure.sql | Bin 13706 -> 0 bytes 500-DBDump/AIA-StoredProcedures/dbo.GetCustomerSummary.StoredProcedure.sql | Bin 15912 -> 0 bytes 500-DBDump/AIA-StoredProcedures/dbo.GetExpiringLicenses.StoredProcedure.sql | Bin 13414 -> 0 bytes 500-DBDump/AIA-StoredProcedures/dbo.GetSubscribedLicenses.StoredProcedure.sql | Bin 12752 -> 0 bytes 500-DBDump/AIA-StoredProcedures/usp_CheckAccountNoExists.sql | 39 +++++++++++++++++++++++++++++++++++++++ 10 files changed, 169 insertions(+), 22 deletions(-) create mode 100644 500-DBDump/AIA-StoredProcedures/usp_CheckAccountNoExists.sql diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index 909dcce..639ea4b 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -391,5 +391,22 @@ namespace AIAHTML5.ADMIN.API.Controllers } } + [Route("CheckAccountNumber")] + [HttpGet] + public HttpResponseMessage CheckAccountNumber(string AccountNo) + { + bool Status = false; + try + { + Status = LicenseModel.CheckAccountNumber(dbContext, AccountNo); + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs index a964441..600ef6a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs @@ -33,36 +33,40 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetCustomerSummeryReport")] [HttpGet] - public IHttpActionResult GetCustomerSummeryReport(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, int iLicenseType, int iAccountType, string sZip, int iState, int iCountry) + 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) { - var lstCustomerSummeryReport = dbContext.GetCustomerSummary(sAccoutNumber, sLicenseeFullName, iStartPrice, iEndPrice, (byte)iLicenseType, (byte)iAccountType, sZip, iState, iCountry).ToList(); - return Ok(lstCustomerSummeryReport); + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); + var lstCustomerSummeryReport = dbContext.GetCustomerSummary(sAccoutNumber, sLicenseeFullName, iStartPrice, iEndPrice, (byte)iLicenseType, (byte)iAccountType, sZip, iState, iCountry,pageNo,pageLength,spRecordCount).ToList(); + return Ok(new { CustomerSummery = lstCustomerSummeryReport, RecordCount = spRecordCount.Value }); + //return Ok(lstCustomerSummeryReport); } [Route("GetExpiringSubscriptionReport")] [HttpGet] - public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, decimal iStartPrice, decimal 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, int pageNo, int pageLength) { - var lstExpiringSubscriptionReport = dbContext.GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList(); - return Ok(lstExpiringSubscriptionReport); + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); + var lstExpiringSubscriptionReport = dbContext.GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList(); + return Ok(new { ExpiringSubscription = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value }); + } [Route("GetSubscriptionReport")] [HttpGet] - public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) + public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength) { - - var lstExpiringSubscriptionReport = dbContext.GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList(); - return Ok(lstExpiringSubscriptionReport); + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); + var lstExpiringSubscriptionReport = dbContext.GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList(); + return Ok(new { Subscription = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value }); } [Route("GetSubscriptionCancellationReport")] [HttpGet] - public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) + public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength) { - - var lstExpiringSubscriptionReport = dbContext.GetCancelledLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList(); - return Ok(lstExpiringSubscriptionReport); + var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); + var lstExpiringSubscriptionReport = dbContext.GetCancelledLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList(); + return Ok(new { SubscriptionCancel = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value }); } [Route("GetNetAdSummaryReport")] diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index bb3942f..228e18b 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -971,7 +971,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetCAMSearch", sSearchKeywordParameter); } - public virtual ObjectResult GetCancelledLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId) + public virtual ObjectResult GetCancelledLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -1009,7 +1009,15 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountryId", iCountryId) : new ObjectParameter("iCountryId", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetCancelledLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter); + 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("GetCancelledLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual int GetContentAttributeData(Nullable iContentTypeId) @@ -1030,7 +1038,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetContentList", iContentTypeIdParameter); } - public virtual ObjectResult GetCustomerSummary(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseType, Nullable iAccountType, string sZip, Nullable iState, Nullable iCountry) + public virtual ObjectResult 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) { var sAccoutNumberParameter = sAccoutNumber != null ? new ObjectParameter("sAccoutNumber", sAccoutNumber) : @@ -1068,7 +1076,15 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountry", iCountry) : new ObjectParameter("iCountry", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetCustomerSummary", sAccoutNumberParameter, sLicenseeFullNameParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeParameter, iAccountTypeParameter, 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("GetCustomerSummary", sAccoutNumberParameter, sLicenseeFullNameParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeParameter, iAccountTypeParameter, sZipParameter, iStateParameter, iCountryParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult GetDiscountDetails(string sDiscountCode, string sStartDate, string sEndDate) @@ -1149,7 +1165,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetEncyclopediaSearch", iLexiconIdParameter, sSearchKeywordParameter); } - public virtual ObjectResult GetExpiringLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId) + public virtual ObjectResult GetExpiringLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -1187,7 +1203,15 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountryId", iCountryId) : new ObjectParameter("iCountryId", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetExpiringLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter); + 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("GetExpiringLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult GetExportedImageDetails(string sStartDate, string sEndDate, string sAccoutNumber) @@ -1546,7 +1570,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetSiteLicenseUsageReport", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, iEditionIdParameter); } - public virtual ObjectResult GetSubscribedLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId) + public virtual ObjectResult GetSubscribedLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -1584,7 +1608,15 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountryId", iCountryId) : new ObjectParameter("iCountryId", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetSubscribedLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter); + 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("GetSubscribedLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult GetSubscriptionDetailsByLicenseId(Nullable iLicenseId) @@ -3693,5 +3725,14 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetSearchUsers", sFirstNameParameter, sLastNameParameter, sEmailIdParameter, sAccoutNumberParameter, iUserTypeIdParameter, iAccountTypeIdParameter, iLoginUserTypeParameter, pageNoParameter, pageLengthParameter, recordCount); } + + public virtual int usp_CheckAccountNoExists(string accountNo, ObjectParameter status) + { + var accountNoParameter = accountNo != null ? + new ObjectParameter("AccountNo", accountNo) : + new ObjectParameter("AccountNo", typeof(string)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_CheckAccountNoExists", accountNoParameter, status); + } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index f717949..9ea5f41 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -2074,6 +2074,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + @@ -2091,6 +2094,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + @@ -2133,6 +2139,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + @@ -2263,6 +2272,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + @@ -2630,6 +2642,10 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + @@ -5711,6 +5727,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + @@ -5728,6 +5747,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + @@ -5765,6 +5787,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + @@ -5886,6 +5911,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + @@ -6495,6 +6523,10 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + @@ -10024,6 +10056,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index a3304dc..1a6bd58 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -421,6 +421,19 @@ namespace AIAHTML5.ADMIN.API.Models } } + public static bool CheckAccountNumber(AIADatabaseV5Entities dbContext, string AccountNo) + { + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); + try + { + dbContext.usp_CheckAccountNoExists(AccountNo, spStatus); + return (bool)spStatus.Value; + } + catch (Exception ex) + { + return false; + } + } } public class LicenseTypeModel diff --git a/500-DBDump/AIA-StoredProcedures/dbo.GetCancelledLicenses.StoredProcedure.sql b/500-DBDump/AIA-StoredProcedures/dbo.GetCancelledLicenses.StoredProcedure.sql index 786a507..d666b72 100644 Binary files a/500-DBDump/AIA-StoredProcedures/dbo.GetCancelledLicenses.StoredProcedure.sql and b/500-DBDump/AIA-StoredProcedures/dbo.GetCancelledLicenses.StoredProcedure.sql differ diff --git a/500-DBDump/AIA-StoredProcedures/dbo.GetCustomerSummary.StoredProcedure.sql b/500-DBDump/AIA-StoredProcedures/dbo.GetCustomerSummary.StoredProcedure.sql index a27d5b1..2ae08dc 100644 Binary files a/500-DBDump/AIA-StoredProcedures/dbo.GetCustomerSummary.StoredProcedure.sql and b/500-DBDump/AIA-StoredProcedures/dbo.GetCustomerSummary.StoredProcedure.sql differ diff --git a/500-DBDump/AIA-StoredProcedures/dbo.GetExpiringLicenses.StoredProcedure.sql b/500-DBDump/AIA-StoredProcedures/dbo.GetExpiringLicenses.StoredProcedure.sql index d15707a..05d1e59 100644 Binary files a/500-DBDump/AIA-StoredProcedures/dbo.GetExpiringLicenses.StoredProcedure.sql and b/500-DBDump/AIA-StoredProcedures/dbo.GetExpiringLicenses.StoredProcedure.sql differ diff --git a/500-DBDump/AIA-StoredProcedures/dbo.GetSubscribedLicenses.StoredProcedure.sql b/500-DBDump/AIA-StoredProcedures/dbo.GetSubscribedLicenses.StoredProcedure.sql index 588c3be..4542922 100644 Binary files a/500-DBDump/AIA-StoredProcedures/dbo.GetSubscribedLicenses.StoredProcedure.sql and b/500-DBDump/AIA-StoredProcedures/dbo.GetSubscribedLicenses.StoredProcedure.sql differ diff --git a/500-DBDump/AIA-StoredProcedures/usp_CheckAccountNoExists.sql b/500-DBDump/AIA-StoredProcedures/usp_CheckAccountNoExists.sql new file mode 100644 index 0000000..a99c181 --- /dev/null +++ b/500-DBDump/AIA-StoredProcedures/usp_CheckAccountNoExists.sql @@ -0,0 +1,39 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_CheckAccountNoExists]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_CheckAccountNoExists] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 06-March-2018 +-- Description: To get all the Editions +-- ==================================================== +create PROCEDURE [dbo].[usp_CheckAccountNoExists] + @AccountNo varchar(50), @Status bit out + -- Add the parameters for the stored procedure here +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + set @Status = 0; + -- Insert statements for procedure here + if(exists(select * from License where Lower(AccountNumber) = Lower(@AccountNo))) + begin + set @Status = 1; + end +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO + + + + -- libgit2 0.21.4