private void GetCompanyOpenInvoices() { var proxy = service_factory.CreateClient <IInvoiceService>(); var company = new Company() { CompanyKey = CurrentCompanyKey }; var open_order_col = new ObservableCollection <InvoiceWrapper>(); using (proxy) { //Task<List<Invoice>> invoices = proxy.GetInvoicesByCompanyAsync(company); var invoices = proxy.GetInvoicesByCompany(company); //await invoices; foreach (var invoice in invoices) //invoices.Result { var id = new QIQODate() { Date = DateTime.Parse(invoice.InvoiceEntryDate.AddDays(15).ToString("yyyy-MM-dd")), EntityType = "Account", EntityName = invoice.Account.AccountName, BackgroundBrush = Brushes.LightPink, DateDescription = $"Due Date\nInvoice: {invoice.InvoiceNumber}", DateType = QIQODateType.InvoiceDueDate, FontWeight = FontWeights.Bold }; _working_days.Add(id); } } }
private void GetCompanyOpenOrders() { var proxy = service_factory.CreateClient <IOrderService>(); var company = new Company() { CompanyKey = CurrentCompanyKey }; var open_order_col = new ObservableCollection <OrderWrapper>(); using (proxy) { //Task<List<Order>> orders = proxy.GetOrdersByCompanyAsync(company); var orders = proxy.GetOrdersByCompany(company); //await orders; foreach (var order in orders) { var id = new QIQODate() { Date = (DateTime)order.DeliverByDate, EntityType = "Account", EntityName = order.Account.AccountName, BackgroundBrush = Brushes.LightGreen, DateDescription = $"Due Date\nOrder: {order.OrderNumber}", DateType = QIQODateType.OrderDeliverByDate, FontWeight = FontWeights.Bold }; _working_days.Add(id); } } }
private void SetEventDatesContext() { var eds = new ObservableCollection <QIQODate>(); foreach (var invoice in OpenInvoices) { var id = new QIQODate() { Date = invoice.InvoiceEntryDate.AddDays(15), EntityType = "Account", EntityName = invoice.Account.AccountName, BackgroundBrush = Brushes.LightPink, DateDescription = $"Due Date\nInvoice: {invoice.InvoiceNumber}", DateType = QIQODateType.InvoiceDueDate, FontWeight = FontWeights.Bold }; eds.Add(id); } event_aggregator.GetEvent <CalendarContextChangedEvent>().Publish(eds); }