Exemple #1
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            OrdenesCombustible oc = null;
            int filaseleccionada  = Convert.ToInt32(this.dataGridView1.CurrentRow.Index);

            foreach (OrdenesCombustible o in lista)
            {
                if (o.Idordenescombustible == Convert.ToInt32(dataGridView1[0, filaseleccionada].Value))
                {
                    oc = o;
                }
            }
            frmImpOComb frm = new frmImpOComb(oc);

            frm.ShowDialog();
        }
Exemple #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         if (p != null && u != null && Convert.ToDouble(txtImporteFinal.Text) > 0)
         {
             OrdenesCombustible             oc = new OrdenesCombustible(0, "0", Convert.ToDateTime(maskedTextBox1.Text), p, u, Convert.ToDecimal(txtPrecioComb.Text), Convert.ToDecimal(txtLitros.Text.Replace('.', ',')), ptoventa);
             ControladoraOrdenesCombustible c  = new ControladoraOrdenesCombustible();
             string id = c.Agregar(oc);
             oc.Nro = id;
             frmImpOComb frm = new frmImpOComb(oc);
             frm.ShowDialog();
             MessageBox.Show("Orden de combustible generada correctamente");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }