예제 #1
0
        public static List <InvoiceItem> FindInvoiceItems(string criteria)
        {
            try
            {
                var invoiceItem = new InvoiceItem();
                var id          = Convert.ToInt32(criteria);
                invoiceItem.InvoiceNumber = id;

                var findSo       = new FindSO();
                var getSo        = new GetSO();
                var tmpList      = findSo.ExecuteSO(invoiceItem) as List <IGenericObject>;
                var invoiceItems = tmpList?.Cast <InvoiceItem>().ToList();
                if (invoiceItems != null)
                {
                    foreach (var item in invoiceItems)
                    {
                        var service = getSo.ExecuteSO(new Service {
                            Id = item.Service.Id
                        }) as Service;
                        item.Service = service;
                    }
                }
                return(invoiceItems);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
예제 #2
0
        public static List <Invoice> FindInvoices(string criteria)
        {
            var invoice = new Invoice();
            var id      = Convert.ToInt32(criteria);

            invoice.Auto = new Auto
            {
                AutoId = id
            };

            var findSo   = new FindSO();
            var tmpList  = findSo.ExecuteSO(invoice) as List <IGenericObject>;
            var invoices = tmpList?.Cast <Invoice>().ToList();

            if (invoices != null)
            {
                foreach (var inv in invoices)
                {
                    var invoiceItems =
                        findSo.ExecuteSO(new InvoiceItem {
                        InvoiceNumber = inv.InvoiceNumber
                    }) as List <IGenericObject>;
                    inv.InvoiceItems = invoiceItems?.Cast <InvoiceItem>().ToList();
                }
            }
            return(invoices);
        }
예제 #3
0
        public static List <Auto> FindAutos(string criteria)
        {
            var tmpAuto = new Auto {
                RegNumber = criteria
            };
            var findSo  = new FindSO();
            var tmpList = findSo.ExecuteSO(tmpAuto) as List <IGenericObject>;

            return(tmpList?.Cast <Auto>().ToList());
        }
예제 #4
0
        public static List <Service> FindServices(string criteria)
        {
            var tmpService = new Service {
                Id = int.Parse(criteria)
            };
            var findSo  = new FindSO();
            var tmpList = findSo.ExecuteSO(tmpService) as List <IGenericObject>;

            return(tmpList?.Cast <Service>().ToList());
        }
예제 #5
0
        public static List <Employee> FindEmployee(string criteria)
        {
            var tmpEmployee = new Employee {
                Id = Convert.ToInt32(criteria)
            };
            var findSo  = new FindSO();
            var tmpList = findSo.ExecuteSO(tmpEmployee) as List <IGenericObject>;

            return(tmpList?.Cast <Employee>().ToList());
        }