public void Ledados(CadCliente c)
        {
            NomeRS      = c.txtboxNomeOuRS.Text.ToString();
            CPFouCNPJ   = c.txtboxCPFOuCNPJ.Text.ToString();
            CEP         = c.txtboxCEP.Text.ToString();
            Logradouro  = c.txtboxLogradouro.Text.ToString();
            Número      = c.txtboxNº.Text.ToString();
            Complemento = c.txtboxComplemento.Text.ToString();
            UF          = c.txtboxUF.Text.ToString();
            Cidade      = c.txtboxCidade.Text.ToString();
            Bairro      = c.txtboxBairro.Text.ToString();
            Telefone    = c.txtboxTelefone.Text.ToString();
            Celular     = c.txtboxCelular.Text.ToString();
            Email       = c.txtboxEmail.Text.ToString();


            if (c.radioButtonPFisica.Checked == true)
            {
                RG        = c.txtboxRG.Text.ToString();
                NomeMãe   = c.txtboxNomeMãe.Text.ToString();
                Empresa   = c.txtboxEmpresa.Text.ToString();
                Setor     = c.txtboxSetor.Text.ToString();
                Profissão = c.txtboxProfissão.Text.ToString();
                Salário   = c.txtboxSalário.Text.ToString();
            }
            if (c.radioButtonPJ.Checked == true)
            {
                IE = c.txtboxIE.Text.ToString();
            }
        }
 public void PessoaF(CadCliente c)
 {
     c.txtboxNomeMãe.ReadOnly   = false;
     c.txtboxProfissão.ReadOnly = false;
     c.txtboxSalário.ReadOnly   = false;
     c.txtboxSetor.ReadOnly     = false;
     c.txtboxEmpresa.ReadOnly   = false;
     c.txtboxRG.ReadOnly        = false;
     c.txtboxIE.ReadOnly        = true;
 }
        public void SalvarXML(CadCliente c)
        {
            if (NomeRS != "" && CPFouCNPJ != "" && RG != "" || NomeRS != "" && IE != "" && CPFouCNPJ != "")
            {
                try
                {
                    XElement raiz    = XElement.Load(@"C:\Dados.xml");
                    XElement NovoCad = new XElement("Cliente",
                                                    new XElement("NomeouRazãoSocial", NomeRS),
                                                    new XElement("CPFouCNPJ", CPFouCNPJ),
                                                    new XElement("RG", RG),
                                                    new XElement("IE", IE),
                                                    new XElement("NomeMãe", NomeMãe),
                                                    new XElement("Empresa", Empresa),
                                                    new XElement("Setor", Setor),
                                                    new XElement("Profissão", Profissão),
                                                    new XElement("Salário", Salário),
                                                    new XElement("CEP", CEP),
                                                    new XElement("Logradouro", Logradouro),
                                                    new XElement("N", Número),
                                                    new XElement("Complemento", Complemento),
                                                    new XElement("UF", UF),
                                                    new XElement("Cidade", Cidade),
                                                    new XElement("Bairro", Bairro),
                                                    new XElement("Telefone", Telefone),
                                                    new XElement("Celular", Celular),
                                                    new XElement("Email", Email));
                    raiz.Add(NovoCad);
                    raiz.Save(@"C:\Dados.xml");
                }
                catch (Exception)
                {
                    MessageBox.Show("Algum caractere inválido foi digitado, por favor não digite caractere invalidos!");
                }


                CadCliente.ActiveForm.Close();
            }
            else
            {
                MessageBox.Show("Os campos: \nNome/Razão social \nCPF/CNPJ \nIE ou RG \nnão podem ficar vazios");
            }
        }
예제 #4
0
        private void buttonCadCliente_Click(object sender, EventArgs e)
        {
            CadCliente o = new CadCliente();

            o.Show();
        }