private PayInfo GetPayInfo(int? orgid, int pid)
{
if (orgid == null)
return null;
return (
from m in db.OrganizationMembers
let ts = db.ViewTransactionSummaries.SingleOrDefault(
tt => tt.RegId == m.TranId && tt.PeopleId == m.PeopleId)
where m.PeopleId == pid && m.OrganizationId == orgid
select new PayInfo
{
PayLink = m.PayLink2(db),
Amount = ts.IndAmt,
AmountPaid = ts.IndPaid,
AmountDue = ts.IndDue,
RegisterMail = m.RegisterEmail
}
).SingleOrDefault();
}