void IBL1.AddBusBO(BusBO bus) { ChackBus(bus); try { Bus bus1 = new Bus(); bus.CopyPropertiesTo(bus1); dl.AddBus(bus1); } catch (ExceptionBus ex) { throw new BOExceptionBus("Rong bus", ex); } }
public Bus AddBus(AddBus newBus) { Bus bus = new Bus() { From = newBus.From, To = newBus.To, DateTime = newBus.DateTime, NumberOfSeats = newBus.NumberOfSeats, Comments = newBus.Comments, IsActive = true }; DAL.AddBus(bus); DAL.SaveChanges(); return(bus); }