add trim and can report name
This commit is contained in:
@@ -77,9 +77,9 @@ namespace CarParkValidationAPI.Repository
|
||||
model.ConcessionTypeID = dto.ConcessionTypeId;
|
||||
model.ValidationID = dto.Id;
|
||||
model.StafflinkNo = dto.StafflinkNo;
|
||||
model.StaffFirstName = dto.StaffFirstName;
|
||||
model.StaffLastName = dto.StaffLastName;
|
||||
model.StaffEmail = dto.StaffEmail;
|
||||
model.StaffFirstName = dto.StaffFirstName.Trim();
|
||||
model.StaffLastName = dto.StaffLastName.Trim();
|
||||
model.StaffEmail = dto.StaffEmail.Trim();
|
||||
model.ValidateDate = dto.ValidateDate.ToLocalTime();
|
||||
model.ValidationPointID = dto.ValidationPointId;
|
||||
return model;
|
||||
@@ -170,7 +170,7 @@ namespace CarParkValidationAPI.Repository
|
||||
string message = "warning you already add concession card on this date!";
|
||||
try
|
||||
{
|
||||
var anyRecord = await _context.SelectCheckConcessionValidationAsync(currentDate.ToLocalTime().Date, concessionCard, staffLinkNo);
|
||||
var anyRecord = await _context.SelectCheckConcessionValidationAsync(currentDate.ToLocalTime().Date, concessionCard.Trim(), staffLinkNo.Trim());
|
||||
|
||||
if (anyRecord.Count > number)
|
||||
{
|
||||
@@ -203,12 +203,13 @@ namespace CarParkValidationAPI.Repository
|
||||
{
|
||||
int statuscode = 1;
|
||||
int result = 1;
|
||||
string concard = concessionCard.Trim();
|
||||
string message = "warning you already add concession card on this date!";
|
||||
try
|
||||
{
|
||||
var anyRecord = await _context.ConcessionValidations.Where(x =>
|
||||
x.StafflinkNo == staffLinkNo
|
||||
&& x.ConcessionCard == concessionCard
|
||||
&& x.ConcessionCard == concard
|
||||
&& x.Active == true
|
||||
&& x.ValidateDate.Date == currentDate.ToLocalTime().Date
|
||||
).ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user