public void RegisterService(ref BoatRentalsEntity boatRentalsEntity)
        {
            dbc = AliveContext.Context;

            dbc.BoatRentals.Add(boatRentalsEntity);
            dbc.SaveChanges();

            FeedbackMessage = "Sikeres regisztráció!";
            ServiceStatus   = Status.OK;


            // it must be a method
            if (!string.IsNullOrEmpty(FeedbackMessage) && !string.IsNullOrWhiteSpace(FeedbackMessage))
            {
                new PrintMessageBox(FeedbackMessage, ServiceStatus);
            }
        }
Esempio n. 2
0
        private void btAccept_Click(object sender, RoutedEventArgs e)
        {
            BoatRentalsEntity boatRentalsEntity = new BoatRentalsEntity();

            boatRentalsEntity.BoatRentalsId           = generateID();
            boatRentalsEntity.EndDate                 = GlobalRequest.EndDate;
            boatRentalsEntity.FKRentedBoat            = GlobalRequest.BoatToBorrow;
            boatRentalsEntity.FKRentedDevice          = GlobalRequest.DeviceToBorrow;
            boatRentalsEntity.FKWhoRents              = GlobalRequest.WhoBorrows;
            boatRentalsEntity.FromWhere               = GlobalRequest.FromWhere;
            boatRentalsEntity.HowManyPersonWillTravel = GlobalRequest.HowManyPersonWillTravel;
            boatRentalsEntity.StartingDate            = GlobalRequest.StartingDate;
            boatRentalsEntity.ToWhere                 = GlobalRequest.ToWhere;

            dbc = AliveContext.Context;
            AcceptRequesttService acceptRequesttService = new AcceptRequesttService(ref boatRentalsEntity);

            dbc.RentRequests.Remove(GlobalRequest);
            dbc.SaveChanges();

            //következő kérés betöltése
            LoadData(email);
        }
 public AcceptRequesttService(ref BoatRentalsEntity boatRentalsEntity)
 {
     RegisterService(ref boatRentalsEntity);
 }