Exemple #1
0
        private void bus_Click(object sender, RoutedEventArgs e)
        {
            PrincipalFP db = new PrincipalFP();
            //parse the product code as int from the TextBox
            int id = int.Parse(Matr.Text);

            //We query the database for the product
               FProyectBD.DBClass.Sanciones  m= db.Sanciones.SingleOrDefault(x => x.IdS == id);
               tempSan = m;
            if (m != null) //if product was found
            {
                //store in a temp variable (if user clicks on add we will need this for the Array)
            //    tempSan= m;
                //We display the product information on a label
                Total.Content = string.Format("ID: {0}, Name: {1}, Price: {2}, InStock (Qty): {3}", p.Id, p.Name, p.Price, p.Qty);
            }
        }
Exemple #2
0
        private void Limpiar()
        {
            Query = new List<Sanciones>();
            Matr.Text = string.Empty;

            Cd1.SelectedIndex = 0;
            San1.SelectedIndex = 0;

            DataR.ItemsSource = null;
            DataR.Items.Refresh();
            tempSan = null;
        }