public IActionResult DeleteVacancy([FromQuery] string No_vacant, string Mac_address) { if (_vacancyRepo.DeleteVacancy(No_vacant, Mac_address)) { return(Ok()); } return(NotFound()); }
public IActionResult DeleteVacancy([FromQuery] string No_vacant, string Mac_address) { TimeZoneInfo zone = TimeZoneInfo.FindSystemTimeZoneById("SE Asia Standard Time"); DateTime dateTime = TimeZoneInfo.ConvertTime(DateTime.Now, zone); if (_vacancyRepo.DeleteVacancy(No_vacant, Mac_address)) { Log.Information("Delete vacancy {no}, {mac} OK. {datetime}", No_vacant, Mac_address, dateTime); return(Ok("Delete vacancy complete.")); } else { Log.Information("Cannot Delete vacancy {no}, {mac}. {datetime}.", No_vacant, Mac_address, dateTime); return(NotFound("Delete vacancy fail.")); } }