Beispiel #1
0
        /// <summary>
        /// Установка нового вида распространения и нового списка мест хранения
        /// </summary>
        public virtual void SetStorageList(IEnumerable <Storage> newStorageList)
        {
            if (newStorageList == null)
            {
                throw new Exception("Список мест хранения не указан.");
            }
            if (State == AccountingPriceListState.Accepted)
            {
                throw new Exception("Невозможно отредактировать проведенный документ.");
            }
            if (Reason == AccountingPriceListReason.Storage)
            {
                throw new Exception("Невозможно изменить список мест хранения в реестре с основанием «По месту хранения».");
            }
            if (newStorageList.Count() != newStorageList.Distinct().Count())
            {
                throw new Exception("Список мест хранения содержит повторяющиеся элементы.");
            }

            storages.Clear();
            storages.AddAll(newStorageList as ICollection <Storage>);
        }
Beispiel #2
0
 protected void SetArticleAccountingPriceList(IEnumerable <ArticleAccountingPrice> newArticleAccountingPriceList)
 {
     articlePrices.Clear();
     articlePrices.AddAll(newArticleAccountingPriceList as ICollection <ArticleAccountingPrice>);
 }