Esempio n. 1
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                IEnergyProduct energyProductItem = item.As <IEnergyProduct>();

                if (((energyProductItem != null) &&
                     this._parent.Resells_EnergyProduct.Remove(energyProductItem)))
                {
                    return(true);
                }
                IServiceReservation serviceReservationItem = item.As <IServiceReservation>();

                if (((serviceReservationItem != null) &&
                     this._parent.HeldBy.Remove(serviceReservationItem)))
                {
                    return(true);
                }
                if (((energyProductItem != null) &&
                     this._parent.HoldsTitleTo_EnergyProducts.Remove(energyProductItem)))
                {
                    return(true);
                }
                if ((this._parent.ResoldBy == item))
                {
                    this._parent.ResoldBy = null;
                    return(true);
                }
                return(false);
            }
Esempio n. 2
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IEnergyProduct resells_EnergyProductCasted = item.As <IEnergyProduct>();

                if ((resells_EnergyProductCasted != null))
                {
                    this._parent.Resells_EnergyProduct.Add(resells_EnergyProductCasted);
                }
                IServiceReservation heldByCasted = item.As <IServiceReservation>();

                if ((heldByCasted != null))
                {
                    this._parent.HeldBy.Add(heldByCasted);
                }
                IEnergyProduct holdsTitleTo_EnergyProductsCasted = item.As <IEnergyProduct>();

                if ((holdsTitleTo_EnergyProductsCasted != null))
                {
                    this._parent.HoldsTitleTo_EnergyProducts.Add(holdsTitleTo_EnergyProductsCasted);
                }
                if ((this._parent.ResoldBy == null))
                {
                    IServiceReservation resoldByCasted = item.As <IServiceReservation>();
                    if ((resoldByCasted != null))
                    {
                        this._parent.ResoldBy = resoldByCasted;
                        return;
                    }
                }
            }
        // GET: Trajets

        public TrajetsController(IServiceTrajet serviceTrajet, IServiceReservation serviceReservation, IServiceClient serviceClient)
        {
            //User manager n'est pas injectable. il va faloir trouver un autre facon d'avoir le user.
            this.serviceTrajet      = serviceTrajet;
            this.serviceReservation = serviceReservation;
            this.serviceClient      = serviceClient;
        }
Esempio n. 4
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                IServicePoint servicePointItem = item.As <IServicePoint>();

                if (((servicePointItem != null) &&
                     this._parent.ServicePoint.Remove(servicePointItem)))
                {
                    return(true);
                }
                IAncillaryService ancillaryServiceItem = item.As <IAncillaryService>();

                if (((ancillaryServiceItem != null) &&
                     this._parent.AncillaryServices.Remove(ancillaryServiceItem)))
                {
                    return(true);
                }
                ILossProfile lossProfileItem = item.As <ILossProfile>();

                if (((lossProfileItem != null) &&
                     this._parent.For.Remove(lossProfileItem)))
                {
                    return(true);
                }
                ITransmissionService transmissionServiceItem = item.As <ITransmissionService>();

                if (((transmissionServiceItem != null) &&
                     this._parent.OfferedBy.Remove(transmissionServiceItem)))
                {
                    return(true);
                }
                IFlowgate flowgateItem = item.As <IFlowgate>();

                if (((flowgateItem != null) &&
                     this._parent.Flowgate.Remove(flowgateItem)))
                {
                    return(true);
                }
                IServiceReservation serviceReservationItem = item.As <IServiceReservation>();

                if (((serviceReservationItem != null) &&
                     this._parent.SoldBy.Remove(serviceReservationItem)))
                {
                    return(true);
                }
                ITransmissionProduct transmissionProductItem = item.As <ITransmissionProduct>();

                if (((transmissionProductItem != null) &&
                     this._parent.TransmissionProducts.Remove(transmissionProductItem)))
                {
                    return(true);
                }
                return(false);
            }
Esempio n. 5
0
        public MainWindow()
        {
            _serviceReservationOperation = new ReservationService();
            //Init DataBase
            Database.SetInitializer(new ReservationsSeedData());

            _outputCalendar = new OutputCalendarMessage();

            InitializeComponent();

            InitialiceCommunicationLabel();

            UploadAvailableHours();
        }
Esempio n. 6
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IServicePoint servicePointCasted = item.As <IServicePoint>();

                if ((servicePointCasted != null))
                {
                    this._parent.ServicePoint.Add(servicePointCasted);
                }
                IAncillaryService ancillaryServicesCasted = item.As <IAncillaryService>();

                if ((ancillaryServicesCasted != null))
                {
                    this._parent.AncillaryServices.Add(ancillaryServicesCasted);
                }
                ILossProfile forCasted = item.As <ILossProfile>();

                if ((forCasted != null))
                {
                    this._parent.For.Add(forCasted);
                }
                ITransmissionService offeredByCasted = item.As <ITransmissionService>();

                if ((offeredByCasted != null))
                {
                    this._parent.OfferedBy.Add(offeredByCasted);
                }
                IFlowgate flowgateCasted = item.As <IFlowgate>();

                if ((flowgateCasted != null))
                {
                    this._parent.Flowgate.Add(flowgateCasted);
                }
                IServiceReservation soldByCasted = item.As <IServiceReservation>();

                if ((soldByCasted != null))
                {
                    this._parent.SoldBy.Add(soldByCasted);
                }
                ITransmissionProduct transmissionProductsCasted = item.As <ITransmissionProduct>();

                if ((transmissionProductsCasted != null))
                {
                    this._parent.TransmissionProducts.Add(transmissionProductsCasted);
                }
            }
