private async void load_SecondaryDataThread() { cbxCondition.ItemsSource = CurrentSession.Get_Condition(); cbxContract.ItemsSource = CurrentSession.Get_Contract(); await Dispatcher.InvokeAsync(new Action(() => { cbxDocument.ItemsSource = entity.Brillo.Logic.Range.List_Range(dbContext, entity.App.Names.SalesOrder, CurrentSession.Id_Branch, CurrentSession.Id_Terminal); })); await Dispatcher.InvokeAsync(new Action(() => { cbxBranch.ItemsSource = CurrentSession.Get_Branch(); })); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_vat_groupViewSource = FindResource("app_vat_groupViewSource") as CollectionViewSource; app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group(); })); await Dispatcher.InvokeAsync(new Action(() => { cbxSalesRep.ItemsSource = CurrentSession.Get_SalesRep(); })); }
private async void project_costing_Loaded(object sender, RoutedEventArgs e) { itemViewSource = FindResource("itemViewSource") as CollectionViewSource; contractViewSource = FindResource("contractViewSource") as CollectionViewSource; contractViewSource.Source = CurrentSession.Get_Contract(); CollectionViewSource conditionViewSource = FindResource("conditionViewSource") as CollectionViewSource; conditionViewSource.Source = CurrentSession.Get_Condition(); CollectionViewSource contactViewSource = FindResource("contactViewSource") as CollectionViewSource; contactViewSource.Source = await EventDB.contacts.Where(a => a.is_active && a.id_company == CurrentSession.Id_Company && a.is_customer).ToListAsync(); CollectionViewSource template_designerViewSource = FindResource("template_designerViewSource") as CollectionViewSource; template_designerViewSource.Source = await EventDB.project_event_template.Where(a => a.is_active && a.id_company == CurrentSession.Id_Company).ToListAsync(); project_costingViewSource = FindResource("project_costingViewSource") as CollectionViewSource; await EventDB.project_event.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).LoadAsync(); project_costingViewSource.Source = EventDB.project_event.Local; project_costingproject_event_template_variable_detailsViewSource = FindResource("project_costingproject_event_template_variable_detailsViewSource") as CollectionViewSource; project_costingservices_per_event_detailsViewSource = FindResource("project_costingservices_per_event_detailsViewSource") as CollectionViewSource; CollectionViewSource app_document_rangeViewSource = FindResource("app_document_rangeViewSource") as CollectionViewSource; app_document_rangeViewSource.Source = entity.Brillo.Logic.Range.List_Range(EventDB, entity.App.Names.SalesBudget, CurrentSession.Id_Branch, CurrentSession.Id_Terminal); EstimateCost(); }
private async void load_SecondaryDataThread() { cbxContract.ItemsSource = CurrentSession.Get_Contract(); cbxCondition.ItemsSource = CurrentSession.Get_Condition(); cbxDocument.ItemsSource = entity.Brillo.Logic.Range.List_Range(SalesInvoiceDB, entity.App.Names.SalesInvoice, CurrentSession.Id_Branch, CurrentSession.Id_Terminal); await Dispatcher.InvokeAsync(new Action(() => { cbxSalesRep.ItemsSource = CurrentSession.Get_SalesRep(); })); await Dispatcher.InvokeAsync(new Action(() => { cbxBranch.ItemsSource = CurrentSession.Get_Branch(); })); await Dispatcher.InvokeAsync(new Action(() => { cbxTerminal.ItemsSource = CurrentSession.Get_Terminal(); })); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_vat_groupViewSource = FindResource("app_vat_groupViewSource") as CollectionViewSource; app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group(); })); cbxTransType.ItemsSource = Enum.GetValues(typeof(Status.TransactionTypes)); }
private async void load_SecondaryDataThread() { await PurchaseInvoiceDB.app_department.Where(a => a.is_active && a.id_company == CurrentSession.Id_Company).AsNoTracking().ToListAsync(); await Dispatcher.InvokeAsync(new Action(() => { cbxDepartment.ItemsSource = PurchaseInvoiceDB.app_department.Local; })); cbxContract.ItemsSource = CurrentSession.Get_Contract(); cbxCondition.ItemsSource = CurrentSession.Get_Condition(); await Dispatcher.InvokeAsync(new Action(() => { cbxBranch.ItemsSource = CurrentSession.Get_Branch(); //PurchaseInvoiceDB.app_branch.Local; })); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_vat_groupViewSource = FindResource("app_vat_groupViewSource") as CollectionViewSource; app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group(); //PurchaseInvoiceDB.app_vat_group.Local; })); await PurchaseInvoiceDB.app_dimension.Where(a => a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).ToListAsync(); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_dimensionViewSource = ((CollectionViewSource)(FindResource("app_dimensionViewSource"))); app_dimensionViewSource.Source = PurchaseInvoiceDB.app_dimension.Local; })); await PurchaseInvoiceDB.app_measurement.Where(a => a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).ToListAsync(); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_measurementViewSource = ((CollectionViewSource)(FindResource("app_measurementViewSource"))); app_measurementViewSource.Source = PurchaseInvoiceDB.app_measurement.Local; })); await PurchaseInvoiceDB.app_cost_center.Where(a => a.id_company == CurrentSession.Id_Company && a.is_active).OrderBy(a => a.name).ToListAsync(); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_cost_centerViewSource = FindResource("app_cost_centerViewSource") as CollectionViewSource; app_cost_centerViewSource.Source = PurchaseInvoiceDB.app_cost_center.Local; })); }
private async void load_SecondaryDataThread() { cbxContract.ItemsSource = CurrentSession.Get_Contract(); await PurchaseOrderDB.app_department.Where(a => a.is_active && a.id_company == CurrentSession.Id_Company).ToListAsync(); cbxDepartment.ItemsSource = PurchaseOrderDB.app_department.Local; await Dispatcher.InvokeAsync(new Action(() => { cmbdocument.ItemsSource = entity.Brillo.Logic.Range.List_Range(PurchaseOrderDB, entity.App.Names.PurchaseOrder, CurrentSession.Id_Branch, CurrentSession.Id_Terminal); })); await Dispatcher.InvokeAsync(new Action(() => { cbxCondition.ItemsSource = CurrentSession.Get_Condition(); })); await Dispatcher.InvokeAsync(new Action(() => { cbxBranch.ItemsSource = CurrentSession.Get_Branch(); })); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_vat_groupViewSource = FindResource("app_vat_groupViewSource") as CollectionViewSource; app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group(); })); await PurchaseOrderDB.app_cost_center.Where(a => a.id_company == CurrentSession.Id_Company && a.is_active).ToListAsync(); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_cost_centerViewSource = FindResource("app_cost_centerViewSource") as CollectionViewSource; app_cost_centerViewSource.Source = PurchaseOrderDB.app_cost_center.Local; })); await PurchaseOrderDB.app_document_range.Where(d => d.is_active && d.app_document.id_application == entity.App.Names.PurchaseOrder && d.id_company == CurrentSession.Id_Company).ToListAsync(); await Dispatcher.InvokeAsync(new Action(() => { cmbdocument.ItemsSource = PurchaseOrderDB.app_document_range.Local; })); }
private async void Page_Loaded(object sender, RoutedEventArgs e) { await PurchaseTenderDB.purchase_tender.Where(a => a.id_company == CurrentSession.Id_Company).LoadAsync(); purchase_tenderViewSource = FindResource("purchase_tenderViewSource") as CollectionViewSource; purchase_tenderViewSource.Source = PurchaseTenderDB.purchase_tender.Local; purchase_tenderpurchase_tender_contact_detailViewSource = FindResource("purchase_tenderpurchase_tender_contact_detailViewSource") as CollectionViewSource; purchase_tenderpurchase_tender_itemViewSource = FindResource("purchase_tenderpurchase_tender_itemViewSource") as CollectionViewSource; purchase_tenderpurchase_tender_item_detailViewSource = FindResource("purchase_tenderpurchase_tender_item_detailViewSource") as CollectionViewSource; cbxBranch.ItemsSource = CurrentSession.Get_Branch(); //PurchaseTenderDB.app_branch.Local; await PurchaseTenderDB.app_department.Where(b => b.is_active && b.id_company == CurrentSession.Id_Company).OrderBy(b => b.name).AsNoTracking().ToListAsync(); cbxDepartment.ItemsSource = PurchaseTenderDB.app_department.Local; cbxDocument.ItemsSource = entity.Brillo.Logic.Range.List_Range(PurchaseTenderDB, entity.App.Names.PurchaseTender, CurrentSession.Id_Branch, CurrentSession.Id_Terminal); CollectionViewSource app_conditionViewSource = FindResource("app_conditionViewSource") as CollectionViewSource; app_conditionViewSource.Source = CurrentSession.Get_Condition(); app_contractViewSource = FindResource("app_contractViewSource") as CollectionViewSource; app_contractViewSource.Source = CurrentSession.Get_Contract(); PurchaseTenderDB.app_currencyfx.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).AsNoTracking().ToList(); CollectionViewSource app_currencyfxViewSource = FindResource("app_currencyfxViewSource") as CollectionViewSource; app_currencyfxViewSource.Source = PurchaseTenderDB.app_currencyfx.Local; CollectionViewSource app_vat_groupViewSource = FindResource("app_vat_groupViewSource") as CollectionViewSource; app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group(); CollectionViewSource app_dimensionViewSource = ((CollectionViewSource)(FindResource("app_dimensionViewSource"))); await PurchaseTenderDB.app_dimension.Where(a => a.id_company == CurrentSession.Id_Company).AsNoTracking().LoadAsync(); app_dimensionViewSource.Source = PurchaseTenderDB.app_dimension.Local; CollectionViewSource app_measurementViewSource = ((CollectionViewSource)(FindResource("app_measurementViewSource"))); await PurchaseTenderDB.app_measurement.Where(a => a.id_company == CurrentSession.Id_Company).AsNoTracking().LoadAsync(); app_measurementViewSource.Source = PurchaseTenderDB.app_measurement.Local; }
private async void Page_Loaded(object sender, RoutedEventArgs e) { try { Settings SalesSettings = new Settings(); if (SalesSettings.FilterByBranch) { SalesBudgetDB.sales_budget.Where(a => a.id_company == entity.CurrentSession.Id_Company && a.id_branch == entity.CurrentSession.Id_Branch).OrderByDescending(x => x.trans_date).Load(); } else { SalesBudgetDB.sales_budget.Where(a => a.id_company == entity.CurrentSession.Id_Company).OrderByDescending(x => x.trans_date).Load(); } sales_budgetViewSource = ((CollectionViewSource)(FindResource("sales_budgetViewSource"))); sales_budgetViewSource.Source = SalesBudgetDB.sales_budget.Local; sales_budgetsales_budget_detailViewSource = FindResource("sales_budgetsales_budget_detailViewSource") as CollectionViewSource; CollectionViewSource branchViewSource = ((CollectionViewSource)(FindResource("branchViewSource"))); branchViewSource.Source = CurrentSession.Get_Branch(); CollectionViewSource contractViewSource = ((CollectionViewSource)(FindResource("contractViewSource"))); contractViewSource.Source = CurrentSession.Get_Contract(); CollectionViewSource conditionViewSource = ((CollectionViewSource)(FindResource("conditionViewSource"))); conditionViewSource.Source = CurrentSession.Get_Condition(); await Dispatcher.InvokeAsync(new Action(() => { cbxSalesRep.ItemsSource = CurrentSession.Get_SalesRep(); })); CollectionViewSource app_document_rangeViewSource = FindResource("app_document_rangeViewSource") as CollectionViewSource; app_document_rangeViewSource.Source = entity.Brillo.Logic.Range.List_Range(SalesBudgetDB, entity.App.Names.SalesBudget, entity.CurrentSession.Id_Branch, entity.CurrentSession.Id_Terminal); CollectionViewSource app_vat_groupViewSource = FindResource("app_vat_groupViewSource") as CollectionViewSource; app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group(); } catch (Exception ex) { toolBar.msgError(ex); } }
private void Page_Loaded(object sender, RoutedEventArgs e) { cbxCondition.ItemsSource = CurrentSession.Get_Condition(); load_Schedual(); contactViewSource = (CollectionViewSource)FindResource("contactViewSource"); List <contact> contactLIST = new List <contact>(); foreach (payment_schedual payment in PaymentDB.payment_schedual.Local.ToList()) { if (contactLIST.Contains(payment.contact) == false) { contact contact = new contact(); contact = payment.contact; contactLIST.Add(contact); } } contactViewSource.Source = contactLIST; }