public IActionResult DeleteLocker([FromQuery] string Mac_address)
 {
     if (_lockerRepo.DeleteLocker(Mac_address))
     {
         return(Ok());
     }
     return(NotFound());
 }
Esempio n. 2
0
        public IActionResult DeleteLocker([FromBody] LockerForm locker)
        {
            TimeZoneInfo zone     = TimeZoneInfo.FindSystemTimeZoneById("SE Asia Standard Time");
            DateTime     dateTime = TimeZoneInfo.ConvertTime(DateTime.Now, zone);

            //if deletinfg locker success
            if (_lockerRepo.DeleteLocker(locker.Mac_address))
            {
                Log.Information("Delete Locker {Mac_address} OK. {DateTime}.", locker.Mac_address, dateTime);
                return(Ok(locker.Mac_address));
            }
            //if deletinfg locker fail
            else
            {
                Log.Information("Delete Locker No {Mac_address} Error. {DateTime}.", locker.Mac_address, dateTime);
                return(NotFound(locker.Mac_address));
            }
        }