Release with this version 1.0.0
This commit is contained in:
@@ -77,7 +77,7 @@ namespace CarParkValidationAPI.Repository
|
||||
model.StafflinkNo = dto.StafflinkNo;
|
||||
model.Active = dto.Active;
|
||||
model.AddedBy = dto.AddedBy;
|
||||
model.AddedOn = dto.AddedOn;
|
||||
model.AddedOn = dto.AddedOn.ToLocalTime();
|
||||
model.ValidationPointID = dto.ValidationPointId;
|
||||
return model;
|
||||
}
|
||||
@@ -162,6 +162,7 @@ namespace CarParkValidationAPI.Repository
|
||||
model.LastModified = DateTime.Now;
|
||||
model.LastModifiedId = _currentUser;
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -170,7 +171,7 @@ namespace CarParkValidationAPI.Repository
|
||||
_context.AdminUsers.Add(model);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
result = 1;
|
||||
result = model.UserID;
|
||||
statuscode = 1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -135,8 +135,8 @@ namespace CarParkValidationAPI.Repository
|
||||
model.LastModifiedId = _currentUser;
|
||||
_context.ConcessionTypes.Add(model);
|
||||
var id = await _context.SaveChangesAsync();
|
||||
result = id;
|
||||
item.Id = id;
|
||||
result = model.ConcessionTypeID;
|
||||
|
||||
}
|
||||
statuscode = 1;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace CarParkValidationAPI.Repository
|
||||
private readonly DataContext _context;
|
||||
private readonly IOptions<AppSettings> _appSettings;
|
||||
const string DateFormat = "dd-MM-yyyy HH:mm";
|
||||
const string dateFormat = "dd-MM-yyyyy";
|
||||
public ConcessionValidationReportRepository(
|
||||
DataContext context, IOptions<AppSettings> appSettings)
|
||||
{
|
||||
@@ -42,8 +43,8 @@ namespace CarParkValidationAPI.Repository
|
||||
sl.SetCellStyle(1, 5, style);
|
||||
sl.SetRowHeight(1, 1, 25);
|
||||
sl.SetCellValue(row++, 5, "The ConssionValidation Report");
|
||||
|
||||
sl.SetCellValue(1, 8, " " + DateTime.Now.ToString("ddd dd/MM/yyyy HH:mm"));
|
||||
sl.SetCellValue(row, 3, "Date Range: " + fromDate.ToString(dateFormat) + " - " + toDate.ToString(dateFormat) );
|
||||
sl.SetCellValue(1, 6, " " + DateTime.Now.ToString("ddd dd/MM/yyyy HH:mm"));
|
||||
|
||||
int startTitleRow = 3;
|
||||
row = startTitleRow;
|
||||
@@ -55,8 +56,8 @@ namespace CarParkValidationAPI.Repository
|
||||
sl.SetRowHeight(startTitleRow, startTitleRow, 25);
|
||||
// add the title first
|
||||
sl.SetCellValue(row, col++, "Date");
|
||||
sl.SetCellValue(row, col++, "Concession Card");
|
||||
sl.SetCellValue(row, col++, "Concession Holder");
|
||||
sl.SetCellValue(row, col++, "Concession Card Number");
|
||||
sl.SetCellValue(row, col++, "Concession Holder Name");
|
||||
sl.SetCellValue(row, col++, "Expiry date checked");
|
||||
sl.SetCellValue(row, col++, "ConcessionType");
|
||||
sl.SetCellValue(row, col++, "Validation Piont");
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace CarParkValidationAPI.Repository
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<ResultModel<List<ConcessionValidationExtDto>>> LoadConcessionValidationStaffLinkNoAsync(string staffLinkNo, DateTime currentDate)
|
||||
public async Task<ResultModel<List<ConcessionValidationExtDto>>> LoadConcessionValidationStaffLinkNoAsync(string staffLinkNo, DateTime fromDate, DateTime toDate)
|
||||
{
|
||||
List<ConcessionValidationExtDto> result = new List<ConcessionValidationExtDto>();
|
||||
// ConcessionValidationExtDto dto;
|
||||
@@ -127,13 +127,12 @@ namespace CarParkValidationAPI.Repository
|
||||
string error = "";
|
||||
try
|
||||
{
|
||||
|
||||
//List<ConcessionValidation> clist = await _context.ConcessionValidations.Where(x =>
|
||||
// x.Active == true
|
||||
// && x.StafflinkNo == staffLinkNo
|
||||
// && x.ValidateDate.Date == currentDate.Date
|
||||
//).ToListAsync();
|
||||
result = await _context.SelectConcessionValidationByStaffId(true, staffLinkNo, currentDate, currentDate);
|
||||
result = await _context.SelectConcessionValidationByStaffId(true, staffLinkNo, fromDate, toDate);
|
||||
/*
|
||||
//var clist = await _context.SPSelectValidation(true, staffLinkNo, currentDate);
|
||||
for (int i = 0; i < clist.Count; i++)
|
||||
@@ -141,11 +140,10 @@ namespace CarParkValidationAPI.Repository
|
||||
model = clist[i];
|
||||
dto = FillConcessionValidationExtDto(model);
|
||||
result.Add(dto);
|
||||
|
||||
}
|
||||
*/
|
||||
statuscode = 1;
|
||||
|
||||
result.Sort((x, y) => x.ValidateDate.CompareTo(y.ValidateDate));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -295,6 +293,7 @@ namespace CarParkValidationAPI.Repository
|
||||
model.CreatedId = _currentUser;
|
||||
_context.ConcessionValidations.Add(model);
|
||||
result = await _context.SaveChangesAsync();
|
||||
result = model.ValidationID;
|
||||
}
|
||||
statuscode = 1;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace CarParkValidationAPI.Repository
|
||||
string error = "";
|
||||
try
|
||||
{
|
||||
|
||||
result = await _context.Validations.Where(x => x.Active == onlyActive).Select(
|
||||
x => new LookupCodeDto()
|
||||
{
|
||||
|
||||
@@ -132,8 +132,8 @@ namespace CarParkValidationAPI.Repository
|
||||
model = FillValidationModel(item, model);
|
||||
_context.Validations.Add(model);
|
||||
var id = await _context.SaveChangesAsync();
|
||||
result = id;
|
||||
item.Id = id;
|
||||
result = model.ValidationPointID;
|
||||
|
||||
}
|
||||
statuscode = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user