示例#1
0
        /// <summary>
        /// Конструктор, инициализирующий общие для всех конструкторов данные
        /// </summary>
        private AccountingPriceList(string number, DateTime startDate, DateTime?endDate, AccountingPriceCalcRule priceCalcRule, LastDigitCalcRule lastDigitRule, User curator)
        {
            if (String.IsNullOrWhiteSpace(number))
            {
                throw new Exception("Номер не указан.");
            }

            CreationDate  = DateTimeUtils.GetCurrentDateTime();
            state         = AccountingPriceListState.New;
            storages      = new HashedSet <Storage>();
            articlePrices = new HashedSet <ArticleAccountingPrice>();
            IsRevaluationOnStartCalculated = false;
            IsRevaluationOnEndCalculated   = false;

            CheckAndCorrectDates(ref startDate, ref endDate, CreationDate);

            Number    = number;
            StartDate = startDate;
            EndDate   = endDate;
            AccountingPriceCalcRule = priceCalcRule ?? AccountingPriceCalcRule.GetDefault();
            LastDigitCalcRule       = lastDigitRule ?? LastDigitCalcRule.GetDefault();
            Curator = curator;
        }