Пример #1
0
        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();
            }));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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);
            }
        }
Пример #4
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            contactChildListViewSource           = (CollectionViewSource)FindResource("contactChildListViewSource");
            contactcontact_field_valueViewSource = (CollectionViewSource)FindResource("contactcontact_field_valueViewSource");

            //Contact
            ContactDB.contacts.Where(a => a.id_company == CurrentSession.Id_Company && a.is_employee == false).OrderBy(a => a.name).Load();

            contactViewSource        = (CollectionViewSource)FindResource("contactViewSource");
            contactViewSource.Source = ContactDB.contacts.Local;

            CollectionViewSource contactParentViewSource = (CollectionViewSource)FindResource("contactParentViewSource");

            contactParentViewSource.Source = ContactDB.contacts.Local;

            //ContactRole
            CollectionViewSource contactRoleViewSource = (CollectionViewSource)FindResource("contactRoleViewSource");

            contactRoleViewSource.Source = ContactDB.contact_role.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).AsNoTracking().ToList();

            //AppContract
            CollectionViewSource appContractViewSource = (CollectionViewSource)FindResource("appContractViewSource");

            appContractViewSource.Source = CurrentSession.Get_Contract().OrderBy(x => x.name);

            //AppCostCenter
            CollectionViewSource appCostCenterViewSource = (CollectionViewSource)FindResource("appCostCenterViewSource");

            appCostCenterViewSource.Source = ContactDB.app_cost_center.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).AsNoTracking().ToList();

            //ItemPriceList
            CollectionViewSource itemPriceListViewSource = (CollectionViewSource)FindResource("itemPriceListViewSource");

            itemPriceListViewSource.Source = ContactDB.item_price_list.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).AsNoTracking().ToList();

            //SalesRep
            //ContactDB.sales_rep.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).AsNoTracking().ToList();

            CollectionViewSource salesRepViewSource = (CollectionViewSource)FindResource("salesRepViewSource");

            salesRepViewSource.Source = CurrentSession.Get_SalesRep().OrderBy(a => a.name);

            CollectionViewSource salesRepViewSourceCollector = (CollectionViewSource)FindResource("salesRepViewSourceCollector");

            salesRepViewSourceCollector.Source = CurrentSession.Get_SalesRep().OrderBy(a => a.name);

            //AppCurrency
            CollectionViewSource app_currencyViewSource = (CollectionViewSource)FindResource("app_currencyViewSource");

            app_currencyViewSource.Source = ContactDB.app_currency.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).AsNoTracking().ToList();

            //Fields
            CollectionViewSource app_fieldViewSource = (CollectionViewSource)FindResource("app_fieldViewSource");

            app_fieldViewSource.Source = ContactDB.app_field.Where(a => a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).AsNoTracking().ToList();

            //AppBank
            CollectionViewSource bankViewSource = (CollectionViewSource)FindResource("bankViewSource");

            bankViewSource.Source = ContactDB.app_bank.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).AsNoTracking().ToList();

            //Gender Type Enum
            cbxGender.ItemsSource = Enum.GetValues(typeof(contact.Genders));

            ContactDB.contact_tag
            .Where(x => x.id_company == CurrentSession.Id_Company && x.is_active == true)
            .OrderBy(x => x.name).Load();
            CollectionViewSource contact_tagViewSource = ((CollectionViewSource)(FindResource("contact_tagViewSource")));

            contact_tagViewSource.Source = ContactDB.contact_tag.Local;

            CollectionViewSource app_vat_groupViewSource = FindResource("app_vat_groupViewSource") as CollectionViewSource;

            app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group().OrderBy(a => a.name);
        }