示例#1
0
        /// <summary>
        /// Проверить письмо на дубликаты.
        /// </summary>
        /// <param name="letter">Входящее письмо.</param>
        /// <param name="documentKind">Вид документа.</param>
        /// <param name="businessUnit">Наша организация.</param>
        /// <param name="correspondentNumber">Номер корреспондента.</param>
        /// <param name="dated">Дата письма.</param>
        /// <param name="correspondent">Корреспондент.</param>
        /// <returns>True, если дубликаты имеются, иначе - false.</returns>
        public static bool HaveDuplicates(IIncomingLetter letter,
                                          Sungero.Docflow.IDocumentKind documentKind,
                                          Company.IBusinessUnit businessUnit,
                                          string correspondentNumber,
                                          DateTime?dated,
                                          Parties.ICounterparty correspondent)
        {
            if (documentKind == null ||
                businessUnit == null ||
                string.IsNullOrEmpty(correspondentNumber) ||
                !dated.HasValue ||
                correspondent == null)
            {
                return(false);
            }

            return(Functions.IncomingLetter.Remote.GetDuplicates(letter, documentKind, businessUnit, correspondentNumber, dated, correspondent).Any());
        }
示例#2
0
        /// <summary>
        /// Проверить дубли входящего счета.
        /// </summary>
        /// <param name="incomingInvoice">Счет для проверки.</param>
        /// <param name="documentKind">Вид счета.</param>
        /// <param name="number">Номер счета.</param>
        /// <param name="date">Дата счета.</param>
        /// <param name="totalAmount">Сумма счета.</param>
        /// <param name="currency">Валюта счета.</param>
        /// <param name="counterparty">Контрагент счета.</param>
        /// <returns>True, если дубликаты имеются, иначе - false.</returns>
        public static bool HaveDuplicates(IIncomingInvoice incomingInvoice,
                                          Sungero.Docflow.IDocumentKind documentKind,
                                          string number,
                                          DateTime?date,
                                          double?totalAmount,
                                          Commons.ICurrency currency,
                                          Parties.ICounterparty counterparty)
        {
            if (documentKind == null ||
                string.IsNullOrWhiteSpace(number) ||
                date == null ||
                totalAmount == null ||
                currency == null ||
                counterparty == null)
            {
                return(false);
            }

            return(Functions.IncomingInvoice.Remote.GetDuplicates(incomingInvoice, documentKind, number, (DateTime)date, (double)totalAmount, currency, counterparty).Any());
        }