public IHttpActionResult GetInitData()
 {
     BLL.DDCMng bll = new BLL.DDCMng();
     Library.DTO.Notification notification;
     DTO.DDCMng.InitFormData  data = bll.GetInitData(out notification);
     return(Ok(new Library.DTO.ReturnData <DTO.DDCMng.InitFormData>()
     {
         Data = data, Message = notification, TotalRows = 0
     }));
 }
Example #2
0
        //
        // CUSTOM FUNCTION
        //
        public DTO.DDCMng.InitFormData GetInitData(out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.DDCMng.InitFormData data = new DTO.DDCMng.InitFormData();
            data.Seasons = new List <DTO.Support.Season>();
            try
            {
                using (DDCMngEntities context = CreateContext())
                {
                    data.Seasons = supportFactory.GetSeason().ToList();
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }