public ContractPage()
        {
            InitializeComponent();
            Background = BackgroundColor.Colors();

            var contractsAndServices = _context.Contracts.Select(p => new ContractAndEstimate
            {
                ContractID             = p.ID,
                ClientID               = (int)p.ClientID,
                FirstName              = p.Client.FirstName,
                LastName               = p.Client.LastName,
                DateConclusionContract = p.DateConclusionContract,
                DateOfCompletion       = p.DateOfCompletion,
                TotalAmount            = p.TotalAmount
            }).ToList();

            ContractAndServices = new ObservableCollection <ContractAndEstimate>(contractsAndServices);

            _context.Contracts.Include(c => c.Client).Load();

            //var test = _context.Contracts.Include(c => c.Client).FirstOrDefault();
            // MessageBox.Show(test.Client.LastName);

            var contract = _context.Contracts.Include(c => c.Client).ToList();

            contracts = new ObservableCollection <Contract>(contract);
            ContractList.ItemsSource = ContractAndServices;
        }
Exemple #2
0
        public ServicePage()
        {
            InitializeComponent();
            Background = BackgroundColor.Colors();
            _context.Services.Load();
            //var servicesBindingList = _context.Services.Local.ToBindingList();
            var servicesList = _context.Services.Local.Where(c => c.Delete == false).ToList();

            services = new ObservableCollection <Service>(servicesList);

            PriceDataGrid.ItemsSource = services;
        }
Exemple #3
0
        public ClientPage()
        {
            InitializeComponent();
            Background = BackgroundColor.Colors();
            _context.Clients.Load();

            var clientBindingList = _context.Clients.Local.ToBindingList();
            var clientList        = _context.Clients.Local.ToList();

            clients = new ObservableCollection <Client> (clientList);

            ClientList.ItemsSource = clients;
        }