예제 #1
0
파일: Order.xaml.cs 프로젝트: mercaditu/ERP
        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 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();
        }
예제 #3
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));
        }
예제 #4
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            ContactDB.contacts.Where(a => a.id_company == CurrentSession.Id_Company && a.is_customer && a.contact_role.is_principal).OrderBy(a => a.name).Load();

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

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

            appContractViewSource.Source = CurrentSession.Get_Contract(); // ContactDB.app_contract.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).AsNoTracking().ToList();

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

            app_vat_groupViewSource.Source = CurrentSession.Get_VAT_Group();//ContactDB.app_vat_group.Where(a => a.is_active == true && a.id_company == CurrentSession.Id_Company).OrderBy(a => a.name).ToList();
        }
예제 #5
0
        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;
            }));
        }
예제 #6
0
        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;
            }));
        }
예제 #7
0
        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;
        }
예제 #8
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);
            }
        }
예제 #9
0
파일: Order.xaml.cs 프로젝트: mercaditu/ERP
        private void cbxCondition_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            sales_order sales_order = (sales_order)sales_orderDataGrid.SelectedItem;

            //Contract
            if (cbxCondition.SelectedItem != null)
            {
                app_condition app_condition = cbxCondition.SelectedItem as app_condition;
                if (app_condition != null)
                {
                    cbxContract.ItemsSource = CurrentSession.Get_Contract().Where(x => x.id_condition == app_condition.id_condition).ToList();
                }

                if (sales_order != null)
                {
                    if (sales_order.id_contract == 0)
                    {
                        cbxContract.SelectedIndex = 0;
                    }
                }
            }
        }
예제 #10
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);
        }