Exemplo n.º 1
0
 private void InsertarPaquete()
 {
     try
     {
         foreach (DataGridViewRow dr in dgvPaquetes.Rows)
         {
             Paquete pa = new Paquete();
             pa.IDProducto       = p.ID;
             pa.Precio           = (decimal)dr.Cells[1].Value;
             pa.CantidadPaquetes = (int)dr.Cells[2].Value;
             if (!(bool)dr.Cells[3].Value)
             {
                 pa.Insertar();
             }
             else if ((bool)dr.Cells[4].Value)
             {
                 pa.ID = (int)dr.Cells[0].Value;
                 pa.Editar();
             }
         }
     }
     catch (MySqlException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
        public void InsertarPaquete(string destinatario, string remitente, string tipo, int cantidad, string estado)
        {
            Paquete pac = new Paquete();

            pac.Insertar(destinatario, remitente, tipo, cantidad, estado);
        }