beantownace
Active member
- Joined
- Feb 15, 2019
- Messages
- 40
- Programming Experience
- 5-10
Hello all, I am struggling to make this as clean as I can the data is broken out so not easy to work with. This is what I am trying to do and thanks for any help if someone has a clean way to handle this.
I have the following prop data and it's split by top level order and then order detail rows like so:
What I need to check is if the order details balance so it is grouped by GroupId, Account, Sum(Amount)
If the OrderType at the top level is SELL I need to multiply by -1 the amounts will always be positive.
Bool check if valid or not.
Thanks for any help this data is painful I need to deal with.
I have the following prop data and it's split by top level order and then order detail rows like so:
Property Data:
public PropertyInfo
{
public int OrderId { get; set; }
public string PropertyName { get; set; }
public object Value { get; set; }
}
PropertyInfo[] orders;
PropertyInfo { OrderId = 1, PropertyName = "OrderType", Value = "BUY" }
PropertyInfo { OrderId = 2, PropertyName = "OrderType", Value = "BUY" }
PropertyInfo { OrderId = 3, PropertyName = "OrderType", Value = "SELL" }
PropertyInfo[] orderDetails;
PropertyInfo { OrderId = 1, PropertyName = "GroupId", Value = "34" }
PropertyInfo { OrderId = 1, PropertyName = "Account", Value = "Travel" }
PropertyInfo { OrderId = 1, PropertyName = "Amount", Value = "5.25" }
PropertyInfo { OrderId = 2, PropertyName = "GroupId", Value = "34" }
PropertyInfo { OrderId = 2, PropertyName = "Account", Value = "Travel" }
PropertyInfo { OrderId = 2, PropertyName = "Amount", Value = "10.25" }
PropertyInfo { OrderId = 3, PropertyName = "GroupId", Value = "34" }
PropertyInfo { OrderId = 3, PropertyName = "Account", Value = "Travel" }
PropertyInfo { OrderId = 2, PropertyName = "Amount", Value = "15.50" }
What I need to check is if the order details balance so it is grouped by GroupId, Account, Sum(Amount)
If the OrderType at the top level is SELL I need to multiply by -1 the amounts will always be positive.
Bool check if valid or not.
Thanks for any help this data is painful I need to deal with.