Esempio n. 1
0
 public static void validateEmerAddVehicle(VehicleEmerInfo vehicleEmerInfo)
 {
     if (string.IsNullOrEmpty(vehicleEmerInfo.Name))
     {
         throw new DataValidationException($"Name does not exists");
     }
     if (string.IsNullOrEmpty(vehicleEmerInfo.Number))
     {
         throw new DataValidationException($"Number does not exists");
     }
 }
 public IActionResult EditEmer([FromBody] VehicleEmerInfo vehicleEmerInfo)
 {
     try
     {
         Validator.validateEmerEditVehicle(vehicleEmerInfo);
         DAVechile dAVechile = new DAVechile();
         return(this.OKResponse(dAVechile.EditEmer(_context, vehicleEmerInfo, User.ToAppUser()) ? "Updated Successfully" : "Updation Failed"));
     }
     catch (DataValidationException ex)
     {
         return(this.KnowOperationError(ex.Message));
     }
 }