Example #1
0
        public List <DTO.FactoryProformaInvoiceMng.FactoryOrderSearchResult> QuickSearchFactoryOrder(int userId, string season, int factoryId, string query, out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            List <DTO.FactoryProformaInvoiceMng.FactoryOrderSearchResult> data = new List <DTO.FactoryProformaInvoiceMng.FactoryOrderSearchResult>();

            //try to get data
            try
            {
                using (FactoryProformaInvoiceMngEntities context = CreateContext())
                {
                    data = converter.DB2DTO_FactoryOrderSearchResultList(context.FactoryProformaInvoiceMng_function_SearchFactoryOrder(userId, season, factoryId, query).ToList());
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }