Ejemplo n.º 1
0
 private void Grid_Loaded_1(object sender, RoutedEventArgs e)
 {
     BaseDatos.BD.MiBD bd = new BD.MiBD();
     DFactura.ItemsSource = bd.Productoss.ToList();
     DFactura.SelectedValuePath = "IDCodigo";
     DFactura.DisplayMemberPath = "NombreP";
 }
Ejemplo n.º 2
0
 private void Grid_Loaded_1(object sender, RoutedEventArgs e)
 {
     BaseDatos.BD.MiBD bd = new BD.MiBD();
     DFactura.ItemsSource       = bd.Productoss.ToList();
     DFactura.SelectedValuePath = "IDCodigo";
     DFactura.DisplayMemberPath = "NombreP";
 }
Ejemplo n.º 3
0
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     MiBD db = new MiBD();
     int id = (int)DFactura.SelectedValue;
     BaseDatos.BD.Producto p = db.Productoss.SingleOrDefault(x => x.IDCodigo == id);
     tempP = p;
     Cartas.RemoveAll(s => s.IDCodigo == tempP.IDCodigo);
     Cartas.Add(new BaseDatos.BD.Producto()
     {
         IDCodigo = tempP.IDCodigo,
         NombreP = tempP.NombreP,
         NombreCa = tempP.NombreCa,
         Precio = tempP.Precio,
     });
     Virtus();
     tempP = null;
 }
Ejemplo n.º 4
0
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     if (Cartas.Count > 0 && DFactura.SelectedIndex > -1)
     {
         using (BaseDatos.BD.MiBD db = new BaseDatos.BD.MiBD())
         {
             using (var trans = db.Database.BeginTransaction())
             {
                 try
                 {
                     BaseDatos.BD.Ventas   fact = new BaseDatos.BD.Ventas();
                     BaseDatos.BD.Producto cart = new BaseDatos.BD.Producto();
                 }
             }
         }
     }
 }
Ejemplo n.º 5
0
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     if (Cartas.Count > 0 && DFactura.SelectedIndex > -1)
     {
         using (BaseDatos.BD.MiBD db = new BaseDatos.BD.MiBD())
         {
             using (var trans = db.Database.BeginTransaction())
             {
                 try
                 {
                     BaseDatos.BD.Ventas fact = new BaseDatos.BD.Ventas();
                     BaseDatos.BD.Producto cart = new BaseDatos.BD.Producto();
                 }
             }
         }
     }
 }