Exemplo n.º 1
0
        public override void Save()
        {
            if (this.IDTipoDocumento == TipoDocumento.CPF().IDTipoDocumento)
            {
                this.DocNumero      = DescDocumento.Substring(0, DescDocumento.Length - 2);
                this.DocDV          = DescDocumento.Substring(DescDocumento.Length - 2, 2);
                this.DocComplemento = string.Empty;
            }
            else if (this.IDTipoDocumento == TipoDocumento.RG().IDTipoDocumento)
            {
                this.DocNumero      = string.Empty;
                this.DocDV          = string.Empty;
                this.DocComplemento = string.Empty;
            }
            else if (this.IDTipoDocumento == TipoDocumento.CNPJ().IDTipoDocumento)
            {
                this.DocNumero      = DescDocumento.Substring(0, DescDocumento.Length - 6);
                this.DocComplemento = DescDocumento.Substring(DescDocumento.Length - 6, 4);
                this.DocDV          = DescDocumento.Substring(DescDocumento.Length - 2, 2);
            }
            else if (this.IDTipoDocumento == TipoDocumento.TVI().IDTipoDocumento)
            {
                this.DocNumero      = DescDocumento.Substring(0, 4);
                this.DocComplemento = DescDocumento.Substring(4, 7);
                this.DocDV          = DescDocumento.Substring(DescDocumento.Length - 1, 1);
            }

            base.Save();
        }
Exemplo n.º 2
0
 public Documento GetDocumentoCNPJ()
 {
     return(GetDocumento(TipoDocumento.CNPJ()));
 }