public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Group; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (ActiveElement != null) { dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); } if (TypeElement != null) { dest.TypeElement = (Code <Hl7.Fhir.Model.Group.GroupType>)TypeElement.DeepCopy(); } if (ActualElement != null) { dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); } if (Code != null) { dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); } if (NameElement != null) { dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); } if (QuantityElement != null) { dest.QuantityElement = (Hl7.Fhir.Model.UnsignedInt)QuantityElement.DeepCopy(); } if (ManagingEntity != null) { dest.ManagingEntity = (Hl7.Fhir.Model.ResourceReference)ManagingEntity.DeepCopy(); } if (Characteristic != null) { dest.Characteristic = new List <Hl7.Fhir.Model.Group.CharacteristicComponent>(Characteristic.DeepCopy()); } if (Member != null) { dest.Member = new List <Hl7.Fhir.Model.Group.MemberComponent>(Member.DeepCopy()); } return(dest); }
/// <summary> /// Adds the new tier price. /// </summary> /// <param name="tierPricingModel">The tier pricing model.</param> /// <returns></returns> /// <exception cref="ArgumentNullException">tierPricingModel</exception> public virtual TierPricesComponent AddNewTierPrice( TierPriceModel tierPricingModel) { if (tierPricingModel == null) { throw new ArgumentNullException(nameof(tierPricingModel)); } var cachedWindowHandle = WrappedDriver.CurrentWindowHandle; var cachedWindowHandles = WrappedDriver.WindowHandles; AddNewTierPriceElement.Click(); WrappedDriver .Wait(TimeSpan.FromSeconds(10)) .Until(d => d.WindowHandles.Count > cachedWindowHandles.Count); // Switch to new window. var newHandle = WrappedDriver.WindowHandles .Except(cachedWindowHandles) .First(); WrappedDriver.SwitchTo().Frame(newHandle); // Load the StartDate/EndDate components. StartDateComponent.Load(); EndDateComponent.Load(); // Enter values. QuantityElement.SetValue(tierPricingModel.Quantity); PriceElement.SetValue(tierPricingModel.Price); StoreElement.SelectByText(tierPricingModel.Store); CustomerRoleElement.SelectByText(tierPricingModel.CustomerRole); StartDateComponent.SetValue(tierPricingModel.StartDate); EndDateComponent.SetValue(tierPricingModel.EndDate); // Save. var saveEl = SaveElement; // Cache this to avoid extra lookups. saveEl.Click(); WrappedDriver .Wait(TimeSpan.FromSeconds(10)) .Until(d => saveEl.IsStale()); // Switch back to the original handle. WrappedDriver.SwitchTo().Frame(cachedWindowHandle); return(this); }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (Identifier != null) { result.AddRange(Identifier.Validate()); } if (TypeElement != null) { result.AddRange(TypeElement.Validate()); } if (ActualElement != null) { result.AddRange(ActualElement.Validate()); } if (Code != null) { result.AddRange(Code.Validate()); } if (NameElement != null) { result.AddRange(NameElement.Validate()); } if (QuantityElement != null) { result.AddRange(QuantityElement.Validate()); } if (Characteristic != null) { Characteristic.ForEach(elem => result.AddRange(elem.Validate())); } if (Member != null) { Member.ForEach(elem => result.AddRange(elem.Validate())); } return(result); }
/// <summary> /// Sets the quantity. /// </summary> /// <param name="quantity">The quantity.</param> /// <returns></returns> public virtual IBaseProductPage SetQuantity(int quantity) { QuantityElement.SetValue(quantity); return(this); }