using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using MMDAL.CustomCode.ForeCast; namespace MMBLL.ForeCast { public class ForeCastBLL : IForeCastBLL { private readonly IForeCastDAL _ForeCastDAL; public ForeCastBLL(IForeCastDAL ForeCastDAL) { _ForeCastDAL = ForeCastDAL; } public async Task GetSelectListForeCast(int FirstNumber, int MaxResult, CriteriaDTO CriteriaDTO, LoginDTO LoginDTO) { try { var result = await _ForeCastDAL.GetSelectListForeCast(FirstNumber, MaxResult, CriteriaDTO, LoginDTO); return result; } catch (Exception ex) { throw new Exception($"Error in ForeCastBLL.GetSelectListForeCast: {ex.Message}", ex); } } public async Task GetSelectListForeCastVersion(int ForeCastId, LoginDTO LoginDTO) { try { if (ForeCastId <= 0) throw new ArgumentException("Please select forecast", nameof(ForeCastId)); return await _ForeCastDAL.GetSelectListForeCastVersion(ForeCastId, LoginDTO); } catch (Exception ex) { throw new Exception($"Error in ForeCastBLL.GetSelectListForeCastVersion: {ex.Message}", ex); } } } }