Esempio n. 7
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                ITransmissionPath offeringCasted = item.As <ITransmissionPath>();

                if ((offeringCasted != null))
                {
                    this._parent.Offering.Add(offeringCasted);
                }
                ITransmissionProduct offeredAsCasted = item.As <ITransmissionProduct>();

                if ((offeredAsCasted != null))
                {
                    this._parent.OfferedAs.Add(offeredAsCasted);
                }
                IAvailableTransmissionCapacity scheduledByCasted = item.As <IAvailableTransmissionCapacity>();

                if ((scheduledByCasted != null))
                {
                    this._parent.ScheduledBy.Add(scheduledByCasted);
                }
                IServiceReservation reservedBy_ServiceReservationCasted = item.As <IServiceReservation>();

                if ((reservedBy_ServiceReservationCasted != null))
                {
                    this._parent.ReservedBy_ServiceReservation.Add(reservedBy_ServiceReservationCasted);
                }
                if ((this._parent.TransContractFor == null))
                {
                    IOpenAccessProduct transContractForCasted = item.As <IOpenAccessProduct>();
                    if ((transContractForCasted != null))
                    {
                        this._parent.TransContractFor = transContractForCasted;
                        return;
                    }
                }
                if ((this._parent.Offers == null))
                {
                    ITransmissionProvider offersCasted = item.As <ITransmissionProvider>();
                    if ((offersCasted != null))
                    {
                        this._parent.Offers = offersCasted;
                        return;
                    }
                }
            }
Esempio n. 8
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                ITransmissionPath transmissionPathItem = item.As <ITransmissionPath>();

                if (((transmissionPathItem != null) &&
                     this._parent.Offering.Remove(transmissionPathItem)))
                {
                    return(true);
                }
                ITransmissionProduct transmissionProductItem = item.As <ITransmissionProduct>();

                if (((transmissionProductItem != null) &&
                     this._parent.OfferedAs.Remove(transmissionProductItem)))
                {
                    return(true);
                }
                IAvailableTransmissionCapacity availableTransmissionCapacityItem = item.As <IAvailableTransmissionCapacity>();

                if (((availableTransmissionCapacityItem != null) &&
                     this._parent.ScheduledBy.Remove(availableTransmissionCapacityItem)))
                {
                    return(true);
                }
                IServiceReservation serviceReservationItem = item.As <IServiceReservation>();

                if (((serviceReservationItem != null) &&
                     this._parent.ReservedBy_ServiceReservation.Remove(serviceReservationItem)))
                {
                    return(true);
                }
                if ((this._parent.TransContractFor == item))
                {
                    this._parent.TransContractFor = null;
                    return(true);
                }
                if ((this._parent.Offers == item))
                {
                    this._parent.Offers = null;
                    return(true);
                }
                return(false);
            }
Esempio n. 9
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                if ((this._parent.OpenAccessProduct == null))
                {
                    IOpenAccessProduct openAccessProductCasted = item.As <IOpenAccessProduct>();
                    if ((openAccessProductCasted != null))
                    {
                        this._parent.OpenAccessProduct = openAccessProductCasted;
                        return;
                    }
                }
                ITransmissionProvider transmissionProvidersCasted = item.As <ITransmissionProvider>();

                if ((transmissionProvidersCasted != null))
                {
                    this._parent.TransmissionProviders.Add(transmissionProvidersCasted);
                }
                if ((this._parent.ReservedBy_ServiceReservation == null))
                {
                    IServiceReservation reservedBy_ServiceReservationCasted = item.As <IServiceReservation>();
                    if ((reservedBy_ServiceReservationCasted != null))
                    {
                        this._parent.ReservedBy_ServiceReservation = reservedBy_ServiceReservationCasted;
                        return;
                    }
                }
                if ((this._parent.ControlAreaOperator == null))
                {
                    IControlAreaOperator controlAreaOperatorCasted = item.As <IControlAreaOperator>();
                    if ((controlAreaOperatorCasted != null))
                    {
                        this._parent.ControlAreaOperator = controlAreaOperatorCasted;
                        return;
                    }
                }
            }
 public ReservationController()
 {
     serviceRes  = new ServiceReservation();
     serviceLoc  = new ServiceLocataire();
     serviceBung = new ServiceBungalow();
 }