private async void Submit() { if (!ValidateInputData()) { return; } var filepondStatus = await JsModule.InvokeAsync <bool>("checkIfFilepondBusy"); if (filepondStatus) { CurrentPage.ShowNotification("Files are still uploading."); return; } _showLoadingIndicator = true; await InvokeAsync(StateHasChanged); var newBriefing = new Briefing { Server = Server, Origin = DepartureAirport.ToUpper(), Destination = ArrivalAirport.ToUpper(), OriginRunway = DepartureRunway.ToUpper(), DestinationRunway = ArrivalRunway.ToUpper(), FlightLevel = FlightLevel, CruiseSpeed = GetActualCruiseSpeed(CruiseSpeed), DepartureTime = DepartureTimeSelect.GetDateTime(), TimeEnroute = TimeEnrouteSelect.GetTimeSpan().Ticks, FlightPlan = FlightPlan.ToUpper(), Author = Author, Remarks = Remarks, EditPassword = EditPassword, ViewPassword = ViewPassword, CreatedOn = DateTime.UtcNow }; var attachments = await JsModule.InvokeAsync <string[]>("getFilepondFileIds"); newBriefing.AttachmentsArray = attachments; _newBriefingId = int.Parse(await ApiService.MakeBriefing(newBriefing)); _showLoadingIndicator = false; _showCompleted = true; await JsModule.InvokeVoidAsync("unregisterEvents"); await InvokeAsync(StateHasChanged); }
private async void Submit() { if (!_authenticated) { return; } if (!ValidateInputData()) { return; } var filepondStatus = await JsModule.InvokeAsync <bool>("checkIfFilepondBusy"); if (filepondStatus) { CurrentPage.ShowNotification("Files are still uploading."); return; } _showLoadingIndicator = true; await InvokeAsync(StateHasChanged); var attachments = await JsModule.InvokeAsync <string[]>("getFilepondFileIds"); // Edit the original briefing entity _editedBriefing.Server = Server; _editedBriefing.Origin = DepartureAirport.ToUpper(); _editedBriefing.OriginRunway = DepartureRunway.ToUpper(); _editedBriefing.Destination = ArrivalAirport.ToUpper(); _editedBriefing.DestinationRunway = ArrivalRunway.ToUpper(); _editedBriefing.FlightLevel = FlightLevel; _editedBriefing.CruiseSpeed = GetActualCruiseSpeed(CruiseSpeed); _editedBriefing.DepartureTime = DepartureTimeSelect.GetDateTime(); _editedBriefing.TimeEnroute = TimeEnrouteSelect.GetTimeSpan().Ticks; _editedBriefing.FlightPlan = FlightPlan.ToUpper(); _editedBriefing.Author = Author; _editedBriefing.Remarks = Remarks; _editedBriefing.LastEdited = DateTime.UtcNow; _editedBriefing.AttachmentsArray = attachments; _editedBriefing.ViewPassword = _briefingType == "Public" ? "none" : ViewPassword; await ApiService.EditBriefing(_actualBriefingId, _editedBriefing, _editPassword); // Done editing, return to the briefing page. NavManager.NavigateTo($"/b/{BriefingId}"); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (AirlineClass != null) { hashCode = hashCode * 59 + AirlineClass.GetHashCode(); } if (ArrivalAirport != null) { hashCode = hashCode * 59 + ArrivalAirport.GetHashCode(); } if (ArrivalTime != null) { hashCode = hashCode * 59 + ArrivalTime.GetHashCode(); } if (CarrierCode != null) { hashCode = hashCode * 59 + CarrierCode.GetHashCode(); } if (ConjunctionTicket != null) { hashCode = hashCode * 59 + ConjunctionTicket.GetHashCode(); } if (CouponNumber != null) { hashCode = hashCode * 59 + CouponNumber.GetHashCode(); } if (Date != null) { hashCode = hashCode * 59 + Date.GetHashCode(); } if (DepartureTime != null) { hashCode = hashCode * 59 + DepartureTime.GetHashCode(); } if (EndorsementOrRestriction != null) { hashCode = hashCode * 59 + EndorsementOrRestriction.GetHashCode(); } if (ExchangeTicket != null) { hashCode = hashCode * 59 + ExchangeTicket.GetHashCode(); } if (Fare != null) { hashCode = hashCode * 59 + Fare.GetHashCode(); } if (FareBasis != null) { hashCode = hashCode * 59 + FareBasis.GetHashCode(); } if (Fee != null) { hashCode = hashCode * 59 + Fee.GetHashCode(); } if (FlightNumber != null) { hashCode = hashCode * 59 + FlightNumber.GetHashCode(); } if (Number != null) { hashCode = hashCode * 59 + Number.GetHashCode(); } if (OriginAirport != null) { hashCode = hashCode * 59 + OriginAirport.GetHashCode(); } if (PassengerClass != null) { hashCode = hashCode * 59 + PassengerClass.GetHashCode(); } if (ServiceClass != null) { hashCode = hashCode * 59 + ServiceClass.GetHashCode(); } if (StopoverCode != null) { hashCode = hashCode * 59 + StopoverCode.GetHashCode(); } if (Taxes != null) { hashCode = hashCode * 59 + Taxes.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if AirlineFlightLeg instances are equal /// </summary> /// <param name="other">Instance of AirlineFlightLeg to be compared</param> /// <returns>Boolean</returns> public bool Equals(AirlineFlightLeg other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( AirlineClass == other.AirlineClass || AirlineClass != null && AirlineClass.Equals(other.AirlineClass) ) && ( ArrivalAirport == other.ArrivalAirport || ArrivalAirport != null && ArrivalAirport.Equals(other.ArrivalAirport) ) && ( ArrivalTime == other.ArrivalTime || ArrivalTime != null && ArrivalTime.Equals(other.ArrivalTime) ) && ( CarrierCode == other.CarrierCode || CarrierCode != null && CarrierCode.Equals(other.CarrierCode) ) && ( ConjunctionTicket == other.ConjunctionTicket || ConjunctionTicket != null && ConjunctionTicket.Equals(other.ConjunctionTicket) ) && ( CouponNumber == other.CouponNumber || CouponNumber != null && CouponNumber.Equals(other.CouponNumber) ) && ( Date == other.Date || Date != null && Date.Equals(other.Date) ) && ( DepartureTime == other.DepartureTime || DepartureTime != null && DepartureTime.Equals(other.DepartureTime) ) && ( EndorsementOrRestriction == other.EndorsementOrRestriction || EndorsementOrRestriction != null && EndorsementOrRestriction.Equals(other.EndorsementOrRestriction) ) && ( ExchangeTicket == other.ExchangeTicket || ExchangeTicket != null && ExchangeTicket.Equals(other.ExchangeTicket) ) && ( Fare == other.Fare || Fare != null && Fare.Equals(other.Fare) ) && ( FareBasis == other.FareBasis || FareBasis != null && FareBasis.Equals(other.FareBasis) ) && ( Fee == other.Fee || Fee != null && Fee.Equals(other.Fee) ) && ( FlightNumber == other.FlightNumber || FlightNumber != null && FlightNumber.Equals(other.FlightNumber) ) && ( Number == other.Number || Number != null && Number.Equals(other.Number) ) && ( OriginAirport == other.OriginAirport || OriginAirport != null && OriginAirport.Equals(other.OriginAirport) ) && ( PassengerClass == other.PassengerClass || PassengerClass != null && PassengerClass.Equals(other.PassengerClass) ) && ( ServiceClass == other.ServiceClass || ServiceClass != null && ServiceClass.Equals(other.ServiceClass) ) && ( StopoverCode == other.StopoverCode || StopoverCode != null && StopoverCode.Equals(other.StopoverCode) ) && ( Taxes == other.Taxes || Taxes != null && Taxes.Equals(other.Taxes) )); }