コード例 #1
0
        public List <DTO.PurchasingInvoiceSearchResult> QuickSearchInvoice(int userId, int supplierId, string query, out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            List <DTO.PurchasingInvoiceSearchResult> data = new List <DTO.PurchasingInvoiceSearchResult>();

            //try to get data
            try
            {
                using (FactoryPayment2MngEntities context = CreateContext())
                {
                    data = converter.DB2DTO_PurchasingInvoiceSearchResultList(context.FactoryPayment2Mng_function_SearchPurchasingInvoice(userId, supplierId, query).ToList());
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
            }

            return(data);
        }