Beispiel #1
0
        private decimal descontoAplicado = 0; //global -> usado em toda tela, é o deconto aplicado, caso exista..

        public Venda()
        {
            InitializeComponent();


            int id = c.RetornaIdVendaAtual();

            txtNumVenda.Text = id.ToString().PadLeft(9, '0');
            txtNumVenda.Select(txtNumVenda.Text.Length, txtNumVenda.Text.Length);

            c.fillCombo(cboClientes, "select * from cliente where deletado <> 1 order by nome ", "id", "nome");
            cboClientes.SelectedValue = 0;

            c.fillCombo(cboFuncionarios, "select * from funcionario where deletado <> 1 order by nome", "id", "nome");
            cboFuncionarios.SelectedValue = 0;

            c.fillCombo(cboProcedimento, "select * from procedimento where deletado <> 1 order by descricao", "id", "descricao");
            cboProcedimento.SelectedValue = 0;

            c.fillCombo(cboAdicional, "select * from adicional where deletado <> 1 order by descricao", "id", "descricao");
            cboAdicional.SelectedValue = 0;

            c.fillCombo(cboFormaPgto, "select * from forma_pgto where deletado <> 1 order by descricao", "id", "descricao");
            cboFormaPgto.SelectedValue = 0;

            int idVenda = int.Parse(txtNumVenda.Text); //global, para ser usado nos inserts

            DataGridViewCellStyle aligncenter = new DataGridViewCellStyle();

            aligncenter.Alignment = DataGridViewContentAlignment.MiddleCenter;
            grdVenda.Columns[0].DefaultCellStyle = aligncenter;
            grdVenda.Columns[1].DefaultCellStyle = aligncenter;
            grdVenda.Columns[2].DefaultCellStyle = aligncenter;
            grdVenda.Columns[3].DefaultCellStyle = aligncenter;
        }
Beispiel #2
0
 private void TabControl1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (tabControl1.SelectedIndex == 2)
     {
         c.fillCombo(cboFuncionarios, "select * from funcionario where isnull(deletado,0)<>1 order by nome", "id", "nome");
         if (grdFuncDet.RowCount <= 0)
         {
             cboFuncionarios.SelectedIndex = -1;
         }
     }
 }