Exemplo n.º 1
0
        public EditingClient(Client p, ApplicationContex DB)
        {
            db = DB;
            InitializeComponent();
            Client           = p;
            this.DataContext = Client;

            cbSale.ItemsSource       = db.Sales.Local.ToBindingList();
            cbSale.DisplayMemberPath = "SaleValue";
            cbSale.SelectedValuePath = "Id";
        }
Exemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            db = new ApplicationContex();
            db.Clients.Load();
            db.Sales.Load();
            db.Masters.Load();
            db.Works.Load();
            db.Cars.Load();
            this.DataContext = db.Cars.Local.ToBindingList();

            //this.DataContext = db.Masters.Local.ToBindingList();
            //this.DataContext = db.Sales.Local.ToBindingList();
        }
Exemplo n.º 3
0
        public CarWindow(Car p, ApplicationContex DB)
        {
            db = DB;
            InitializeComponent();
            Car = p;
            this.DataContext = Car;

            //combobox с клиентом
            cbClient.ItemsSource       = db.Clients.Local.ToBindingList();
            cbClient.DisplayMemberPath = "Name";
            cbClient.SelectedValuePath = "Id";
            //combobox с мастером
            cbMaster.ItemsSource       = db.Masters.Local.ToBindingList();
            cbMaster.DisplayMemberPath = "Name";
            cbMaster.SelectedValuePath = "Id";
            // combobox с типом работы
            cbWork.ItemsSource       = db.Works.Local.ToBindingList();
            cbWork.DisplayMemberPath = "WorkType";
            cbWork.SelectedValuePath = "Id";
        }
Exemplo n.º 4
0
 // ApplicationContex db;
 public ClientWindow(ApplicationContex DB)
 {
     InitializeComponent();
     db = DB;
     this.DataContext = db.Clients.Local.ToBindingList();
 }