public async Task <FBCustomerParkingSlot> GetAllLotParkedVehicles(string Key) { FBCustomerParkingSlot lstFBLocationLotParkedVehicles = new FBCustomerParkingSlot(); try { var ParkedVehicles = (await firebase.Child("CustomerParkingSlot").OnceAsync <FBCustomerParkingSlot>()).ToList(); lstFBLocationLotParkedVehicles = ParkedVehicles.Where(item => item.Key == Key).SingleOrDefault().Object; } catch (Exception ex) { throw ex; } return(lstFBLocationLotParkedVehicles); }
public async void UpdateWarningCountFirebaseCustomerParkingSlot(FBCustomerParkingSlot lstFBLocationLotParkedVehicles, string Key) { try { var ParkedVehicles = (await firebase.Child("CustomerParkingSlot").OnceAsync <FBCustomerParkingSlot>()).ToList(); var resulCustomer = ParkedVehicles.Where(item => item.Key == Key).SingleOrDefault().Object; if (lstFBLocationLotParkedVehicles != null && lstFBLocationLotParkedVehicles.RegistrationNumber != "") { resulCustomer.IsClamp = lstFBLocationLotParkedVehicles.IsClamp; resulCustomer.IsWarning = lstFBLocationLotParkedVehicles.IsWarning; resulCustomer.ViolationReasonID.ViolationReasonID = lstFBLocationLotParkedVehicles.ViolationReasonID.ViolationReasonID; resulCustomer.UpdatedBy.UserID = lstFBLocationLotParkedVehicles.UpdatedBy.UserID; resulCustomer.ViolationWarningCount = (lstFBLocationLotParkedVehicles.ViolationWarningCount + 1); await firebase .Child("CustomerParkingSlot") .Child(lstFBLocationLotParkedVehicles.FBCustomerParkingSlotKey).PutAsync(resulCustomer); } } catch (Exception ex) { throw ex; } }