Пример #1
0
        //    catch (Exception ex)
        //    {
        //        notification.Type = Library.DTO.NotificationType.Error;
        //        notification.Message = ex.Message;
        //        if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message))
        //        {
        //            notification.DetailMessage.Add(ex.InnerException.Message);
        //        }
        //        return string.Empty;
        //    }
        //}



        public DTO.ReportDeliveryShedule.SupportDataContainer GetFilterData(out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DAL.Support.DataFactory factory = new Support.DataFactory();

            //try to get data
            try
            {
                DTO.ReportDeliveryShedule.SupportDataContainer dtoItem = new DTO.ReportDeliveryShedule.SupportDataContainer();

                dtoItem.Salers  = factory.GetSaler().ToList();
                dtoItem.Seasons = factory.GetSeason().ToList();

                return(dtoItem);
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
                if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message))
                {
                    notification.DetailMessage.Add(ex.InnerException.Message);
                }
                return(new DTO.ReportDeliveryShedule.SupportDataContainer());
            }
        }
 public IHttpActionResult GetFilters()
 {
     BLL.ReportDeliveryShedule bll = new BLL.ReportDeliveryShedule();
     Library.DTO.Notification  notification;
     DTO.ReportDeliveryShedule.SupportDataContainer result = bll.GetFilters(out notification);
     return(Ok(new Library.DTO.ReturnData <DTO.ReportDeliveryShedule.SupportDataContainer>()
     {
         Data = result, Message = notification, TotalRows = 0
     }));
 }