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);
     }
 }
예제 #2
0
파일: BL.cs 프로젝트: glennneiger/BusWebAPI
        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);
        }