Beispiel #1
0
        public async Task <IActionResult> GetByConNo(string conNo)
        {
            var tag = new List <string> {
                ExpensesTag.EXP10001,
                ExpensesTag.EXP10002,
                ExpensesTag.EXP10003,
                ExpensesTag.EXP10004
            };
            var ris = (await RegisList(tag)).FirstOrDefault(x => x.BookingNo == conNo);

            if (ris.VisitorCode != null)
            {
                var v = await iCustomer.GetCustomerByCode(ris.VisitorCode);

                ris.VisitorName = $"{v.CustomerPrename}{v.CustomerName} {v.CustomerSurname}";
            }
            ;

            if (ris.OwnerCode != null)
            {
                var o = await iCustomer.GetCustomerByCode(ris.OwnerCode);

                ris.OwnerName = $"{o.CustomerPrename}{o.CustomerName} {o.CustomerSurname}";
            }
            ;
            return(Ok(ris));
        }
Beispiel #2
0
        public async Task <IActionResult> GetCustomerByCode(string custCode)
        {
            if (custCode == null)
            {
                return(NoContent());
            }

            return(Ok(await iCust.GetCustomerByCode(custCode)));
        }
        public CustomerViewModel GetCustomer(String code)
        {
            var customer = _customerServices.GetCustomerByCode(code);
            CustomerViewModel customerVM = new CustomerViewModel();

            customerVM.PartnerService  = new BusinessPartnerServiceWrapper(_partnerServices);
            customerVM.CustomerService = new CustomerServiceWrapper(_customerServices);
            var result = customerVM.GetCustomerByID(customer.Id);

            result.AsyncWaitHandle.WaitOne();
            result.AsyncWaitHandle.Close();
            while (customerVM.InProgress == true)
            {
                Thread.Sleep(20);
            }

            return(customerVM);
        }