/// <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) { IResourceInterface resourceInterfaceItem = item.As <IResourceInterface>(); if (((resourceInterfaceItem != null) && this._parent.ResourceInterfaces__ResourceRepository.Remove(resourceInterfaceItem))) { return(true); } ISchedulingPolicy schedulingPolicyItem = item.As <ISchedulingPolicy>(); if (((schedulingPolicyItem != null) && this._parent.SchedulingPolicies__ResourceRepository.Remove(schedulingPolicyItem))) { return(true); } IResourceType resourceTypeItem = item.As <IResourceType>(); if (((resourceTypeItem != null) && this._parent.AvailableResourceTypes_ResourceRepository.Remove(resourceTypeItem))) { return(true); } return(false); }
public ResourceIssueController() { _iResourceService = new ResourceService(); _iResourceIssue = new ResourceIssueService(); _iSetupService = new SetupService(); _iResourceAuthorService = new ResourceAuthorService(); _iResourcePublicationService = new ResourcePublicationService(); rModel = new ReturnMessageModel(); }
/// <summary> /// Gets called when the parent model element of the current model element is about to change /// </summary> /// <param name="oldParent">The old parent model element</param> /// <param name="newParent">The new parent model element</param> protected override void OnParentChanging(IModelElement newParent, IModelElement oldParent) { IResourceInterface oldResourceInterface__ResourceSignature = ModelHelper.CastAs <IResourceInterface>(oldParent); IResourceInterface newResourceInterface__ResourceSignature = ModelHelper.CastAs <IResourceInterface>(newParent); ValueChangedEventArgs e = new ValueChangedEventArgs(oldResourceInterface__ResourceSignature, newResourceInterface__ResourceSignature); this.OnResourceInterface__ResourceSignatureChanging(e); this.OnPropertyChanging("ResourceInterface__ResourceSignature", e, _resourceInterface__ResourceSignatureReference); }
public SetupController() { _iSetupService = new SetupService(); rModel = new ReturnMessageModel(); _iResourceService = new ResourceService(); context = new PointOfSaleEntities(); _iCountryService = new CountryService(); context = new PointOfSaleEntities(); _iResourceAuthorService = new ResourceAuthorService(); context = new PointOfSaleEntities(); _iResourcePublicationService = new ResourcePublicationService(); context = new PointOfSaleEntities(); }
/// <summary> /// Gets called when the parent model element of the current model element changes /// </summary> /// <param name="oldParent">The old parent model element</param> /// <param name="newParent">The new parent model element</param> protected override void OnParentChanged(IModelElement newParent, IModelElement oldParent) { IResourceInterface oldResourceInterface__ResourceSignature = ModelHelper.CastAs <IResourceInterface>(oldParent); IResourceInterface newResourceInterface__ResourceSignature = ModelHelper.CastAs <IResourceInterface>(newParent); if ((oldResourceInterface__ResourceSignature != null)) { oldResourceInterface__ResourceSignature.ResourceSignatures__ResourceInterface.Remove(this); } if ((newResourceInterface__ResourceSignature != null)) { newResourceInterface__ResourceSignature.ResourceSignatures__ResourceInterface.Add(this); } ValueChangedEventArgs e = new ValueChangedEventArgs(oldResourceInterface__ResourceSignature, newResourceInterface__ResourceSignature); this.OnResourceInterface__ResourceSignatureChanged(e); this.OnPropertyChanged("ResourceInterface__ResourceSignature", e, _resourceInterface__ResourceSignatureReference); base.OnParentChanged(newParent, oldParent); }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IResourceInterface resourceInterfaces__ResourceRepositoryCasted = item.As <IResourceInterface>(); if ((resourceInterfaces__ResourceRepositoryCasted != null)) { this._parent.ResourceInterfaces__ResourceRepository.Add(resourceInterfaces__ResourceRepositoryCasted); } ISchedulingPolicy schedulingPolicies__ResourceRepositoryCasted = item.As <ISchedulingPolicy>(); if ((schedulingPolicies__ResourceRepositoryCasted != null)) { this._parent.SchedulingPolicies__ResourceRepository.Add(schedulingPolicies__ResourceRepositoryCasted); } IResourceType availableResourceTypes_ResourceRepositoryCasted = item.As <IResourceType>(); if ((availableResourceTypes_ResourceRepositoryCasted != null)) { this._parent.AvailableResourceTypes_ResourceRepository.Add(availableResourceTypes_ResourceRepositoryCasted); } }
/// <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.RequiredResourceInterface__ResourceRequiredRole == null)) { IResourceInterface requiredResourceInterface__ResourceRequiredRoleCasted = item.As <IResourceInterface>(); if ((requiredResourceInterface__ResourceRequiredRoleCasted != null)) { this._parent.RequiredResourceInterface__ResourceRequiredRole = requiredResourceInterface__ResourceRequiredRoleCasted; return; } } if ((this._parent.ResourceInterfaceRequiringEntity__ResourceRequiredRole == null)) { IResourceInterfaceRequiringEntity resourceInterfaceRequiringEntity__ResourceRequiredRoleCasted = item.As <IResourceInterfaceRequiringEntity>(); if ((resourceInterfaceRequiringEntity__ResourceRequiredRoleCasted != null)) { this._parent.ResourceInterfaceRequiringEntity__ResourceRequiredRole = resourceInterfaceRequiringEntity__ResourceRequiredRoleCasted; return; } } }
/// <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.Parameter__ResourceSignature == null)) { Repository.IParameter parameter__ResourceSignatureCasted = item.As <Repository.IParameter>(); if ((parameter__ResourceSignatureCasted != null)) { this._parent.Parameter__ResourceSignature = parameter__ResourceSignatureCasted; return; } } if ((this._parent.ResourceInterface__ResourceSignature == null)) { IResourceInterface resourceInterface__ResourceSignatureCasted = item.As <IResourceInterface>(); if ((resourceInterface__ResourceSignatureCasted != null)) { this._parent.ResourceInterface__ResourceSignature = resourceInterface__ResourceSignatureCasted; return; } } }