예제 #1
0
 /// <summary>
 /// Crear un nuevo objeto Vehiculo.
 /// </summary>
 /// <param name="id">Valor inicial de la propiedad id.</param>
 /// <param name="patente">Valor inicial de la propiedad Patente.</param>
 /// <param name="fechaHoraEntrada">Valor inicial de la propiedad FechaHoraEntrada.</param>
 /// <param name="nroTicket">Valor inicial de la propiedad NroTicket.</param>
 public static Vehiculo CreateVehiculo(global::System.Int32 id, global::System.String patente, global::System.DateTime fechaHoraEntrada, global::System.Int32 nroTicket)
 {
     Vehiculo vehiculo = new Vehiculo();
     vehiculo.id = id;
     vehiculo.Patente = patente;
     vehiculo.FechaHoraEntrada = fechaHoraEntrada;
     vehiculo.NroTicket = nroTicket;
     return vehiculo;
 }
예제 #2
0
        private void txtTexto_TextChanged(object sender, EventArgs e)
        {
            if (Modo == "Ingreso")
            {
                if (Tipeo == "Patente")
                {
                    if (txtTexto.Text.Length == 3)
                    {
                        txtClase.Text = "?";
                        Tipeo = "Clase";
                        lblEstado.Text = "INGRESO | Introduzca la Clase";
                    }
                }

                if (Tipeo == "Precio")
                {

                    btnIngreso.Text = "ACEPTAR";

                    if (txtTexto.Text.Length > 0)
                    {
                        if (Convert.ToDecimal(txtTexto.Text) > 0)
                        {
                            lblEstado.Text = "INGRESO | ¿Aceptar ingreso?";
                            btnIngreso.Enabled = true;

                            if (txtTexto.Text.Contains(","))
                            {
                                if (txtTexto.Text.Substring(txtTexto.Text.IndexOf(",") + 1).Length > 1)
                                {
                                    gboxNumeros.Enabled = false;
                                }

                            }

                            if (txtTexto.Text.Length == 7)
                            {
                                gboxNumeros.Enabled = false;
                            }
                        }

                    }
                }

            }

            if (Modo == "Salida")
            {
                if (Tipeo == "Patente")
                {
                    if (txtTexto.Text.Length == 1)
                    {
                        txtTexto.Text = txtTexto.Text + " ";
                    }

                    if (txtTexto.Text.Length == 5)
                    {
                        //VALIDAR EXISTENTE
                        oVehiculo = ControladoraVehiculos.VerificarVehiculo(txtTexto.Text);
                        if (oVehiculo != null)
                        {

                            timerError.Enabled = false;
                            lblError.Visible = false;
                            countParpadeo = 0;
                            gboxNumeros.Enabled = false;
                            btnSalida.Enabled = true;
                            btnSalida.Text = "ACEPTAR";
                            Tipeo = "";

                            //  txtTexto.Text = "$14,00";
                            lblEstado.Text = "SALIDA | ¿Aceptar salida?";
                            return;
                        }
                        else
                        {
                            lblError.Text = "ERROR! VEHICULO INEXISTENTE";
                            timerError.Enabled = true;
                            //lblEstado.Text = "SALIDA | Introduzca numero de Patente     ERROR! VEHICULO INEXISTENTE";
                            gboxNumeros.Enabled = false;
                            timerEstado.Enabled = true;
                            return;
                        }

                    }
                }

            }

            btnFoco.Focus();
        }
예제 #3
0
 /// <summary>
 /// Método desusado para agregar un nuevo objeto al EntitySet Vehiculos. Considere la posibilidad de usar el método .Add de la propiedad ObjectSet&lt;T&gt; asociada.
 /// </summary>
 public void AddToVehiculos(Vehiculo vehiculo)
 {
     base.AddObject("Vehiculos", vehiculo);
 }
예제 #4
0
        private void btnIngreso_Click(object sender, EventArgs e)
        {
            if (btnIngreso.Enabled == true)
            {
                if (btnIngreso.Text == "INGRESO")
                {
                    lblEstado.Text = "INGRESO | Introduzca numero de Patente";

                    gboxNumeros.Enabled = true;

                    btnCancelar.Enabled = true;

                    btnIngreso.Enabled = false;
                    btnSalida.Enabled = false;
                    btnControles.Enabled = false;

                    Modo = "Ingreso";
                    Tipeo = "Patente";
                };

                if (btnIngreso.Text == "ACEPTAR")
                {
                    oVehiculo = new Vehiculo();
                    oVehiculo.Clase = ControladoraClases.BuscarClase(txtClase.Text);
                    oVehiculo.FechaHoraEntrada = DateTime.Now;
                    ControladoraSistema.Sistema().NumeracionTickets++;
                    oVehiculo.NroTicket = ControladoraSistema.Sistema().NumeracionTickets.Value;

                    if (Tipeo == "Precio")
                    {
                        //GENERAR INGRESO PARA CLASE 9 CON PRECIO

                        oVehiculo.Patente = oPatente;
                        oVehiculo.Precio = Convert.ToDecimal(txtTexto.Text);
                        oVehiculo.Caja = ControladoraCajas.BuscarCajaAbierta();
                        oVehiculo.Caja.Total += Convert.ToDecimal(oVehiculo.Precio.Value);
                        lblPesos.Visible = false;

                        //limpiarPantalla();

                    }
                    else
                    {

                        oVehiculo.Patente = txtTexto.Text;

                    }

                    //GENERANDO INGRESO -->
                    oVehiculo.Estado = "Activo";
                    ControladoraVehiculos.GenerarEntradaVehiculo(oVehiculo);

                    //IMPRIMIR TICKET
                    if (oVehiculo.Clase.Codigo == "9") //CLASE 9
                    {

                        frmTelefonoEstadia ofrmTelefonoEstadia = new frmTelefonoEstadia(oVehiculo);
                        ofrmTelefonoEstadia.ShowDialog();

                         ControladoraImpresion.ImprimirTicketClase9(oVehiculo);                                  //IMPRESION
                         ControladoraImpresion.ImprimirTicketClase9Duplicado(oVehiculo);                         //IMPRESION
                    }
                    else // CLASE COMUN
                    {
                         ControladoraImpresion.ImprimirTicketEntrada(oVehiculo);                                 //IMPRESION
                    }

                    limpiarPantalla();

                }

            }
            btnFoco.Focus();
        }