static public KeyValuePair <IBookIndex, IBookTarget> ComposeTarget(IBookParty party, SymbolName articleName, IBookIndex element, ITargetValues values, IProcessConfig config) { IBookTarget target = BuildTargetFromElement(element, values, config); return(new KeyValuePair <IBookIndex, IBookTarget>(element, target)); }
private TargetStream(IDictionary <IBookIndex, IBookTarget> targets, IBookParty lastParty, IBookIndex lastIndex) { this.__targets = targets; this.__lastParty = lastParty; this.__lastIndex = lastIndex; }
public IList <IResultValues> GetPositionPartySummaryList(IBookParty position, uint summaryCode) { var resultsList = __results.Where(x => ResultListUtils.IsEqualToPositionParty(position, x.Key) && ResultListUtils.SummaryArticlesFilter(x.Value.Article(), summaryCode)). Select(c => c.Value.Values()).ToArray(); return(resultsList); }
public static Int32 GetAbsenceHours(IResultStream results, IBookParty position, uint articleCode) { var resultList = results.GetPositionPartyResultList(position, articleCode); var resultValue = resultList.Select(x => x.AbsenceCount()).DefaultIfEmpty(ResultValues.NULL_TIME_COUNTS).FirstOrDefault(); return(resultValue); }
public static Int32[] GetShiftTimetable(IResultStream results, IBookParty position, uint articleCode) { var resultList = results.GetPositionPartyResultList(position, articleCode); var resultValue = resultList.Select(x => x.ShiftTimetable()).DefaultIfEmpty(ResultValues.NULL_TIME_TABLE).FirstOrDefault(); return(resultValue); }
public bool isEqualToParty(IBookParty other) { bool equalsContractIndex = this.ContractIndex().Equals(other.ContractIndex()); bool equalsPositionIndex = this.PositionIndex().Equals(other.PositionIndex()); return(equalsContractIndex && equalsPositionIndex); }
static private uint SelectDefault(IEnumerable <IBookIndex> elements, IBookParty party, uint code) { IEnumerable <IBookIndex> selectedUnits = SelectEquals(elements, party, code); IEnumerable <uint> oneCodeOrders = ExtractCodeOrders(selectedUnits); return(DefaultOrderFrom(oneCodeOrders.OrderBy(x => x).ToArray())); }
public IList <IResultValues> GetPositionPartyResultList(IBookParty position, uint articleCode) { var resultsList = __results.Where(x => ResultListUtils.IsEqualToPositionParty(position, x.Key) && x.Key.Code() == articleCode). Select(c => c.Value.Values()).ToArray(); return(resultsList); }
public IResultValues GetPositionResult(IBookParty position) { var resultsList = __results.Where(x => ResultListUtils.IsEqualToPositionArticle(position, x.Key)). Select(c => c.Value.Values()).ToArray(); var partyResult = resultsList.DefaultIfEmpty(ResultValues.GetEmpty()).FirstOrDefault(); return(partyResult); }
public static Int32 GetSumAbsenceTimetable(IResultStream results, IBookParty position, uint articleCode) { var resultList = results.GetPositionPartyResultList(position, articleCode); var resultHours = resultList.Select(x => x.AbsenceTimetable()).DefaultIfEmpty(ResultValues.NULL_TIME_TABLE).FirstOrDefault(); var resultValue = resultHours.Aggregate(0, (agr, x) => (agr + x)); return(resultValue); }
private static IDictionary <IBookIndex, IBookTarget> BuildArticleTarget( IDictionary <IBookIndex, IBookTarget> initialStream, IBookParty addParty, IPayrollArticle article, ITargetValues addValues, IProcessConfig configModule) { var results = TargetsTupleComposer.AddTargetBySymbol(initialStream, addParty, article.ArticleSymbol(), addValues, configModule); var targets = results.Item2; return(targets); }
private static IBookParty[] GetContractParties(IBookParty[] contractParties, IBookTarget targetToken) { IBookParty contractParty = targetToken.GetContractParty(); if (contractParty == null) { return(contractParties.ToArray()); } var contractPartyArry = new IBookParty[] { contractParty }; return(contractParties.Concat(contractPartyArry).ToArray()); }
private static IBookParty[] GetPositionParties(IBookParty[] positionParties, IBookTarget targetToken) { IBookParty posotionParty = targetToken.GetPositionParty(); if (posotionParty == null) { return(positionParties.ToArray()); } var contractPartyArry = new IBookParty[] { posotionParty }; return(positionParties.Concat(contractPartyArry).ToArray()); }
virtual public int CompareTo(object other) { IBookParty otherParty = other as IBookParty; bool equalsContractIndex = this.ContractIndex().Equals(otherParty.ContractIndex()); if (equalsContractIndex) { return(this.PositionIndex().CompareTo(otherParty.PositionIndex())); } return(this.ContractIndex().CompareTo(otherParty.ContractIndex())); }
public IBookParty[] GetTargetParties(IBookParty emptyNode, IBookParty[] contracts, IBookParty[] positions) { if (__positionQual == true) { return(positions); } if (__contractQual == true) { return(contracts); } return(new IBookParty[] { emptyNode }); }
public override bool Equals(object other) { if (other == this) { return(true); } if (other == null || this.GetType() != other.GetType()) { return(false); } IBookParty otherParty = other as IBookParty; return(this.isEqualToParty(otherParty)); }
public static Tuple <IBookIndex, IDictionary <IBookIndex, IBookTarget> > AddTargetBySymbol( IDictionary <IBookIndex, IBookTarget> targets, IBookParty party, SymbolName articleName, ITargetValues values, IProcessConfig config) { IBookIndex newIndex = TargetElementBuilder.BuildIndexWithFirst(targets.Keys, party, articleName.Code); KeyValuePair <IBookIndex, IBookTarget> pairToMerge = TargetPairComposer .ComposeTarget(party, articleName, newIndex, values, config); var targetIndex = pairToMerge.Key; var targetValue = pairToMerge.Value; var bookTargets = TargetsDictComposer.MergeDictWithTargetPair(targets, targetIndex, targetValue); return(Tuple.Create <IBookIndex, IDictionary <IBookIndex, IBookTarget> >(targetIndex, bookTargets)); }
public IBookParty GetTargetParty(IBookParty lastParty) { if (__positionNode == false && __contractNode == true) { return(lastParty.GetNonContractParty()); } else if (__positionNode == true) { return(lastParty.GetNonPositionParty()); } else if (__positionQual == true) { return(lastParty.GetPositionParty()); } else if (__contractQual == true) { return(lastParty.GetContractParty()); } return(lastParty.GetNonContractParty()); }
public ITargetStream AddTargetIntoSubLevel(SymbolName article, ITargetValues values, IProcessConfig config) { uint articleCode = article.Code; IPayrollArticle targetArticle = config.FindArticle(articleCode); uint conceptCode = targetArticle.ConceptCode(); IPayrollConcept targetConcept = config.FindConcept(conceptCode); IBookParty addParty = targetConcept.GetTargetParty(LastParty()); var retTuple = TargetsTupleComposer.AddTargetBySymbol(Targets(), addParty, article, values, config); var nextFacts = retTuple.Item2; var nextIndex = retTuple.Item1; var nextParty = targetConcept.GetNextTargetParty(nextIndex); return(new TargetStream(nextFacts, nextParty, nextIndex)); }
public static bool IsEqualToPositionParty(IBookParty position, IBookIndex element) { return(element.ContractIndex().Equals(position.ContractIndex()) && element.PositionIndex().Equals(position.PositionIndex())); }
static private IEnumerable <IBookIndex> SelectEquals(IEnumerable <IBookIndex> elements, IBookParty party, uint code) { return(elements.Where(x => (x.isEqualToParty(party) && x.Code() == code)).ToArray()); }
public BookIndex(IBookParty party, uint code, uint codeOrder) : base(party.ContractIndex(), party.PositionIndex()) { this.__index = new CodeIndex(code, codeOrder); }
public static uint GetPositionDayEnds(IResultStream results, IBookParty position) { var positionResult = results.GetPositionResult(position); return(positionResult.PeriodDayEndsOrdinal()); }
static public IBookIndex BuildIndexWithDefault(IEnumerable <IBookIndex> elements, IBookParty party, uint code) { uint codeOrder = SelectDefault(elements, party, code); return(new BookIndex(party, code, codeOrder)); }