Commit 3bae8f858fa188ae29f6674c12441e52c0cf9933

Authored by Birendra Kumar
2 parents 80148e17 1930ed6c

Merge branch 'AIABugFixes' into AIA_Develop

400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/CommonController.cs
@@ -94,7 +94,7 @@ namespace AIAHTML5.ADMIN.API.Controllers @@ -94,7 +94,7 @@ namespace AIAHTML5.ADMIN.API.Controllers
94 string sStartDate = DateTime.MinValue.ToShortDateString(); 94 string sStartDate = DateTime.MinValue.ToShortDateString();
95 string sEndDate = DateTime.MaxValue.ToShortDateString(); 95 string sEndDate = DateTime.MaxValue.ToShortDateString();
96 var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); 96 var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
97 - var lstDiscountCode = dbContext.usp_GetDiscountCodes("", "", "","Id","asc", 1, 1, spRecordCount).ToList(); 97 + var lstDiscountCode = dbContext.usp_GetDiscountCodes("", "", "","Id","asc",false, 1, 1, spRecordCount).ToList();
98 lstDiscountCode1 = lstDiscountCode.Select(l => new usp_GetDiscountCodes_Result { Id = l.Id, DiscountCode = l.DiscountCode }).ToList(); 98 lstDiscountCode1 = lstDiscountCode.Select(l => new usp_GetDiscountCodes_Result { Id = l.Id, DiscountCode = l.DiscountCode }).ToList();
99 return Ok(lstDiscountCode1); 99 return Ok(lstDiscountCode1);
100 } 100 }
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs
@@ -25,13 +25,13 @@ namespace AIAHTML5.ADMIN.API.Controllers @@ -25,13 +25,13 @@ namespace AIAHTML5.ADMIN.API.Controllers
25 25
26 [Route("GetDiscountCodes")] 26 [Route("GetDiscountCodes")]
27 [HttpGet] 27 [HttpGet]
28 - public HttpResponseMessage GetDiscountCodes(string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength) 28 + public HttpResponseMessage GetDiscountCodes(string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength,bool isGridBind)
29 { 29 {
30 List<usp_GetDiscountCodes_Result> DiscountCodeList; 30 List<usp_GetDiscountCodes_Result> DiscountCodeList;
31 int recordCount = 0; 31 int recordCount = 0;
32 try 32 try
33 { 33 {
34 - DiscountCodeList = DiscountCodeModel.GetDiscountCodes(dbContext, discountCode, startDate, endDate, sortColumn, sortOrder, pageNo, pageLength, out recordCount); 34 + DiscountCodeList = DiscountCodeModel.GetDiscountCodes(dbContext, discountCode, startDate, endDate, sortColumn, sortOrder, pageNo, pageLength,isGridBind, out recordCount);
35 return Request.CreateResponse(HttpStatusCode.OK, new { DiscountCodeList = DiscountCodeList, RecordCount = recordCount }); 35 return Request.CreateResponse(HttpStatusCode.OK, new { DiscountCodeList = DiscountCodeList, RecordCount = recordCount });
36 } 36 }
37 catch (Exception ex) 37 catch (Exception ex)
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
@@ -4005,7 +4005,7 @@ namespace AIAHTML5.ADMIN.API.Entity @@ -4005,7 +4005,7 @@ namespace AIAHTML5.ADMIN.API.Entity
4005 return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetCustomerSummary_Result>("usp_GetCustomerSummary", sAccoutNumberParameter, sLicenseeFullNameParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeParameter, iAccountTypeParameter, sZipParameter, iStateParameter, iCountryParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); 4005 return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetCustomerSummary_Result>("usp_GetCustomerSummary", sAccoutNumberParameter, sLicenseeFullNameParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeParameter, iAccountTypeParameter, sZipParameter, iStateParameter, iCountryParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount);
4006 } 4006 }
4007 4007
4008 - public virtual ObjectResult<usp_GetDiscountCodes_Result> usp_GetDiscountCodes(string sDiscountCode, string sStartDate, string sEndDate, string sortColumn, string sortOrder, Nullable<int> pageNo, Nullable<int> pageLength, ObjectParameter recordCount) 4008 + public virtual ObjectResult<usp_GetDiscountCodes_Result> usp_GetDiscountCodes(string sDiscountCode, string sStartDate, string sEndDate, string sortColumn, string sortOrder, Nullable<bool> isGridBind, Nullable<int> pageNo, Nullable<int> pageLength, ObjectParameter recordCount)
4009 { 4009 {
4010 var sDiscountCodeParameter = sDiscountCode != null ? 4010 var sDiscountCodeParameter = sDiscountCode != null ?
4011 new ObjectParameter("sDiscountCode", sDiscountCode) : 4011 new ObjectParameter("sDiscountCode", sDiscountCode) :
@@ -4027,6 +4027,10 @@ namespace AIAHTML5.ADMIN.API.Entity @@ -4027,6 +4027,10 @@ namespace AIAHTML5.ADMIN.API.Entity
4027 new ObjectParameter("sortOrder", sortOrder) : 4027 new ObjectParameter("sortOrder", sortOrder) :
4028 new ObjectParameter("sortOrder", typeof(string)); 4028 new ObjectParameter("sortOrder", typeof(string));
4029 4029
  4030 + var isGridBindParameter = isGridBind.HasValue ?
  4031 + new ObjectParameter("isGridBind", isGridBind) :
  4032 + new ObjectParameter("isGridBind", typeof(bool));
  4033 +
4030 var pageNoParameter = pageNo.HasValue ? 4034 var pageNoParameter = pageNo.HasValue ?
4031 new ObjectParameter("pageNo", pageNo) : 4035 new ObjectParameter("pageNo", pageNo) :
4032 new ObjectParameter("pageNo", typeof(int)); 4036 new ObjectParameter("pageNo", typeof(int));
@@ -4035,7 +4039,7 @@ namespace AIAHTML5.ADMIN.API.Entity @@ -4035,7 +4039,7 @@ namespace AIAHTML5.ADMIN.API.Entity
4035 new ObjectParameter("pageLength", pageLength) : 4039 new ObjectParameter("pageLength", pageLength) :
4036 new ObjectParameter("pageLength", typeof(int)); 4040 new ObjectParameter("pageLength", typeof(int));
4037 4041
4038 - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetDiscountCodes_Result>("usp_GetDiscountCodes", sDiscountCodeParameter, sStartDateParameter, sEndDateParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); 4042 + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetDiscountCodes_Result>("usp_GetDiscountCodes", sDiscountCodeParameter, sStartDateParameter, sEndDateParameter, sortColumnParameter, sortOrderParameter, isGridBindParameter, pageNoParameter, pageLengthParameter, recordCount);
4039 } 4043 }
4040 4044
4041 public virtual ObjectResult<usp_GetDiscountReport_Result> usp_GetDiscountReport(string sStartDate, string sEndDate, Nullable<int> intDiscountID, string sAccoutNumber, string sortColumn, string sortOrder, Nullable<int> pageNo, Nullable<int> pageLength, ObjectParameter recordCount) 4045 public virtual ObjectResult<usp_GetDiscountReport_Result> usp_GetDiscountReport(string sStartDate, string sEndDate, Nullable<int> intDiscountID, string sAccoutNumber, string sortColumn, string sortOrder, Nullable<int> pageNo, Nullable<int> pageLength, ObjectParameter recordCount)
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
@@ -1004,6 +1004,7 @@ @@ -1004,6 +1004,7 @@
1004 <Parameter Name="sEndDate" Type="varchar" Mode="In" /> 1004 <Parameter Name="sEndDate" Type="varchar" Mode="In" />
1005 <Parameter Name="sortColumn" Type="varchar" Mode="In" /> 1005 <Parameter Name="sortColumn" Type="varchar" Mode="In" />
1006 <Parameter Name="sortOrder" Type="varchar" Mode="In" /> 1006 <Parameter Name="sortOrder" Type="varchar" Mode="In" />
  1007 + <Parameter Name="isGridBind" Type="bit" Mode="In" />
