예제 #1
0
        private void GridCliente_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.ColumnIndex == 0)
            {
                CadastroCliente cadastrar = new CadastroCliente(gridCliente.Rows[e.RowIndex].Cells[1].Value.ToString());
                cadastrar.ShowDialog();

                atualizarClientes();
            }
        }
예제 #2
0
        private void BtnNovoProp_Click(object sender, EventArgs e)
        {
            string tipo = groupQuemEmpresta.Controls.OfType <RadioButton>().SingleOrDefault(rad => rad.Checked == true).Text.ToUpper();

            if (tipo == "CLIENTE")
            {
                CadastroCliente cadastrarProp = new CadastroCliente();
                cadastrarProp.ShowDialog();

                atualizarGrid(tipo);
            }
        }
예제 #3
0
        private void BtnNovoProp_Click_1(object sender, EventArgs e)
        {
            string tipo = groupQuemEmpresta.Controls.OfType <RadioButton>().SingleOrDefault(rad => rad.Checked == true).Text.ToUpper();

            if (tipo == "CLIENTE")
            {
                CadastroCliente cadastrarProp = new CadastroCliente();
                cadastrarProp.ShowDialog();

                atualizarGrid(tipo);


                try
                {
                    DataTable tabelaDados = new DataTable();

                    tabelaDados = database.select("SELECT cod_cliente, nome_cliente" +
                                                  " FROM cliente" +
                                                  " ORDER BY cod_cliente DESC" +
                                                  " LIMIT 1");

                    codPessoaBox.Text  = tabelaDados.Rows[0][0].ToString();
                    nomePessoaBox.Text = tabelaDados.Rows[0][1].ToString();


                    painelProp.Visible         = false;
                    groupQuemEmpresta.Enabled  = true;
                    groupDadosEmp.Enabled      = true;
                    groupDadosCliente.Enabled  = true;
                    btnConfirmar.Enabled       = true;
                    btnAdicionarPessoa.Visible = false;
                    labelProp.Visible          = true;
                    labelCod.Visible           = true;
                    codPessoaBox.Visible       = true;
                    nomePessoaBox.Visible      = true;
                    excluiProp.Enabled         = true;
                    excluiProp.Visible         = true;
                }
                catch { }
            }
        }