Пример #1
0
        public Index()
        {
            this.Dispatcher.UnhandledException += OnDispatcherUnhandledException;
            InitializeComponent();
             RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;

             Product_List.LWidth = 500;
             Product_List.LHeight = 400;
             Provider_List.LWidth = 500;
             Provider_List.LHeight = 400;
             Client_List.LWidth = 500;
             Client_List.LHeight = 400;
             _dataDC = ModelSingleton.getDataDC;
             startrutines.Database_Backup();
             ProductSearch = new ObservableProductSearch(_dataDC);
             UpdateNotificationList();

             string[] todos = new string[] { "Todos" };

             cbProducto.ItemsSource = _dataDC.ProductsSet.Select(S => S.Producto).Distinct().Union(todos).ToList();
             cbMarca.ItemsSource = _dataDC.ProductsSet.Select(S => S.Marca).Distinct().Union(todos).ToList();
             cbModelo.ItemsSource = _dataDC.ProductsSet.Select(S => S.Modelo).Distinct().Union(todos).ToList();
             int añoindex;
             for (añoindex = 1900; añoindex < 2025; añoindex++)
             {

                 cbfromyear.Items.Add(añoindex);
             }
        }
Пример #2
0
        public Client(ClientSet client)
        {
            this.InitializeComponent();
            _dataDC = ModelSingleton.getDataDC;
            lps = new ObservableProductSearch(_dataDC);
            lvProductSearched.ItemsSource = lps.Where(S => S.Enbusca == true.ToString() && S.Proveedor_ID == client.Id).ToList();
            _client = client;
            this.DataContext = client;

            UpdateRequestedProductList();
            Update_ListSoldProducts();
            // Insert code required on object creation below this point.
        }
Пример #3
0
 private void BorrarMouseDown(object sender, RoutedEventArgs e)
 {
     if (lvProductSearched.SelectedItem != null)
     {
         _dataDC.ProductsSet.DeleteObject((lvProductSearched.SelectedItem as ProductsSet));
         _dataDC.SaveChanges();
         lps = new ObservableProductSearch(_dataDC);
         lvProductSearched.ItemsSource = lps;
     }
 }
Пример #4
0
 private void tabControl1_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     string[] todos = new string[] { "Todos" };
     cbProducto.ItemsSource = _dataDC.ProductsSet.Select(S => S.Producto).Distinct().Union(todos).ToList();
     ProductSearch = new ObservableProductSearch(_dataDC);
     ListRequestedProduct.ItemsSource = ProductSearch;
     //Product_List.refresh();
     UpdateNotificationList();
 }