private FlightLogViewModel CreateFlightLogViewModel(FlightLog flightLog) { var viewModel = new FlightLogViewModel(); var activeLocations = flightProgramsRepository.GetAllActiveProgramLocations(); var activeAircraft = flightProgramsRepository.GetAllActiveAircraftMds(); if (flightLog != null) { Mapper.Map<FlightLog, FlightLogViewModel>(flightLog, viewModel); activeLocations = activeLocations.Union(new ProgramLocation[] { flightLog.Location }); } viewModel.SetActiveLocations(activeLocations); viewModel.SetActiveAircraft(activeAircraft); viewModel.IsFlightLogManager = CurrentUser.Roles.FlightLogManager; return viewModel; }
private FlightLog CreateFlightLog() { var flightLog = new FlightLog { LogDate = DateTime.UtcNow, AircraftMDS = "C130J", AircraftSerialNumber = "THX1138", Location = new ProgramLocation() { Name = "Marietta, GA", Program = new FlightProgram() { Name = "TFS", AccountName = "TFS", Active = true, }, }, }; flightLog.Missions = new HashedSet<Mission> { new Mission { FlightLog = flightLog, Name = "Test Flight 1", FromICAO = "KATL", ToICAO = "KATL", TakeOffTime = "0930", LandingTime = "1645", TouchAndGos = 2, FullStops = 1, Sorties = 1, Totals = 1, AdditionalInfo = "not empty", }, new Mission { FlightLog = flightLog, Name = "Test Flight 2", FromICAO = "KATL", ToICAO = "KATL", TakeOffTime = "2200", LandingTime = "0100", TouchAndGos = 4, FullStops = 2, Sorties = 2, Totals = 1, AdditionalInfo = "not empty", } }; flightLog.SquadronLogs = new HashedSet<SquadronLog> { new SquadronLog { FlightLog = flightLog, Person = new Person { User = new User { FirstName = "Joseph", LastName = "Daigle", }, SocialSecurityLastFour = "0728", }, DutyCode = DutyCode.PIC, PrimaryHours = 2, Sorties = 3, PrimaryInstrumentHours = 3, }, new SquadronLog { FlightLog = flightLog, Person = new Person { User = new User { FirstName = "Joseph", LastName = "Daigle", }, SocialSecurityLastFour = "0728", }, DutyCode = DutyCode.EP, PrimaryHours = 2, Sorties = 3, PrimaryInstrumentHours = 3, }, }; return flightLog; }
public FlightTimeSummaryReport(FlightLog flightLog) { this.flightLog = flightLog; }
public virtual void MarkedUpdated() { FlightLog.MarkedUpdated(); }
public FlightLog AddFlightLog(FlightLog flightLog) { flightLog.MarkedUpdated(); flightLog.Validate(); return Persist<FlightLog>(flightLog); }