Example #1
0
        private void txtCnpj_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && txtCnpj.Text.Length == 18)
            {
                var r = LayoutReceitaWS.GetDataFromCNPJTyped <EmpresaMatriz>(txtCnpj.Text);

                indexarDados(r);
            }
        }
Example #2
0
        private void txtCnpj_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && txtCnpj.Text.Length == 18)
            {
                var r = LayoutReceitaWS.GetDataFromCNPJTyped <EmpresaFilial>(txtCnpj.Text);

                indexarFormulario(r);
            }
        }
Example #3
0
        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 !");
            }
        }
Example #4
0
        private bool requestServer(string cnpj)
        {
            this.ResultValidation = LayoutReceitaWS.GetDataFromCNPJ(cnpj);

            return(this.ResultValidation != null);
        }