Esempio n. 1
0
 void agregaAventa(int Producto, int Precio, int Cant)
 {
     try
     {
         var Agrega = new VENTASTICKET_PV
         {
             Prod_Id        = Producto,
             Venta_Cantidad = Cant,
             Prod_Price     = Precio,
             Venta_Importe  = (Cant * Precio),
             Ticket_Id      = idTicket
         };
         db.VENTASTICKET_PV.Add(Agrega);
         db.SaveChanges();
     }
     catch (Exception e)
     {
         MessageBox.Show("No hay productos listos para agregar");
     }
 }
Esempio n. 2
0
        void agregaAventa(string Producto, string Precio, string Cant)
        {
            int     product = Convert.ToInt32(Producto);
            int     precio  = Convert.ToInt32(Precio);
            decimal cant    = Convert.ToDecimal(Cant);

            try
            {
                var Agrega = new VENTASTICKET_PV {
                    Prod_Id        = product,
                    Venta_Cantidad = cant,
                    Prod_Price     = precio,
                    Venta_Importe  = (cant * precio),
                    Ticket_Id      = idTicket
                };
                db.VENTASTICKET_PV.Add(Agrega);
                db.SaveChanges();
            }
            catch (System.Exception)
            {
                MessageBox.Show("No hay productos listos para agregar");
            }
        }