public GetAllAdFees GetAllAdFees(int yearlyMaintenanceId) { int adCategoryId = GetCategoryId("AdTypes"); IEnumerable <GetAdFees> data; GetAllAdFees getAllAdFees = new GetAllAdFees(); data = (from fees in _ObjContext.YearlyMaintainenceFee join adSize in _ObjContext.GlobalCodes on fees.FeeTypeId equals adSize.GlobalCodeId where fees.IsActive == true && fees.IsDeleted == false && adSize.IsActive == true && adSize.IsDeleted == false && fees.YearlyMaintainenceId == yearlyMaintenanceId && adSize.CategoryId == adCategoryId select new GetAdFees { YearlyMaintenanceFeeId = fees.YearlyMaintainenceFeeId, AdSizeId = adSize.GlobalCodeId, AdSize = adSize.CodeName, Amount = fees.Amount, Active = fees.IsActive }); if (data.Count() != 0) { getAllAdFees.getAdFees = data.ToList(); } return(getAllAdFees); }
public GetAllAdFees GetAllAdFees(int yearlyMaintenanceId) { IEnumerable <GetAdFees> data; GetAllAdFees getAllAdFees = new GetAllAdFees(); data = (from fees in _ObjContext.YearlyMaintainenceFee where fees.IsDeleted == false && fees.YearlyMaintainenceId == yearlyMaintenanceId && fees.FeeType == "AdFee" select new GetAdFees { YearlyMaintenanceFeeId = fees.YearlyMaintainenceFeeId, AdSize = fees.FeeName, Amount = fees.Amount, Active = fees.IsActive }); if (data.Count() != 0) { getAllAdFees.getAdFees = data.ToList(); } return(getAllAdFees); }