Esempio n. 1
0
 public IHttpActionResult GetInitData()
 {
     BLL.FactoryProformaInvoiceMng bll = new BLL.FactoryProformaInvoiceMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext));
     Library.DTO.Notification      notification;
     DTO.FactoryProformaInvoiceMng.InitFormData data = bll.GetInitData(ControllerContext.GetAuthUserId(), out notification);
     return(Ok(new Library.DTO.ReturnData <DTO.FactoryProformaInvoiceMng.InitFormData>()
     {
         Data = data, Message = notification, TotalRows = 0
     }));
 }
Esempio n. 2
0
        public DTO.FactoryProformaInvoiceMng.InitFormData GetInitData(int userId, out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            DTO.FactoryProformaInvoiceMng.InitFormData data = new DTO.FactoryProformaInvoiceMng.InitFormData();
            data.Factories = new List <DTO.Support.Factory>();
            data.Seasons   = new List <DTO.Support.Season>();

            try
            {
                data.Factories = supportFactory.GetAuthorizedFactories(userId).ToList();
                data.Seasons   = supportFactory.GetSeason().ToList();
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }