Example #1
0
 private void MotorComboBox_SelectionChangeCommitted(object sender, EventArgs e)
 {
     BLL.Motores motor = new BLL.Motores();
     BLL.Colores color = new BLL.Colores();
     motor.Buscar(Convert.ToInt32(MotorComboBox.SelectedValue));
     color.Buscar(motor.IdColor);
     ColorTextBox.Clear();
     ColorTextBox.AppendText(color.Color);
     NumeroTextBox.Clear();
     NumeroTextBox.AppendText(motor.NumeroChasis);
     PrecioTextBox.Clear();
     PrecioTextBox.AppendText(motor.Precio.ToString());
 }
Example #2
0
        //Submit button inserts Bicycle
        private void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            string  bikeMakeText          = BikeMakeTextBox.Text;
            string  modelNumberText       = ModelNumberTextBox.Text;
            string  serialNumberText      = SerialNumberTextBox.Text;
            string  colorText             = ColorTextBox.Text;
            string  descriptionText       = DescriptionTextBox.Text;
            string  locationText          = LocationTextBox.Text;
            string  physicalConditionText = PhysicalConditionTextBox.Text;
            string  notesText             = NotesTextBox.Text;
            Vehicle newVehicle            = new Vehicle(bikeMakeText, modelNumberText, serialNumberText, colorText,
                                                        descriptionText, locationText, physicalConditionText, notesText);

            newVehicle.insert();
            BikeMakeTextBox.Clear();
            ModelNumberTextBox.Clear();
            SerialNumberTextBox.Clear();
            ColorTextBox.Clear();
            DescriptionTextBox.Clear();
            NotesTextBox.Clear();
            MessageBox.Show("Vehicle inserted successfully!");
            this.Hide();
            myCaller.Show();
        }
Example #3
0
        private void BuscarButtom_Click(object sender, EventArgs e)
        {
            ErrorProvider error = new ErrorProvider();

            if (!string.IsNullOrWhiteSpace(IdtextBox.Text) && Convert.ToInt32(IdtextBox.Text) > 0)
            {
                BLL.Financiamientos fin = new BLL.Financiamientos();
                if (fin.Buscar(Convert.ToInt32(IdtextBox.Text)))
                {
                    IdtextBox.Enabled = false;
                    int id = Convert.ToInt32(IdtextBox.Text);
                    Util.Limpiar(this);
                    InteresTextBox.AppendText("3");
                    Modificar   = true;
                    IdModificar = id;
                    IdtextBox.AppendText(id.ToString());
                    ClienteComboBox.SelectedValue = fin.IdPersona;
                    GaranteComboBox.SelectedValue = fin.IdGarante;
                    MotorComboBox.SelectedValue   = fin.IdMotor;
                    InicialTextBox.AppendText(fin.Inicial.ToString());
                    QuotasComboBox.SelectedItem = fin.IntervaloPago.ToString();
                }
            }
            else
            {
                Modificar = true;
                Util.Limpiar(this);
                InteresTextBox.AppendText("3");
                Consultas.cFinanciamientos consulta = new Consultas.cFinanciamientos();
                consulta.ShowDialog(this);
                BLL.Financiamientos fin = consulta.ObtenerFinanciamiento();
                if (fin.IdFinanciamiento > 0)
                {
                    IdtextBox.Enabled = false;
                    IdModificar       = fin.IdPersona;
                    IdtextBox.AppendText(fin.IdFinanciamiento.ToString());
                    ClienteComboBox.SelectedValue = fin.IdPersona;
                    GaranteComboBox.SelectedValue = fin.IdGarante;
                    MotorComboBox.SelectedValue   = fin.IdMotor;
                    InicialTextBox.AppendText(fin.Inicial.ToString());
                    QuotasComboBox.SelectedItem = fin.IntervaloPago.ToString();
                }
            }
            BLL.Motores motor = new BLL.Motores();
            BLL.Colores color = new BLL.Colores();
            motor.Buscar(Convert.ToInt32(MotorComboBox.SelectedValue));
            color.Buscar(motor.IdColor);
            ColorTextBox.Clear();
            ColorTextBox.AppendText(color.Color);
            NumeroTextBox.Clear();
            NumeroTextBox.AppendText(motor.NumeroChasis);
            PrecioTextBox.Clear();
            PrecioTextBox.AppendText(motor.Precio.ToString());
            BLL.Personas persona = new BLL.Personas();
            persona.Buscar(Convert.ToInt32(ClienteComboBox.SelectedValue));
            ClienteTextBox.Clear();
            ClienteTextBox.AppendText(persona.Ingreso.ToString());
            persona.Buscar(Convert.ToInt32(GaranteComboBox.SelectedValue));
            GaranteTextBox.Clear();
            GaranteTextBox.AppendText(persona.Ingreso.ToString());
        }