Пример #1
0
        public FormOrcamento()
        {
            InitializeComponent();


            List <Carros> lc = new List <Carros>();

            lc = Dbcarros.ListAll();


            cbNome.DataSource    = lc;
            cbNome.DisplayMember = "Nome";
            cbNome.ValueMember   = "cod";


            cbNome.SelectedIndex      = -1;
            cbMotor.SelectedIndex     = -1;
            cbOpcionais.SelectedIndex = -1;


            cbMotor.Enabled      = false;
            cbOpcionais.Enabled  = false;
            txtJuros.Enabled     = false;
            txtParcelas.Enabled  = false;
            btnAdicionar.Enabled = false;
            btnRemover.Enabled   = false;
            txtValor.Enabled     = false;
            btnCalcular.Enabled  = false;
            CalcJuros            = false;
        }
Пример #2
0
        public FormOrcamento(bool Venda)
        {
            this.Venda = Venda;
            InitializeComponent();

            if (Venda == true)
            {
                this.Text       = "Carros a venda";
                btnGerar.Text   = "Escolher";
                btnGerar.Click -= new System.EventHandler(this.btnGerar_Click);
                btnGerar.Click += new System.EventHandler(this.btnSalvar_Click);

                List <Carros> lc = new List <Carros>();
                lc = Dbcarros.ListAll();


                cbNome.DataSource    = lc;
                cbNome.DisplayMember = "Nome";
                cbNome.ValueMember   = "cod";


                cbNome.SelectedIndex      = -1;
                cbMotor.SelectedIndex     = -1;
                cbOpcionais.SelectedIndex = -1;


                cbMotor.Enabled      = false;
                cbOpcionais.Enabled  = false;
                txtJuros.Enabled     = false;
                txtParcelas.Enabled  = false;
                btnAdicionar.Enabled = false;
                btnRemover.Enabled   = false;
                txtValor.Enabled     = false;
                btnCalcular.Enabled  = false;
                CalcJuros            = false;
            }
        }
Пример #3
0
        public FormOrcamento(Vendas v, bool Venda, bool edit)
        {
            this.Venda = Venda;
            InitializeComponent();
            this.Text       = "Carros a venda";
            btnGerar.Text   = "Salvar";
            btnGerar.Click -= new System.EventHandler(this.btnGerar_Click);
            btnGerar.Click += new System.EventHandler(this.btnSalvar_Click);

            List <Carros> lc = new List <Carros>();

            lc = Dbcarros.ListAll();
            cbNome.DataSource    = lc;
            cbNome.DisplayMember = "Nome";
            cbNome.ValueMember   = "cod";

            editMode    = edit;
            cbNome.Text = v.Carro.Nome;
            if (v.Carro.MotorTexto == "1.0")
            {
                cbMotor.Text = "1.0";
            }
            if (v.Carro.MotorTexto == "1.0 TURBO")
            {
                cbMotor.Text = "1.0 TURBO";
            }
            if (v.Carro.MotorTexto == "1.3")
            {
                cbMotor.Text = "1.3";
            }
            if (v.Carro.MotorTexto == "1.6")
            {
                cbMotor.Text = "1.6";
            }
            if (v.Carro.MotorTexto == "2.0")
            {
                cbMotor.Text = "2.0";
            }
            if (v.Carro.MotorTexto == "2.0 TURBO")
            {
                cbMotor.Text = "2.0 TURBO";
            }

            if (v.Carro.TetoSolar == true)
            {
                tetoSolar = true;
            }
            if (v.Carro.LigaLeve == true)
            {
                ligaLeve = true;
            }
            if (v.Carro.Multimidia == true)
            {
                multimidia = true;
            }

            txtJuros.Text    = "" + v.Juros;
            txtParcelas.Text = "" + v.NParcelas;
            txtValor.Text    = "" + v.PrecoFinal;
            txtValor.Enabled = false;


            if (editMode == false)
            {
                btnCancelar.Text     = "Fechar";
                cbMotor.Enabled      = false;
                cbOpcionais.Enabled  = false;
                txtJuros.Enabled     = false;
                txtParcelas.Enabled  = false;
                btnAdicionar.Enabled = false;
                btnRemover.Enabled   = false;
                txtValor.Enabled     = false;
                btnCalcular.Enabled  = false;
                btnGerar.Visible     = false;
                cbNome.Enabled       = false;
            }
        }