IEnumerable <NormalRefundRoleBill> getRefundRoleBill(Service.Tradement.RefundResult refundResult) { var result = new List <NormalRefundRoleBill>(); if (isRoleRefund(Purchaser, refundResult)) { result.Add(Purchaser); } if (isRoleRefund(Provider, refundResult)) { result.Add(Provider); } if (isRoleRefund(Supplier, refundResult)) { result.Add(Supplier); } foreach (var royalty in Royalties) { if (isRoleRefund(royalty, refundResult)) { result.Add(royalty); } } if (Platform != null && Platform.Deduction != null && isRoleRefund(Platform.Deduction, refundResult)) { result.Add(Platform.Deduction); } return(result); }
bool isRoleRefund(NormalRefundRoleBill roleBill, Service.Tradement.RefundResult refundResult) { if (roleBill == null) { return(false); } return((refundResult.Roles == null || refundResult.Roles.Contains(roleBill.Owner.RoleType)) && string.Compare(roleBill.Owner.Account, refundResult.Account, true) == 0); }