public DTO.MaterialOptionMng.SearchFilterData GetFilterData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; DTO.MaterialOptionMng.SearchFilterData data = new DTO.MaterialOptionMng.SearchFilterData(); data.Seasons = new List <DTO.Support.Season>(); data.YesNoValues = new List <DTO.Support.YesNo>(); data.ProductGroups = new List <DTO.Support.ProductGroup>(); //try to get data try { data.Seasons = supportFactory.GetSeason().ToList(); data.YesNoValues = supportFactory.GetYesNo().ToList(); data.ProductGroups = supportFactory.GetProductGroup().ToList(); } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
public IHttpActionResult GetSearchSupportData() { BLL.MaterialOptionMng bll = new BLL.MaterialOptionMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification; DTO.MaterialOptionMng.SearchFilterData data = bll.GetFilterData(out notification); if (notification.Type == Library.DTO.NotificationType.Error) { return(InternalServerError(new Exception(notification.Message))); } return(Ok(new Library.DTO.ReturnData <DTO.MaterialOptionMng.SearchFilterData>() { Data = data, Message = notification, TotalRows = 0 })); }