public List <ProfitDetailOM> FiiipayDetail(UserAccount account, int pageIndex) { var iDAC = new InviteRecordDAC(); int offset, nextCount = 0; if (pageIndex == 1) { offset = 0; nextCount = 20; } else { offset = (pageIndex - 2) * 10 + 20; nextCount = 10; } var collection = iDAC.GetFiiiPayProfitDetails(account.Id, new Tuple <int, int>(offset, nextCount)); List <ProfitDetailOM> result = new List <ProfitDetailOM>(); collection.ForEach(item => result.Add(new ProfitDetailOM() { AccountId = item.AccountId, CellPhone = item.CellPhone, CryptoAmount = item.CryptoAmount, Id = item.Id, InvitationId = item.InvitationId, InvitedAccountId = item.InvitedAccountId, PhoneCode = item.PhoneCode, Timestamp = item.Timestamp, Type = item.Type })); return(result); }
public PreFiiiPayProfitOM PreFiiiPayProfit(UserAccount account) { var iDAC = new InviteRecordDAC(); var collection = iDAC.GetFiiiPayProfitDetails(account.Id); int inviteUserCount = 0; decimal totalAmount = decimal.Zero; foreach (var item in collection) { if (item.Type == ProfitType.InvitePiiiPay) { inviteUserCount++; } totalAmount += item.CryptoAmount; } return(new PreFiiiPayProfitOM() { TotalProfitAmount = totalAmount, InvitationCount = inviteUserCount }); }