Exemple #1
0
 public IHttpActionResult GetSearchSupportData()
 {
     BLL.CushionMng                  bll = new BLL.CushionMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext));
     Library.DTO.Notification        notification;
     DTO.CushionMng.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.CushionMng.SearchFilterData>()
     {
         Data = data, Message = notification, TotalRows = 0
     }));
 }
        public DTO.CushionMng.SearchFilterData GetFilterData(out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.CushionMng.SearchFilterData data = new DTO.CushionMng.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);
        }