private void Page_Loaded(object sender, RoutedEventArgs e) { item_requestViewSource = ((CollectionViewSource)(FindResource("item_requestViewSource"))); dbContext.item_request.Where(x => x.id_company == CurrentSession.Id_Company).ToList(); item_requestViewSource.Source = dbContext.item_request.Local; item_requestitem_request_detailViewSource = ((CollectionViewSource)(FindResource("item_requestitem_request_detailViewSource"))); item_request_detailitem_request_decisionViewSource = ((CollectionViewSource)(FindResource("item_request_detailitem_request_decisionViewSource"))); CollectionViewSource app_branchViewSource = ((CollectionViewSource)(FindResource("app_branchViewSource"))); //dbContext.app_branch.Where(x => x.id_company == CurrentSession.Id_Company && x.is_active).ToList(); app_branchViewSource.Source = CurrentSession.Get_Branch(); //dbContext.app_branch.Local; //item_movementViewSource = ((CollectionViewSource)(FindResource("item_movementViewSource"))); //dbContext.item_movement.Where(x => x.id_company == CurrentSession.Id_Company).ToList(); //item_movementViewSource.Source = dbContext.item_movement.Local; CollectionViewSource app_currencyViewSource = ((CollectionViewSource)(FindResource("app_currencyViewSource"))); app_currencyViewSource.Source = CurrentSession.Get_Currency(); // dbContext.app_currency.Where(x => x.id_company == CurrentSession.Id_Company).ToList(); //CollectionViewSource production_orderViewSource = ((CollectionViewSource)(FindResource("production_orderViewSource"))); //production_orderViewSource.Source = dbContext.production_order.Where(x => x.id_company == CurrentSession.Id_Company).ToList(); CollectionViewSource app_departmentViewSource = ((CollectionViewSource)(FindResource("app_departmentViewSource"))); app_departmentViewSource.Source = dbContext.app_department.Where(x => x.id_company == CurrentSession.Id_Company).ToList(); cmburgency.ItemsSource = Enum.GetValues(typeof(entity.item_request_detail.Urgencies)); }
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 void Page_Loaded(object sender, RoutedEventArgs e) { try { salesReturnViewSource = (CollectionViewSource)FindResource("sales_returnViewSource"); SalesReturnDB.sales_return.Where(a => a.id_company == CurrentSession.Id_Company).OrderByDescending(x => x.trans_date).Load(); salesReturnViewSource.Source = SalesReturnDB.sales_return.Local; sales_returnsales_return_detailViewSource = FindResource("sales_returnsales_return_detailViewSource") as CollectionViewSource; //sales_invoiceViewSource = (CollectionViewSource)FindResource("sales_invoiceViewSource"); //sales_invoiceViewSource.Source = SalesReturnDB.sales_invoice.Where(a => a.status == Status.Documents_General.Approved && a.id_company == CurrentSession.Id_Company).ToList(); CollectionViewSource currencyfxViewSource = (CollectionViewSource)FindResource("app_currencyfxViewSource"); currencyfxViewSource.Source = CurrentSession.Get_Currency(); CollectionViewSource app_vat_groupViewSource = FindResource("app_vat_groupViewSource") as CollectionViewSource; app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group(); //SalesReturnDB.app_vat_group.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).AsNoTracking().ToList(); cbxReturnType.ItemsSource = Enum.GetValues(typeof(Status.ReturnTypes)); cbxDocument.ItemsSource = entity.Brillo.Logic.Range.List_Range(SalesReturnDB, entity.App.Names.SalesReturn, CurrentSession.Id_Branch, CurrentSession.Id_Company); CollectionViewSource app_branchViewSource = ((CollectionViewSource)(FindResource("app_branchViewSource"))); //SalesReturnDB.app_branch.Load(); app_branchViewSource.Source = CurrentSession.Get_Branch(); //SalesReturnDB.app_branch.Local; } catch (Exception ex) { toolBar.msgError(ex); } }
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 StockPage_Loaded(object sender, System.Windows.RoutedEventArgs e) { dgvBranch.ItemsSource = CurrentSession.Get_Branch(); //StockDB.app_branch.Local; InventoryDate = DateTime.Now; }