示例#1
0
        public void CONFIRMARSI()
        {
            Vehiculos_rutas x = new Vehiculos_rutas();
            Fechalaborales  c = new Fechalaborales();

            if (REFERENCIA > TOTALFAC)
            {
                Console.WriteLine("SE EXCEDE LA CAPACIDAD ADMITIDA POR RUTA");
                bt_confirmar.Enabled = false;
            }
            else
            {
                bt_confirmar.Enabled = true;
                if (stViaje.Equals(""))
                {
                    Console.WriteLine("Se creara un nuevo viaje");
                    VEHICULOSNUEVOS();
                    INSERTARNUEVOVIAJE();
                    ASIGNAR((Convert.ToInt32(textBox1.Text)));
                }
                else
                {
                    Console.WriteLine("Ya existe un camion para esta ruta: " + lbl_ruta.Text);
                    // string[] vector = cadena.Split(' ');
                    comboBox1.DataSource    = (x.ESPACIOPORVEHICULO(lbl_ruta.Text, c.fechasiguiente() + " 07:00:00"));
                    comboBox1.DisplayMember = "id_disponibilidadvehiculo";
                    comboBox1.ValueMember   = "Disponible";
                    // Console.WriteLine(""+comboBox1.DataBindings..DisplayMember+""+comboBox1.ValueMember)

                    dataGridView3.DataSource = (x.ESPACIOPORVEHICULO(lbl_ruta.Text, c.fechasiguiente() + " 07:00:00"));
                    //-- prbar
                    timer1.Start();
                }
            }
        }
示例#2
0
        private void button1_Click(object obSender, EventArgs evE)
        {
            creardetalle();
            creardetalle();


            Vehiculos_rutas x = new Vehiculos_rutas();
            Fechalaborales  c = new Fechalaborales();

            // Console.WriteLine("--" + x.RUTAXDEPARTAMENTO(textBox4.Text));



            lbl_ruta.Text = (x.RUTAXDEPARTAMENTO(textBox4.Text));

            string viaje = (x.EXISTENCIADEVIAJE(lbl_ruta.Text));

            stViaje = "";
            stViaje = stViaje + viaje;
            Console.WriteLine("======VIAJE=====>:::::" + viaje + "::");


            string cantidadxruta = (x.vehiculosdisponibles(lbl_ruta.Text));

            Console.WriteLine("TOTAL POR RUTA " + cantidadxruta);
            int cantidadxfactura = (Convert.ToInt32(TOTAL()));

            Console.WriteLine("TOTAL PARA LA FACTURA: " + cantidadxfactura);
            total         = "";
            total         = total + cantidadxfactura;
            textBox1.Text = total;
            string cantidadasignado = (x.utilizadoporfechayruta(lbl_ruta.Text, c.fechasiguiente()));//..

            Console.WriteLine("Capacidad: " + cantidadxruta + " Ingresados: " + cantidadasignado + " Nuevo ingreso: " + cantidadxfactura);

            int X = (Convert.ToInt32(cantidadxruta));
            int Y = (Convert.ToInt32(cantidadasignado));
            int Z = (Convert.ToInt32(cantidadxfactura));

            TOTALFAC   = X;
            REFERENCIA = (Y + Z);
            //int YZ = (Y + Z);

            /**
            **/

            //DUDA
            // dataGridView3.DataSource = (x.ESPACIOPORVEHICULO(lbl_ruta.Text, c.fechasiguiente() + " 07:00:00"));
            //-- prbar
            //  timer1.Start();
            dt_Vactual.DataSource = null;
            VEHICULOSNUEVOS();
        }