public int Save(DelayedSchedual delayedSchedual) { const string sql = @"EXECUTE Flight.ProcAddDelayedSchedual @FlightNumber, @FlightDate, @DeparturAirport, @ArrivalAirport, @NewFlightDate, @NewDepartureTime, @NewArrivalTime, @NewAddDays"; using (var dbOperator = new DbOperator(Provider, ConnectionString)) { dbOperator.AddParameter("FlightNumber", delayedSchedual.Schedual.FlightNumber.ToString()); dbOperator.AddParameter("FlightDate", delayedSchedual.FlightDate); dbOperator.AddParameter("DeparturAirport", delayedSchedual.Schedual.DepartureAirport); dbOperator.AddParameter("ArrivalAirport", delayedSchedual.Schedual.ArrivalAirport); dbOperator.AddParameter("NewFlightDate", delayedSchedual.NewFlightDate); dbOperator.AddParameter("NewDepartureTime", delayedSchedual.NewDepartureTime); dbOperator.AddParameter("NewArrivalTime", delayedSchedual.NewArrivalTime); dbOperator.AddParameter("NewAddDays", delayedSchedual.NewAddDays); return(dbOperator.ExecuteNonQuery(sql)); } }
public static bool AddDelayedFlightSchedual(DelayedSchedual flightSchedual) { var schedualRepository = Factory.CreateFlightSchedualRepository(); return(schedualRepository.Save(flightSchedual) == 0); }