示例#1
0
        public PostXData(PostXData postXData)
        {
            if (postXData == null)
            {
                throw new ArgumentNullException("postXData");
            }

            Received   = postXData.Received;
            Handled    = postXData.Handled;
            Displayed  = postXData.Displayed;
            DirectAmt  = postXData.DirectAmt;
            SortCalc   = postXData.SortCalc;
            Compound   = postXData.Compound;
            Visited    = postXData.Visited;
            Matches    = postXData.Matches;
            Considered = postXData.Considered;

            VisitedValue  = Value.Clone(postXData.VisitedValue);
            CompoundValue = Value.Clone(postXData.CompoundValue);
            Total         = Value.Clone(postXData.Total);
            Count         = postXData.Count;
            Date          = postXData.Date;
            ValueDate     = postXData.ValueDate;
            Datetime      = postXData.Datetime;
            Account       = postXData.Account;
        }
示例#2
0
        public override int Compare(Post left, Post right)
        {
            if (left == null)
            {
                throw new ArgumentNullException("left");
            }

            if (right == null)
            {
                throw new ArgumentNullException("right");
            }

            PostXData lXData = left.XData;

            if (!lXData.SortCalc)
            {
                BindScope boundScope = new BindScope(SortOrder.Context, left);
                FindSortValues(lXData.SortValues, boundScope);
                lXData.SortCalc = true;
            }

            PostXData rXData = right.XData;

            if (!rXData.SortCalc)
            {
                BindScope boundScope = new BindScope(SortOrder.Context, right);
                FindSortValues(rXData.SortValues, boundScope);
                rXData.SortCalc = true;
            }

            return(-SortValueIsLessThan(lXData.SortValues, rXData.SortValues)); // [DM] Invert result because it is used as IComparer output that requires opposite meaning
        }
示例#3
0
文件: Post.cs 项目: maznabili/nledger
        public override void CopyDetails(Item item)
        {
            base.CopyDetails(item);
            Post post = (Post)item;

            if (post.HasXData)
            {
                _XData = new PostXData(post.XData);
            }
        }
示例#4
0
文件: Post.cs 项目: maznabili/nledger
 /// <summary>
 /// Ported from get_value_date
 /// </summary>
 private static Value GetValueDate(Post post)
 {
     if (post.HasXData)
     {
         PostXData xdata = post.XData;
         if (!xdata.ValueDate.IsNotADate())
         {
             return(Value.Get(xdata.ValueDate));
         }
     }
     return(Value.Get(post.GetDate()));
 }
示例#5
0
文件: Post.cs 项目: vyolbius/nledger
 public Post(Post post)
     : base(post)
 {
     Xact    = post.Xact;
     Account = post.Account;
     if (post.Amount != null)
     {
         Amount = new Amount(post.Amount);
     }
     Cost           = post.Cost;
     AssignedAmount = post.AssignedAmount;
     Checkin        = post.Checkin;
     Checkout       = post.Checkout;
     if (post.HasXData)
     {
         _XData = new PostXData(post._XData);
     }
 }