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 94 string sStartDate = DateTime.MinValue.ToShortDateString();
95 95 string sEndDate = DateTime.MaxValue.ToShortDateString();
96 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 98 lstDiscountCode1 = lstDiscountCode.Select(l => new usp_GetDiscountCodes_Result { Id = l.Id, DiscountCode = l.DiscountCode }).ToList();
99 99 return Ok(lstDiscountCode1);
100 100 }
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/DiscountCodeController.cs
... ... @@ -25,13 +25,13 @@ namespace AIAHTML5.ADMIN.API.Controllers
25 25  
26 26 [Route("GetDiscountCodes")]
27 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 30 List<usp_GetDiscountCodes_Result> DiscountCodeList;
31 31 int recordCount = 0;
32 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 35 return Request.CreateResponse(HttpStatusCode.OK, new { DiscountCodeList = DiscountCodeList, RecordCount = recordCount });
36 36 }
37 37 catch (Exception ex)
... ...
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
... ... @@ -4005,7 +4005,7 @@ namespace AIAHTML5.ADMIN.API.Entity
4005 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 4010 var sDiscountCodeParameter = sDiscountCode != null ?
4011 4011 new ObjectParameter("sDiscountCode", sDiscountCode) :
... ... @@ -4027,6 +4027,10 @@ namespace AIAHTML5.ADMIN.API.Entity
4027 4027 new ObjectParameter("sortOrder", sortOrder) :
4028 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 4034 var pageNoParameter = pageNo.HasValue ?
4031 4035 new ObjectParameter("pageNo", pageNo) :
4032 4036 new ObjectParameter("pageNo", typeof(int));
... ... @@ -4035,7 +4039,7 @@ namespace AIAHTML5.ADMIN.API.Entity
4035 4039 new ObjectParameter("pageLength", pageLength) :
4036 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 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 1004 <Parameter Name="sEndDate" Type="varchar" Mode="In" />
1005 1005 <Parameter Name="sortColumn" Type="varchar" Mode="In" />
1006 1006 <Parameter Name="sortOrder" Type="varchar" Mode="In" />
  1007 + <Parameter Name="isGridBind" Type="bit" Mode="In" />
1007 1008 <Parameter Name="pageNo" Type="int" Mode="In" />
1008 1009 <Parameter Name="pageLength" Type="int" Mode="In" />
1009 1010 <Parameter Name="recordCount" Type="int" Mode="InOut" />
... ... @@ -2761,6 +2762,7 @@
2761 2762 <Parameter Name="sEndDate" Mode="In" Type="String" />
2762 2763 <Parameter Name="sortColumn" Mode="In" Type="String" />
2763 2764 <Parameter Name="sortOrder" Mode="In" Type="String" />
  2765 + <Parameter Name="isGridBind" Mode="In" Type="Boolean" />
2764 2766 <Parameter Name="pageNo" Mode="In" Type="Int32" />
2765 2767 <Parameter Name="pageLength" Mode="In" Type="Int32" />
2766 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 15 public bool IsActive { get; set; }
16 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 20 List<usp_GetDiscountCodes_Result> DiscountCodeList = new List<usp_GetDiscountCodes_Result>();
21 21 var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0);
22 22 recordCount = 0;
23 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 27 recordCount = (int)spRecordCount.Value;
28 28 }
... ...
400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.component.ts
... ... @@ -62,7 +62,8 @@ scrWidth:any;
62 62 sortColumn:'Id',
63 63 sortOrder:'asc',
64 64 pageNo:1,
65   - pageLength:10
  65 + pageLength:10,
  66 + isGridBind:true
66 67 }
67 68 @HostListener('window:resize', ['$event'])
68 69 getScreenSize(event?) {
... ... @@ -324,7 +325,8 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat
324 325 sortColumn:'Id',
325 326 sortOrder:'asc',
326 327 pageNo: 1,
327   - pageLength: 5
  328 + pageLength: 5,
  329 + isGridBind:true
328 330 })
329 331 .subscribe(x =>
330 332 {
... ...
400-SOURCECODE/Admin/src/app/components/ManageDiscountCode/managediscountcode.service.ts
... ... @@ -29,11 +29,11 @@ export class ManageDiscountCodeService {
29 29 + obj.discountCode
30 30 + "&startDate=" + obj.startDate
31 31 + "&endDate=" + obj.endDate
32   - + "&endDate=" + obj.endDate
33 32 + "&sortColumn=" + obj.sortColumn
34 33 + "&sortOrder=" + obj.sortOrder
35 34 + "&pageNo=" + obj.pageNo
36 35 + "&pageLength=" + obj.pageLength
  36 + + "&isGridBind=" + obj.isGridBind
37 37 )
38 38 .map(this.extractData)
39 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 61 sFromDate:new Date(),
62 62 sToDate:new Date(),
63 63 iDiscountCode:0,
64   - iAccountNumber:'',
  64 + sAccountNumber:'',
65 65 sortColumn:'StartDate',
66 66 sortOrder:'asc',
67 67 pageNo:1,
... ... @@ -188,8 +188,11 @@ export class DiscountCodeReport implements OnInit {
188 188 discountCode: '',
189 189 startDate: '',
190 190 endDate: '',
  191 + sortColumn:'DiscountCode',
  192 + sortOrder:'asc',
191 193 pageNo: 1,
192   - pageLength: 10000
  194 + pageLength: 10000,
  195 + isGridBind:false
193 196 })
194 197 .subscribe(x => { this.lstDiscountCode = x.DiscountCodeList; }, error => this.error = error);
195 198 }
... ... @@ -240,7 +243,7 @@ export class DiscountCodeReport implements OnInit {
240 243 this.SearchField.sFromDate=this.DiscountCodeReportForm.controls['sFromDate'].value;
241 244 this.SearchField.sToDate=this.DiscountCodeReportForm.controls['sToDate'].value;
242 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 248 this.SearchField.pageNo=this.pageNo;
246 249  
... ...