Exemplo n.º 1
0
        private void GENERAR_FACTURA_Click(object sender, EventArgs e)
        {
            NuevaFactura form = new NuevaFactura();

            form.MdiParent = this;
            form.Show();
        }
Exemplo n.º 2
0
        private void existeFactura()
        {
            string        consultaBusqueda = String.Format("select * from mmel.Facturacion  where idEstadia = {0}", idEstadia);
            string        strCo            = ConfigurationManager.AppSettings["stringConexion"];
            SqlConnection con = new SqlConnection(strCo);
            SqlCommand    cmd = new SqlCommand(consultaBusqueda, con);

            con.Open();
            if (cmd.Connection.State == ConnectionState.Closed)
            {
                cmd.Connection.Open();
            }
            SqlDataReader reader = cmd.ExecuteReader();


            if (reader.HasRows)
            {
                int      idFactura, FactTotal, NroFactura;
                DateTime FacturaFecha;
                while (reader.Read())
                {
                    idFactura    = Int32.Parse(reader["idFactura"].ToString());
                    FactTotal    = Int32.Parse(reader["FactTotal"].ToString());
                    NroFactura   = Int32.Parse(reader["NroFactura"].ToString());
                    FacturaFecha = DateTime.Parse(reader["FacturaFecha"].ToString());
                    this.Hide();
                    FacturaExistente fe = new FacturaExistente(idFactura, FactTotal, NroFactura, FacturaFecha, idEstadia);

                    fe.Show();
                    return;
                }
                reader.Close();
                con.Close();
            }
            else
            {
                NuevaFactura nf = new NuevaFactura(idEstadia);
                nf.Show();
                this.Hide();
            }
        }