private void label6_DoubleClick(object sender, EventArgs e)
        {
            MinComprobante comprobante = new MinComprobante();

            if (MessageBox.Show("Abrir el comprobante?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                comprobante.Nombre            = label1.Text;
                comprobante.NumeroComprobante = this.comprobante.Diferencia_Comprobante_Numero;
                comprobante.retriveComprobante();
                this.Hide();
                //string name, string price, string teacher, string amount, string clasesTotal)
                Comprobante_Para_Reimpresion frm3 = new Comprobante_Para_Reimpresion(comprobante);
                frm3.ShowDialog();
                this.Show();
            }
        }
        private void button1_Click_4(object sender, EventArgs e)
        {
            try
            {
                MinComprobante auxComprobante = new MinComprobante();

                var client     = new MongoClient(Global.Path_DataBase);
                var database   = client.GetDatabase("Personas");
                var collection = database.GetCollection <BsonDocument>("Comprobantes");
                var builder    = Builders <BsonDocument> .Filter;
                var filter     = builder.Eq("NumeroComprobante", textBox1.Text);
                var result     = collection.Find(filter).ToList();
                foreach (var doc in result)
                {
                    auxComprobante.Fecha             = doc.GetValue("Fecha", "no posee").AsString;
                    auxComprobante.NumeroComprobante = doc.GetValue("NumeroComprobante", "no posee").AsString;
                    auxComprobante.Nombre            = doc.GetValue("Nombre", "no posee").AsString;

                    var clase = doc.GetValue("Clases", "No posee").AsBsonArray;
                    foreach (var doc2 in clase)
                    {
                        var            clase2         = doc2.AsBsonDocument;
                        Comprobantemin comprobanteaux = new Comprobantemin();
                        comprobanteaux.CantidadClases   = clase2.GetValue("CantidadClases", "No Posee").AsString;
                        comprobanteaux.Profesor         = clase2.GetValue("Profesor", "No Posee").AsString;
                        comprobanteaux.Precio           = clase2.GetValue("Precio", "No Posee").AsString;
                        comprobanteaux.ClasesTomar      = clase2.GetValue("ClasesTomar", "No Posee").AsString;
                        comprobanteaux.Descripcion      = clase2.GetValue("Descripcion", "No Posee").AsString;
                        comprobanteaux.cantidadElegidos = clase2.GetValue("cantidadElegidos", "No Posee").AsString;
                        comprobanteaux.Total            = clase2.GetValue("Total", "No Posee").AsString;
                        auxComprobante.comprobantes.Add(comprobanteaux);
                    }
                }

                this.Hide();
                //string name, string price, string teacher, string amount, string clasesTotal)
                Comprobante_Para_Reimpresion frm3 = new Comprobante_Para_Reimpresion(auxComprobante);
                frm3.ShowDialog();
                this.Show();
            }
            catch
            {
                MessageBox.Show("El Numero de recibo es incorrecto o el recibo no existe");
            }
        }
Esempio n. 3
0
        private void objectListView1_DoubleClick(object sender, EventArgs e)
        {
            MinComprobante comprobante = new MinComprobante();

            try
            {
                if (MessageBox.Show("Desea Abrir el comprobante?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    comprobante = ((MinComprobante)objectListView1.SelectedObject);
                    comprobante.retriveComprobante();
                    this.Hide();
                    //string name, string price, string teacher, string amount, string clasesTotal)
                    Comprobante_Para_Reimpresion frm3 = new Comprobante_Para_Reimpresion(comprobante);
                    frm3.ShowDialog();
                    this.Show();
                }
            }
            catch
            {
            }
        }