示例#1
0
        private void MenuItem_MouseDown(object sender, RoutedEventArgs e)
        {
            //provmenu.PlacementTarget = this;
            //provmenu.IsOpen = true;

            ProveedorSet p = new ProveedorSet();

            Provider providerdetails = new Provider(p);

            providerdetails._new = true;

            providerdetails.ShowDialog();

            if (!providerdetails.Cancel)
            {
                if (providerdetails._new)
                {
                    lpr.Add(p);
                    _dataDC.ProveedorSet.AddObject(p);
                    _dataDC.SaveChanges();
                }
                else
                {
                    lpr.Add(p);
                }
                filter();
            }
        }
示例#2
0
        private void proveedorSetListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (proveedorSetListView.SelectedItem != null)
            {
                String       file            = proveedorSetListView.SelectedItem.ToString();
                ProveedorSet p               = (ProveedorSet)proveedorSetListView.SelectedItem;
                Provider     providerdetails = new Provider(p);
                providerdetails._new = false;

                providerdetails.ShowDialog();

                _dataDC.SaveChanges();
            }
        }
示例#3
0
        private void btViewProvider_Click(object sender, RoutedEventArgs e)
        {
            if (tbProvider.SelectedItem != null)
            {
                ProveedorSet p = tbProvider.SelectedItem as ProveedorSet;
                Provider     providerdetails = new Provider(p);
                providerdetails._new = false;

                providerdetails.ShowDialog();

                if (!providerdetails.Cancel)
                {
                    _dataDC.SaveChanges();
                }
            }
        }
示例#4
0
        public Machine(ProductsSet product)
        {
            InitializeComponent();

            _product = product;
            _dataDC  = ModelSingleton.getDataDC;
            string productPath = Properties.Settings.Default.ImagePath.ToString() + "\\" + _product.Id;

            if (!Directory.Exists(productPath))
            {
                System.IO.Directory.CreateDirectory(productPath);
            }
            ProveedorSet p;

            if (product.Proveedor_ID != null && product.Proveedor_ID != "")
            {
                p = (ProveedorSet)_dataDC.ProveedorSet.Where(S => S.Id == product.Proveedor_ID).ToList()[0];
            }
            else
            {
                p = new ProveedorSet();
            }

            if (product.Descripcion != "" && product.Descripcion != null)
            {
                tbdescription.Text = product.Descripcion;
            }


            cbProducto.ItemsSource  = _dataDC.ProductsSet.Select(S => S.Producto).Distinct().ToList();
            cbModelo.ItemsSource    = _dataDC.ProductsSet.Select(S => S.Modelo).Distinct().ToList();
            cbMarca.ItemsSource     = _dataDC.ProductsSet.Select(S => S.Marca).Distinct().ToList();
            this.DataContext        = product;
            tbProvider.ItemsSource  = _dataDC.ProveedorSet.Select(S => S).ToList();
            tbProvider.SelectedItem = p;

            ClientList.ItemsSource = from c in _dataDC.ClientSet
                                     where _dataDC.SaleSet.Where(S => S.Product_ID == _product.Id).Select(S => S.Client_ID).Contains(c.Id)
                                     select c;

            for (int añoindex = 1900; añoindex < 2025; añoindex++)
            {
                cbyear.Items.Add(añoindex);
            }
        }
示例#5
0
        private void MenuItem_MouseDown(object sender, RoutedEventArgs e)
        {
            //provmenu.PlacementTarget = this;
            //provmenu.IsOpen = true;

            ProveedorSet p = new ProveedorSet();
            Provider providerdetails = new Provider(p);
            providerdetails._new = true;

            providerdetails.ShowDialog();

            if (providerdetails._new)
            {
                lp.Add(p);
                _dataDC.ProveedorSet.AddObject(p);
                _dataDC.SaveChanges();
            }
        }
示例#6
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ProveedorSet pro = new ProveedorSet();
            List<ProveedorSet> lp = _dataDC.ProveedorSet.ToList();
            Ramdom r = new Ramdom();
               pro.Id  = r.RandomString(32);

               //pro.Apellido = direccionTextBox.Text;
               //pro.Descripcion = descripcionTextBox.Text;
               //pro.Direccion = direccionTextBox.Text;
               //pro.Email = emailTextBox.Text;
               //pro.Nombre = nombreTextBox.Text;
               //pro.TelefonoF = telefonoFTextBox.Text;
               //pro.TelefonoM = telefonoMTextBox.Text;
               //_dataDC.ProveedorSet.AddObject(pro);

               //_dataDC.SaveChanges();
        }
示例#7
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ProveedorSet        pro = new ProveedorSet();
            List <ProveedorSet> lp  = _dataDC.ProveedorSet.ToList();
            Ramdom r = new Ramdom();

            pro.Id = r.RandomString(32);

            //pro.Apellido = direccionTextBox.Text;
            //pro.Descripcion = descripcionTextBox.Text;
            //pro.Direccion = direccionTextBox.Text;
            //pro.Email = emailTextBox.Text;
            //pro.Nombre = nombreTextBox.Text;
            //pro.TelefonoF = telefonoFTextBox.Text;
            //pro.TelefonoM = telefonoMTextBox.Text;
            //_dataDC.ProveedorSet.AddObject(pro);

            //_dataDC.SaveChanges();
        }
示例#8
0
        public Provider(ProveedorSet proveedor)
        {
            InitializeComponent();

            ProductByProviderList.LWidth = 250;

            _proveedor       = proveedor;
            btSave.IsEnabled = false;
            //else
            //{
            //    tbAddress.IsEnabled = true;
            //    tbMovil.IsEnabled = true;
            //    tbFijo.IsEnabled = true;
            //    tbEmail.IsEnabled = true;
            //    btBuscar.Visibility = System.Windows.Visibility.Hidden;
            //}

            this.DataContext = proveedor;
        }
示例#9
0
        public Machine(ProductsSet product)
        {
            InitializeComponent();

            _product = product;
            _dataDC = ModelSingleton.getDataDC;
            string productPath = Properties.Settings.Default.ImagePath.ToString() + "\\" + _product.Id;
            if (!Directory.Exists(productPath))
            {
                System.IO.Directory.CreateDirectory(productPath);
            }
            ProveedorSet p;
            if (product.Proveedor_ID != null && product.Proveedor_ID !="")
            {
                p = (ProveedorSet)_dataDC.ProveedorSet.Where(S => S.Id == product.Proveedor_ID).ToList()[0];
            }
            else {
            p = new ProveedorSet();
            }

            if (product.Descripcion != "" && product.Descripcion != null) { tbdescription.Text = product.Descripcion; }

            cbProducto.ItemsSource = _dataDC.ProductsSet.Select(S => S.Producto).Distinct().ToList();
            cbModelo.ItemsSource = _dataDC.ProductsSet.Select(S => S.Modelo).Distinct().ToList();
            cbMarca.ItemsSource = _dataDC.ProductsSet.Select(S => S.Marca).Distinct().ToList();
            this.DataContext = product;
            tbProvider.ItemsSource = _dataDC.ProveedorSet.Select(S=> S ).ToList();
            tbProvider.SelectedItem = p ;

            ClientList.ItemsSource = from c in _dataDC.ClientSet
                                     where _dataDC.SaleSet.Where(S => S.Product_ID == _product.Id).Select(S => S.Client_ID).Contains(c.Id)
                                     select c;

            for (int añoindex = 1900; añoindex < 2025; añoindex++)
            {

                cbyear.Items.Add(añoindex);
            }
        }