diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs
index 3e87f6a..36a4565 100644
--- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs
+++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs
@@ -94,7 +94,7 @@ namespace AIAHTML5.ADMIN.API.Controllers
string sStartDate = DateTime.MinValue.ToShortDateString();
string sEndDate = DateTime.MaxValue.ToShortDateString();
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
- var lstDiscountCode = dbContext.usp_GetDiscountCodes("", "", "","Id","asc", 1, 1, spRecordCount).ToList();
+ var lstDiscountCode = dbContext.usp_GetDiscountCodes("", "", "","Id","asc",false, 1, 1, spRecordCount).ToList();
lstDiscountCode1 = lstDiscountCode.Select(l => new usp_GetDiscountCodes_Result { Id = l.Id, DiscountCode = l.DiscountCode }).ToList();
return Ok(lstDiscountCode1);
}
diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs
index 29a90cb..bda927b 100644
--- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs
+++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs
@@ -25,13 +25,13 @@ namespace AIAHTML5.ADMIN.API.Controllers
[Route("GetDiscountCodes")]
[HttpGet]
- public HttpResponseMessage GetDiscountCodes(string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength)
+ public HttpResponseMessage GetDiscountCodes(string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength,bool isGridBind)
{
List DiscountCodeList;
int recordCount = 0;
try
{
- DiscountCodeList = DiscountCodeModel.GetDiscountCodes(dbContext, discountCode, startDate, endDate, sortColumn, sortOrder, pageNo, pageLength, out recordCount);
+ DiscountCodeList = DiscountCodeModel.GetDiscountCodes(dbContext, discountCode, startDate, endDate, sortColumn, sortOrder, pageNo, pageLength,isGridBind, out recordCount);
return Request.CreateResponse(HttpStatusCode.OK, new { DiscountCodeList = DiscountCodeList, RecordCount = recordCount });
}
catch (Exception ex)
diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
index 005c9f6..8ba55e9 100644
--- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
+++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
@@ -4005,7 +4005,7 @@ namespace AIAHTML5.ADMIN.API.Entity
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCustomerSummary", sAccoutNumberParameter, sLicenseeFullNameParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeParameter, iAccountTypeParameter, sZipParameter, iStateParameter, iCountryParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount);
}
- public virtual ObjectResult usp_GetDiscountCodes(string sDiscountCode, string sStartDate, string sEndDate, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount)
+ public virtual ObjectResult usp_GetDiscountCodes(string sDiscountCode, string sStartDate, string sEndDate, string sortColumn, string sortOrder, Nullable isGridBind, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount)
{
var sDiscountCodeParameter = sDiscountCode != null ?
new ObjectParameter("sDiscountCode", sDiscountCode) :
@@ -4027,6 +4027,10 @@ namespace AIAHTML5.ADMIN.API.Entity
new ObjectParameter("sortOrder", sortOrder) :
new ObjectParameter("sortOrder", typeof(string));
+ var isGridBindParameter = isGridBind.HasValue ?
+ new ObjectParameter("isGridBind", isGridBind) :
+ new ObjectParameter("isGridBind", typeof(bool));
+
var pageNoParameter = pageNo.HasValue ?
new ObjectParameter("pageNo", pageNo) :
new ObjectParameter("pageNo", typeof(int));
@@ -4035,7 +4039,7 @@ namespace AIAHTML5.ADMIN.API.Entity
new ObjectParameter("pageLength", pageLength) :
new ObjectParameter("pageLength", typeof(int));
- return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountCodes", sDiscountCodeParameter, sStartDateParameter, sEndDateParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount);
+ return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountCodes", sDiscountCodeParameter, sStartDateParameter, sEndDateParameter, sortColumnParameter, sortOrderParameter, isGridBindParameter, pageNoParameter, pageLengthParameter, recordCount);
}
public virtual ObjectResult usp_GetDiscountReport(string sStartDate, string sEndDate, Nullable intDiscountID, string sAccoutNumber, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount)
diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
index 1295ad2..c9eb68b 100644
--- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
+++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
@@ -1004,6 +1004,7 @@
+
@@ -2761,6 +2762,7 @@
+
diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs
index 1ea92bd..0002c46 100644
--- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs
+++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs
@@ -15,14 +15,14 @@ namespace AIAHTML5.ADMIN.API.Models
public bool IsActive { get; set; }
public decimal Percentage { get; set; }
- public static List GetDiscountCodes(AIADatabaseV5Entities dbContext, string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount)
+ public static List GetDiscountCodes(AIADatabaseV5Entities dbContext, string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength, bool isGridBind, out int recordCount)
{
List DiscountCodeList = new List();
var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
recordCount = 0;
try
{
- DiscountCodeList = dbContext.usp_GetDiscountCodes(discountCode, startDate.ToString("MM/dd/yyyy"), endDate.ToString("MM/dd/yyyy"), sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList();
+ DiscountCodeList = dbContext.usp_GetDiscountCodes(discountCode, startDate.ToString("MM/dd/yyyy"), endDate.ToString("MM/dd/yyyy"), sortColumn, sortOrder,isGridBind, pageNo, pageLength, spRecordCount).ToList();
recordCount = (int)spRecordCount.Value;
}
diff --git a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts
index c59d863..dc99700 100644
--- a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts
@@ -62,7 +62,8 @@ scrWidth:any;
sortColumn:'Id',
sortOrder:'asc',
pageNo:1,
- pageLength:10
+ pageLength:10,
+ isGridBind:true
}
@HostListener('window:resize', ['$event'])
getScreenSize(event?) {
@@ -324,7 +325,8 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat
sortColumn:'Id',
sortOrder:'asc',
pageNo: 1,
- pageLength: 5
+ pageLength: 5,
+ isGridBind:true
})
.subscribe(x =>
{
diff --git a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts
index 6c11cd6..cf40567 100644
--- a/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts
+++ b/400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts
@@ -29,11 +29,11 @@ export class ManageDiscountCodeService {
+ obj.discountCode
+ "&startDate=" + obj.startDate
+ "&endDate=" + obj.endDate
- + "&endDate=" + obj.endDate
+ "&sortColumn=" + obj.sortColumn
+ "&sortOrder=" + obj.sortOrder
+ "&pageNo=" + obj.pageNo
+ "&pageLength=" + obj.pageLength
+ + "&isGridBind=" + obj.isGridBind
)
.map(this.extractData)
.catch((res: Response) => this.handleError(res));
diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts
index e213afb..d86cd82 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts
@@ -61,7 +61,7 @@ export class DiscountCodeReport implements OnInit {
sFromDate:new Date(),
sToDate:new Date(),
iDiscountCode:0,
- iAccountNumber:'',
+ sAccountNumber:'',
sortColumn:'StartDate',
sortOrder:'asc',
pageNo:1,
@@ -188,8 +188,11 @@ export class DiscountCodeReport implements OnInit {
discountCode: '',
startDate: '',
endDate: '',
+ sortColumn:'DiscountCode',
+ sortOrder:'asc',
pageNo: 1,
- pageLength: 10000
+ pageLength: 10000,
+ isGridBind:false
})
.subscribe(x => { this.lstDiscountCode = x.DiscountCodeList; }, error => this.error = error);
}
@@ -240,7 +243,7 @@ export class DiscountCodeReport implements OnInit {
this.SearchField.sFromDate=this.DiscountCodeReportForm.controls['sFromDate'].value;
this.SearchField.sToDate=this.DiscountCodeReportForm.controls['sToDate'].value;
this.SearchField.iDiscountCode=this.DiscountCodeReportForm.controls['iDiscountCode'].value;
- this.SearchField.iAccountNumber=this.DiscountCodeReportForm.controls['iAccountNumber'].value;
+ this.SearchField.sAccountNumber=this.DiscountCodeReportForm.controls['iAccountNumber'].value;
this.SearchField.pageNo=this.pageNo;