Beispiel #1
0
        public frmAlterarCliente(string valorID)
        {
            this.valorID = valorID;
            InitializeComponent();



            cidadesConc = new List <string>();
            cidadesConc = cidades.selecionarCidades(listaDeCidades);

            cbCidade.DataSource = cidadesConc;

            cbCidade.DisplayMember = "cidades";

            try
            {
                cidadeConc = clienteBO.selecionarCliente(cliente, valorID, cidadeConc, cidade);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            if (cliente.TipoPessoa == "J")
            {
                cliente.TipoPessoa = "Júridica";
            }
            else
            {
                cliente.TipoPessoa = "Física";
            }

            if (cliente.Situacao == "A")
            {
                cliente.Situacao = "Ativo";
            }
            else
            {
                cliente.Situacao = "Inativo";
            }
            txtRazaoSocial.Text  = cliente.RazaoSocial;
            txtNomeFantasia.Text = cliente.NomeFantasia;
            mskCPFCNPJ.Text      = cliente.CPF_CNPJ;
            mskRGIE.Text         = cliente.RG_IE;
            txtEmail.Text        = cliente.Email;
            mskTelefone.Text     = cliente.Telefone;
            mskCelular.Text      = cliente.Celular;
            txtEndereco.Text     = cliente.Endereco;
            txtNumero.Text       = cliente.NumEndereco.ToString();
            txtBairro.Text       = cliente.Bairro;
            cbTipo.Text          = cliente.TipoPessoa;
            cbSituacao.Text      = cliente.Situacao;
            cbCidade.Text        = cidadeConc;
            cliente.Codigo       = Convert.ToInt32(valorID);
        }