public ProductEntityBAL GetLowerestProductRate(int ProductId, int ProgramId, DateTime StartDate, DateTime EndtDate) { var prodList = new List <ProductEntityBAL>(); try { var productList = _productRepository.GetLowerestProductRate(ProductId, ProgramId, StartDate, EndtDate); productList.ToList().ForEach(x => { var p = new ProductEntityBAL { ProductName = x.ProductName, ProgramName = x.ProgramName, ProductRate = x.ProductRate, ProgramRate = x.ProgramRate, StartDate = x.StartDate, EndDate = x.EndDate }; prodList.Add(p); }); if (productList.Any()) { var product = _calculateRate(prodList); return(product); } } catch { throw; } return(null); }
public IList <ProductEntityBAL> GetAllProducts() { var productList = _productRepository.GetAllProducts(); var prodList = new List <ProductEntityBAL>(); productList.ToList().ForEach(x => { var p = new ProductEntityBAL { ProductName = x.ProductName, ProgramName = x.ProgramName, ProductRate = x.ProductRate, ProgramRate = x.ProgramRate, StartDate = x.StartDate, EndDate = x.EndDate }; prodList.Add(p); }); return(prodList); }