コード例 #1
0
        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);
        }
コード例 #2
0
        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;
            }
        }