1007 <Parameter Name="pageNo" Type="int" Mode="In" /> 1008 <Parameter Name="pageNo" Type="int" Mode="In" />
1008 <Parameter Name="pageLength" Type="int" Mode="In" /> 1009 <Parameter Name="pageLength" Type="int" Mode="In" />
1009 <Parameter Name="recordCount" Type="int" Mode="InOut" /> 1010 <Parameter Name="recordCount" Type="int" Mode="InOut" />
@@ -2761,6 +2762,7 @@ @@ -2761,6 +2762,7 @@
2761 <Parameter Name="sEndDate" Mode="In" Type="String" /> 2762 <Parameter Name="sEndDate" Mode="In" Type="String" />
2762 <Parameter Name="sortColumn" Mode="In" Type="String" /> 2763 <Parameter Name="sortColumn" Mode="In" Type="String" />
2763 <Parameter Name="sortOrder" Mode="In" Type="String" /> 2764 <Parameter Name="sortOrder" Mode="In" Type="String" />
  2765 + <Parameter Name="isGridBind" Mode="In" Type="Boolean" />
2764 <Parameter Name="pageNo" Mode="In" Type="Int32" /> 2766 <Parameter Name="pageNo" Mode="In" Type="Int32" />
2765 <Parameter Name="pageLength" Mode="In" Type="Int32" /> 2767 <Parameter Name="pageLength" Mode="In" Type="Int32" />
2766 <Parameter Name="recordCount" Mode="InOut" Type="Int32" /> 2768 <Parameter Name="recordCount" Mode="InOut" Type="Int32" />
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/DiscountCodeModel.cs
@@ -15,14 +15,14 @@ namespace AIAHTML5.ADMIN.API.Models @@ -15,14 +15,14 @@ namespace AIAHTML5.ADMIN.API.Models
15 public bool IsActive { get; set; } 15 public bool IsActive { get; set; }
16 public decimal Percentage { get; set; } 16 public decimal Percentage { get; set; }
17 17
18 - public static List<usp_GetDiscountCodes_Result> GetDiscountCodes(AIADatabaseV5Entities dbContext, string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength, out int recordCount) 18 + public static List<usp_GetDiscountCodes_Result> GetDiscountCodes(AIADatabaseV5Entities dbContext, string discountCode, DateTime startDate, DateTime endDate, string sortColumn, string sortOrder, int pageNo, int pageLength, bool isGridBind, out int recordCount)
19 { 19 {
20 List<usp_GetDiscountCodes_Result> DiscountCodeList = new List<usp_GetDiscountCodes_Result>(); 20 List<usp_GetDiscountCodes_Result> DiscountCodeList = new List<usp_GetDiscountCodes_Result>();
21 var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); 21 var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
22 recordCount = 0; 22 recordCount = 0;
23 try 23 try
24 { 24 {
25 - DiscountCodeList = dbContext.usp_GetDiscountCodes(discountCode, startDate.ToString("MM/dd/yyyy"), endDate.ToString("MM/dd/yyyy"), sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); 25 + DiscountCodeList = dbContext.usp_GetDiscountCodes(discountCode, startDate.ToString("MM/dd/yyyy"), endDate.ToString("MM/dd/yyyy"), sortColumn, sortOrder,isGridBind, pageNo, pageLength, spRecordCount).ToList();
26 26
27 recordCount = (int)spRecordCount.Value; 27 recordCount = (int)spRecordCount.Value;
28 } 28 }
400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts
@@ -62,7 +62,8 @@ scrWidth:any; @@ -62,7 +62,8 @@ scrWidth:any;
62 sortColumn:'Id', 62 sortColumn:'Id',
63 sortOrder:'asc', 63 sortOrder:'asc',
64 pageNo:1, 64 pageNo:1,
65 - pageLength:10 65 + pageLength:10,
  66 + isGridBind:true
66 } 67 }
67 @HostListener('window:resize', ['$event']) 68 @HostListener('window:resize', ['$event'])
68 getScreenSize(event?) { 69 getScreenSize(event?) {
@@ -324,7 +325,8 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat @@ -324,7 +325,8 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat
324 sortColumn:'Id', 325 sortColumn:'Id',
325 sortOrder:'asc', 326 sortOrder:'asc',
326 pageNo: 1, 327 pageNo: 1,
327 - pageLength: 5 328 + pageLength: 5,
  329 + isGridBind:true
328 }) 330 })
329 .subscribe(x => 331 .subscribe(x =>
330 { 332 {
400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts
@@ -29,11 +29,11 @@ export class ManageDiscountCodeService { @@ -29,11 +29,11 @@ export class ManageDiscountCodeService {
29 + obj.discountCode 29 + obj.discountCode
30 + "&startDate=" + obj.startDate 30 + "&startDate=" + obj.startDate
31 + "&endDate=" + obj.endDate 31 + "&endDate=" + obj.endDate
32 - + "&endDate=" + obj.endDate  
33 + "&sortColumn=" + obj.sortColumn 32 + "&sortColumn=" + obj.sortColumn
34 + "&sortOrder=" + obj.sortOrder 33 + "&sortOrder=" + obj.sortOrder
35 + "&pageNo=" + obj.pageNo 34 + "&pageNo=" + obj.pageNo
36 + "&pageLength=" + obj.pageLength 35 + "&pageLength=" + obj.pageLength
  36 + + "&isGridBind=" + obj.isGridBind
37 ) 37 )
38 .map(this.extractData) 38 .map(this.extractData)
39 .catch((res: Response) => this.handleError(res)); 39 .catch((res: Response) => this.handleError(res));
400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts
@@ -61,7 +61,7 @@ export class DiscountCodeReport implements OnInit { @@ -61,7 +61,7 @@ export class DiscountCodeReport implements OnInit {
61 sFromDate:new Date(), 61 sFromDate:new Date(),
62 sToDate:new Date(), 62 sToDate:new Date(),
63 iDiscountCode:0, 63 iDiscountCode:0,
64 - iAccountNumber:'', 64 + sAccountNumber:'',
65 sortColumn:'StartDate', 65 sortColumn:'StartDate',
66 sortOrder:'asc', 66 sortOrder:'asc',
67 pageNo:1, 67 pageNo:1,
@@ -188,8 +188,11 @@ export class DiscountCodeReport implements OnInit { @@ -188,8 +188,11 @@ export class DiscountCodeReport implements OnInit {
188 discountCode: '', 188 discountCode: '',
189 startDate: '', 189 startDate: '',
190 endDate: '', 190 endDate: '',
  191 + sortColumn:'DiscountCode',
  192 + sortOrder:'asc',
191 pageNo: 1, 193 pageNo: 1,
192 - pageLength: 10000 194 + pageLength: 10000,
  195 + isGridBind:false
193 }) 196 })
194 .subscribe(x => { this.lstDiscountCode = x.DiscountCodeList; }, error => this.error = error); 197 .subscribe(x => { this.lstDiscountCode = x.DiscountCodeList; }, error => this.error = error);
195 } 198 }
@@ -240,7 +243,7 @@ export class DiscountCodeReport implements OnInit { @@ -240,7 +243,7 @@ export class DiscountCodeReport implements OnInit {
240 this.SearchField.sFromDate=this.DiscountCodeReportForm.controls['sFromDate'].value; 243 this.SearchField.sFromDate=this.DiscountCodeReportForm.controls['sFromDate'].value;
241 this.SearchField.sToDate=this.DiscountCodeReportForm.controls['sToDate'].value; 244 this.SearchField.sToDate=this.DiscountCodeReportForm.controls['sToDate'].value;
242 this.SearchField.iDiscountCode=this.DiscountCodeReportForm.controls['iDiscountCode'].value; 245 this.SearchField.iDiscountCode=this.DiscountCodeReportForm.controls['iDiscountCode'].value;
243 - this.SearchField.iAccountNumber=this.DiscountCodeReportForm.controls['iAccountNumber'].value; 246 + this.SearchField.sAccountNumber=this.DiscountCodeReportForm.controls['iAccountNumber'].value;
244 247
245 this.SearchField.pageNo=this.pageNo; 248 this.SearchField.pageNo=this.pageNo;
246 249