コード例 #1
0
        public void Save(string razaosocial, string nomefantasia, string cnpj, string cep, int numero)
        {
            if (razaosocial == string.Empty || nomefantasia == string.Empty || cnpj == string.Empty || cep == string.Empty || numero == 0)
            {
                MessageBox.Show("FALHA,PREENCHA OS CAMPOS!", "TOPMOVIE - ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);

                Clear = false;
            }

            else
            {
                CrudFornecedor SaveDB = new CrudFornecedor();

                // Salvar o fornecedor
                DTOFornecedor fornecedorDTO = new DTOFornecedor();

                fornecedorDTO.RazãoSocial  = razaosocial;
                fornecedorDTO.NomeFantasia = nomefantasia;
                fornecedorDTO.Cnpj         = cnpj;
                fornecedorDTO.CodigoPostal = cep;
                fornecedorDTO.Numero       = numero;



                SaveDB.SaveFornecedor(fornecedorDTO);

                MessageBox.Show("NOVO FORNECEDOR CADASTRADO!", "TOPMOVIE", MessageBoxButtons.OK, MessageBoxIcon.Information);

                Clear = true;
            }
        }