public EmpresaMatriz indexarDados() { var cnpj = StringUtilIts.FixString(txtCnpj.Text); var novo = new EmpresaMatriz(txtRazaoSocial.Text, txtNomeFantasia.Text, cnpj, dtRegistroJunta.DateTime, DateTime.Now, txtCodMatriz.Text); novo.Cep = cepControl1.TextCep.Text; novo.Telefone = txtTelefone.Text; novo.Fax = txtFax.Text; if (dtRegistroJunta.DateTime.ValidateDate() == null) { novo.DtRegtroJuntaCom = null; } var endereco = new EnderecoCliFor(txtEndereco.Text, txtNumeroEnd.Text, txtBairro.Text, txtComplemento.Text, cepControl1.Cep, lookUpMunicipio1.UF, lookUpMunicipio1.Municipio, "Comercial"); novo.SetEndereco(endereco); if (pictureFotoProduto.Image != null) { novo.Logo = ImageUtilIts.GetBytesFromImage(pictureFotoProduto.Image); } return(novo); }
private void gridViewCliente_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) { if (e.Column == colCpfCnpj) { string cpfCnpj = StringUtilIts.ToCpfCnpj(StringUtilIts.FixString("" + e.Value)); e.DisplayText = cpfCnpj; } }
public Endereco(string endereco, string numeroEndereco, string bairro, string complemento, string cep, string uf, string cidade, string tipoEndereco) { this.NomeEndereco = endereco; this.NumeroEndereco = numeroEndereco; this.Bairro = bairro; this.Complemento = complemento; this.Cep = string.IsNullOrWhiteSpace(cep) ? null : StringUtilIts.FixString(cep); this.Uf = uf; this.Cidade = cidade; this.TipoEndereco = tipoEndereco; }
private void barBtnSerialiar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { object o = barEd.EditValue; string cnpj = o != null?o.ToString() : ""; if (!string.IsNullOrWhiteSpace(cnpj)) { cnpj = StringUtilIts.FixString(cnpj); String json = JSONHelper.GetJSONString(receitaWsUrl + cnpj); //var r = JSONHelper.GetObjectFromJSONString<LayoutReceitaWS>(json); //JsonConvert.DeserializeObject<LayoutReceitaWS>(json); this.ResultValidation = LayoutReceitaWS.GetDataFromCNPJ(cnpj);// this.lista.Clear(); this.lista.Add(ResultValidation); this.mEditJSON.Text = json; this.gridControl1.DataSource = lista; this.gridViewSerializable.RefreshData(); } else { MessageBoxBlack.Show("CNPJ " + cnpj + " inválido !"); } }