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 Page_Loaded(object sender, RoutedEventArgs e) { ///This code will create a new Sale & Payment Information. //Task task = Task.Factory.StartNew(() => New_Sale_Payment()); New_Sale_Payment(); //PAYMENT TYPE await SalesInvoiceDB.payment_type.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company && a.payment_behavior == payment_type.payment_behaviours.Normal).LoadAsync(); CollectionViewSource payment_typeViewSource = (CollectionViewSource)this.FindResource("payment_typeViewSource"); payment_typeViewSource.Source = SalesInvoiceDB.payment_type.Local; cbxSalesRep.ItemsSource = await SalesInvoiceDB.sales_rep.Where(x => x.is_active && x.id_company == CurrentSession.Id_Company).ToListAsync(); //CurrentSession.Get_SalesRep(); app_currencyViewSource = (CollectionViewSource)this.FindResource("app_currencyViewSource"); app_currencyViewSource.Source = CurrentSession.Get_Currency(); int Id_Account = CurrentSession.Id_Account; app_account app_account = await SalesInvoiceDB.app_account.Where(x => x.id_account == CurrentSession.Id_Account).FirstOrDefaultAsync(); if (app_account != null) { if (app_account.is_active == false) { btnAccount_Click(sender, e); frmaccount.Refresh(); } } }
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() { await ItemDB.app_measurement .Where(a => a.is_active && a.id_company == CurrentSession.Id_Company) .OrderBy(a => a.name).AsNoTracking().LoadAsync(); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_measurementViewSource = ((CollectionViewSource)(FindResource("app_measurementViewSource"))); CollectionViewSource app_measurementViewSourceconvert = ((CollectionViewSource)(FindResource("app_measurementViewSourceconvert"))); CollectionViewSource app_measurementViewSourcenew = ((CollectionViewSource)(FindResource("app_measurementViewSourcenew"))); app_measurementViewSource.Source = ItemDB.app_measurement.Local; app_measurementViewSourceconvert.Source = ItemDB.app_measurement.Local; app_measurementViewSourcenew.Source = ItemDB.app_measurement.Local; })); await ItemDB.app_dimension .Where(a => a.id_company == CurrentSession.Id_Company) .OrderBy(a => a.name).LoadAsync(); await Dispatcher.InvokeAsync(new Action(() => { app_dimentionViewSource.Source = ItemDB.app_dimension.Local; })); await ItemDB.app_property .OrderBy(a => a.name).LoadAsync(); await Dispatcher.InvokeAsync(new Action(() => { app_propertyViewSource.Source = ItemDB.app_property.Local; })); await Dispatcher.InvokeAsync(new Action(() => { app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group(); //ItemDB.app_vat_group.Local; })); await ItemDB.item_tag .Where(x => x.id_company == CurrentSession.Id_Company && x.is_active) .OrderBy(x => x.name).LoadAsync(); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource item_tagViewSource = ((CollectionViewSource)(FindResource("item_tagViewSource"))); item_tagViewSource.Source = ItemDB.item_tag.Local; })); await ItemDB.item_template .Where(x => x.id_company == CurrentSession.Id_Company && x.is_active) .OrderBy(x => x.name).LoadAsync(); await Dispatcher.InvokeAsync(new Action(() => { item_templateViewSource = ((CollectionViewSource)(FindResource("item_templateViewSource"))); item_templateViewSource.Source = ItemDB.item_template.Local; })); await Dispatcher.InvokeAsync(new Action(() => { CollectionViewSource app_currencyViewSource = ((CollectionViewSource)(FindResource("app_currencyViewSource"))); app_currencyViewSource.Source = CurrentSession.Get_Currency(); //ItemDB.app_currency.Local; })); await ItemDB.hr_talent .Where(a => a.is_active && a.id_company == CurrentSession.Id_Company) .OrderBy(a => a.name).LoadAsync(); await Dispatcher.InvokeAsync(new Action(() => { hr_talentViewSource.Source = ItemDB.hr_talent.Local; })); await ItemDB.item_price_list .Where(a => a.is_active && a.id_company == CurrentSession.Id_Company) .OrderBy(a => a.name).LoadAsync(); await Dispatcher.InvokeAsync(new Action(() => { item_price_listViewSource.Source = ItemDB.item_price_list.Local; })); await ItemDB.item_brand .Where(a => a.id_company == CurrentSession.Id_Company) .OrderBy(a => a.name).LoadAsync(); await Dispatcher.InvokeAsync(new Action(() => { item_brandViewSource.Source = ItemDB.item_brand.Local; })); await Dispatcher.InvokeAsync(new Action(() => { toolBar.IsEnabled = true; })); }