public GetAllGroupFinacials GetAllGroupFinancials(int GroupId) { GetAllGroupFinacials getAllGroupFinacials = new GetAllGroupFinacials(); List <GetGroupFinacials> list = new List <GetGroupFinacials>(); list = (from financial in _context.GroupFinancials join feetype in _context.GlobalCodes on financial.FeeTypeId equals feetype.GlobalCodeId join timeframe in _context.GlobalCodes on financial.TimeFrameId equals timeframe.GlobalCodeId where financial.GroupId == GroupId && financial.IsActive == true && financial.IsDeleted == false && feetype.IsActive == true && feetype.IsDeleted == false && timeframe.IsActive == true && timeframe.IsDeleted == false select new GetGroupFinacials { GroupFinancialId = financial.GroupFinancialId, Date = financial.Date, FeeTypeId = financial.FeeTypeId, FeeTypeName = feetype.CodeName, TimeFrameId = financial.TimeFrameId, TimeFrameName = timeframe.CodeName, Amount = financial.Amount }).ToList(); getAllGroupFinacials.getGroupFinacials = list; getAllGroupFinacials.getGroupFinacialsTotals = getTotals(list); return(getAllGroupFinacials); }
public GetAllGroupFinacials GetAllGroupFinancials(int GroupId) { GetAllGroupFinacials getAllGroupFinacials = new GetAllGroupFinacials(); List <GetGroupFinacials> list = new List <GetGroupFinacials>(); var selectedgroup = (from groups in _context.Groups where groups.GroupId == GroupId && groups.IsActive == true select groups).FirstOrDefault(); if (selectedgroup != null) { getAllGroupFinacials.GroupName = selectedgroup.GroupName; getAllGroupFinacials.GroupId = selectedgroup.GroupId; } list = (from financial in _context.GroupFinancials join feetype in _context.YearlyMaintainenceFee on financial.FeeTypeId equals feetype.YearlyMaintainenceFeeId join timeframe in _context.GlobalCodes on financial.TimeFrameId equals timeframe.GlobalCodeId where financial.GroupId == GroupId && financial.IsActive == true && feetype.IsActive == true && timeframe.IsActive == true select new GetGroupFinacials { GroupFinancialId = financial.GroupFinancialId, Date = financial.Date, FeeTypeId = financial.FeeTypeId, FeeTypeName = feetype.FeeName, FeeTimeFrame = feetype.TimeFrame, TimeFrameId = financial.TimeFrameId, TimeFrameName = timeframe.CodeName, Amount = financial.Amount }).ToList(); getAllGroupFinacials.getGroupFinacials = list; getAllGroupFinacials.getGroupFinacialsTotals = getTotals(list); return(getAllGroupFinacials); }