public DTO.BookingMng.InitFormData GetInitData(out Library.DTO.Notification notification) { DTO.BookingMng.InitFormData data = new DTO.BookingMng.InitFormData(); notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; data.Seasons = new List <DTO.Support.Season>(); data.Clients = new List <DTO.Support.Client>(); data.Suppliers = new List <DTO.Support.Supplier>(); try { data.Seasons = supportFactory.GetSeason().ToList(); data.Clients = supportFactory.GetClient().ToList(); data.Suppliers = supportFactory.GetSupplier().ToList(); } 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(data); }
public IHttpActionResult GetInitData() { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanCreate)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.BookingMng bll = new BLL.BookingMng(); Library.DTO.Notification notification; DTO.BookingMng.InitFormData data = bll.GetInitData(out notification); return(Ok(new Library.DTO.ReturnData <DTO.BookingMng.InitFormData>() { Data = data, Message = notification })); }