Example #1
0
        public int Add(Worker worker)
        {
            _db.Workers.Add(worker);
            _db.SaveChanges();

            return(worker.Id);
        }
Example #2
0
        public int Add(Order order)
        {
            _db.Orders.Add(order);
            _db.SaveChanges();

            return(order.Id);
        }
Example #3
0
        public int Add(Client client)
        {
            _db.Clients.Add(client);
            _db.SaveChanges();

            return(client.Id);
        }
Example #4
0
        public int Delete(int id)
        {
            var car = _db.Cars.First(c => c.Id == id);

            car.IsDeleted = true;
            _db.SaveChanges();

            return(car.Id);
        }
Example #5
0
        public long AddCar(Car car)
        {
            IMapper   mapper    = _carConfig2.CreateMapper();
            CarEntity carEntity = mapper.Map <Car, CarEntity>(car);

            dbCtx.CarEntity.Add(carEntity);
            dbCtx.SaveChanges();
            return(carEntity.IdCar);
        }
        public long AddCustomer(Customer customer)
        {
            IMapper        mapper         = _customerConfig2.CreateMapper();
            CustomerEntity customerEntity = mapper.Map <Customer, CustomerEntity>(customer);

            dbCtx.CustomerEntity.Add(customerEntity);
            dbCtx.SaveChanges();
            return(customerEntity.IdCustomer);
        }
        public long AddReservation(Reservation reservation)
        {
            IMapper           mapper            = _reservationConfig2.CreateMapper();
            ReservationEntity reservationEntity = new ReservationEntity();

            reservationEntity = mapper.Map <Reservation, ReservationEntity>(reservation);
            dbCtx.ReservationEntity.Add(reservationEntity);
            dbCtx.SaveChanges();
            return(reservationEntity.IdReservation);
        }
        public int Add(Coordinator coordinator)
        {
            _db.Coordinators.Add(coordinator);
            _db.SaveChanges();

            return(coordinator.Id);
        }
Example #9
0
        public int AddRepairReport(RepairReport repairReport)
        {
            _db.RepairReports.Add(repairReport);
            _db.SaveChanges();

            return(repairReport.Id);
        }