Example #1
0
        /// <summary>
        /// Validates this object.
        /// </summary>
        /// <returns>A List containing an <see cref="Error"/> item for each validation error.</returns>
        public override List <Error> GetValidationErrors()
        {
            var consolidatedList = new List <Error>();

            if (SearchGroupId == 0)
            {
                consolidatedList.Add(new Error {
                    Message = "A folder must be selected for this Analytic."
                });
            }

            var entityErrors = Identity.GetAllValidationErrors();

            consolidatedList.AddRange(entityErrors);


            entityErrors = FilterGroups.GetAllValidationErrors();
            consolidatedList.AddRange(entityErrors);

            entityErrors = PriceListGroups.GetAllValidationErrors();
            consolidatedList.AddRange(entityErrors);

            entityErrors = ValueDrivers.GetAllValidationErrors();
            consolidatedList.AddRange(entityErrors);

            return(consolidatedList);
        }
Example #2
0
        /// <summary>
        /// Sets the Key and Linked price list groups based on the currently selected Pricing Mode.
        /// </summary>
        public void UpdatePriceListGroups()
        {
            if (SelectedMode != null)
            {
                KeyPriceListGroup = PriceListGroups.Where(group => group.Key == SelectedMode.KeyPriceListGroupKey).FirstOrDefault();

                LinkedPriceListGroup = PriceListGroups.Where(group => group.Key == SelectedMode.LinkedPriceListGroupKey).FirstOrDefault();
                if (LinkedPriceListGroup != null)
                {
                    //Assign to each price list its corresponding linked rule.
                    foreach (PricingEverydayPriceList priceList in LinkedPriceListGroup.PriceLists)
                    {
                        priceList.LinkedPriceListRule = LinkedPriceListRules.FirstOrDefault(rule => rule.PriceListId == priceList.Id);
                    }
                }

                RecalculateLinkedPriceLists();
                this.RaisePropertyChanged("SelectedKeyPriceList");
            }
        }