public IHttpActionResult GetSearchSupportData()
 {
     BLL.SubMaterialOptionMng bll = new BLL.SubMaterialOptionMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext));
     Library.DTO.Notification notification;
     DTO.SubMaterialOptionMng.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.SubMaterialOptionMng.SearchFilterData>()
     {
         Data = data, Message = notification, TotalRows = 0
     }));
 }
示例#2
0
        public DTO.SubMaterialOptionMng.SearchFilterData GetFilterData(out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.SubMaterialOptionMng.SearchFilterData data = new DTO.SubMaterialOptionMng.SearchFilterData();
            data.Seasons     = new List <DTO.Support.Season>();
            data.YesNoValues = new List <DTO.Support.YesNo>();

            //try to get data
            try
            {
                data.Seasons     = supportFactory.GetSeason().ToList();
                data.YesNoValues = supportFactory.GetYesNo().ToList();
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }