Exemplo n.º 1
0
        public IList <IResultValues> GetContractPartySummaryList(ICodeIndex contract, uint summaryCode)
        {
            var resultsList = __results.Where(x => ResultListUtils.IsEqualToContractParty(contract, x.Key) &&
                                              ResultListUtils.SummaryArticlesFilter(x.Value.Article(), summaryCode)).
                              Select(c => c.Value.Values()).ToArray();

            return(resultsList);
        }
Exemplo n.º 2
0
 public int CompareTo(ICodeIndex otherIndex)
 {
     if (this.Code() != otherIndex.Code())
     {
         return(this.Code().CompareTo(otherIndex.Code()));
     }
     return(this.CodeOrder().CompareTo(otherIndex.CodeOrder()));
 }
Exemplo n.º 3
0
        public IList <IResultValues> GetContractPartyResultList(ICodeIndex contract, uint articleCode)
        {
            var resultsList = __results.Where(x => ResultListUtils.IsEqualToContractParty(contract, x.Key) &&
                                              x.Key.Code() == articleCode).
                              Select(c => c.Value.Values()).ToList();

            return(resultsList);
        }
Exemplo n.º 4
0
        public IResultValues GetContractResult(ICodeIndex contract)
        {
            var resultsList = __results.Where(x => ResultListUtils.IsEqualToContractArticle(contract, x.Key)).
                              Select(c => c.Value.Values()).ToArray();

            var partyResult = resultsList.DefaultIfEmpty(ResultValues.GetEmpty()).FirstOrDefault();

            return(partyResult);
        }
Exemplo n.º 5
0
        public static decimal GetSummaryPaymentAmount(IResultStream results, ICodeIndex contract, uint articleCode)
        {
            var resultList = results.GetContractPartySummaryList(contract, articleCode);

            var resultAmounts = resultList.Select(x => x.AmountPayments()).ToArray();

            var resultValue = resultAmounts.Aggregate(0m, (agr, x) => (decimal.Add(agr, x)));

            return(resultValue);
        }
Exemplo n.º 6
0
        public override bool Equals(object other)
        {
            if (other == this)
            {
                return(true);
            }
            if (other == null || this.GetType() != other.GetType())
            {
                return(false);
            }

            ICodeIndex otherIndex = other as ICodeIndex;

            return(this.isEqualToIndex(otherIndex));
        }
Exemplo n.º 7
0
 public static bool IsEqualToContractParty(ICodeIndex contract, IBookIndex element)
 {
     return(element.ContractIndex().Equals(contract));
 }
Exemplo n.º 8
0
 public static bool IsEqualToContractArticle(ICodeIndex contract, IBookIndex element)
 {
     return(element.GetIndex().Equals(contract));
 }
Exemplo n.º 9
0
 public BookParty(ICodeIndex contractIndex, ICodeIndex positionIndex)
 {
     this.__contractIndex = contractIndex;
     this.__positionIndex = positionIndex;
 }
Exemplo n.º 10
0
        public static uint GetContractDayEnds(IResultStream results, ICodeIndex contract)
        {
            var contractResult = results.GetContractResult(contract);

            return(contractResult.PeriodDayEndsOrdinal());
        }
Exemplo n.º 11
0
 public BookIndex(ICodeIndex contractIndex, ICodeIndex positionIndex, uint code, uint codeOrder)
     : base(contractIndex, positionIndex)
 {
     this.__index = new CodeIndex(code, codeOrder);
 }
Exemplo n.º 12
0
 public BookIndex(IBookParty party, uint code, uint codeOrder)
     : base(party.ContractIndex(), party.PositionIndex())
 {
     this.__index = new CodeIndex(code, codeOrder);
 }
Exemplo n.º 13
0
 public bool isEqualToIndex(ICodeIndex other)
 {
     return(this.Code() == other.Code() && this.CodeOrder() == other.CodeOrder());
 }
Exemplo n.º 14
0
        public int CompareTo(object other)
        {
            ICodeIndex otherIndex = other as ICodeIndex;

            return(CompareTo(otherIndex));
        }