Ejemplo n.º 1
0
        private void ClientePJ(mPJ_Ext obj)
        {
            try
            {
                string identificador = new mMascaras().Remove(Atendimento.Cliente.Inscricao);


                if (obj == null)
                {
                    if (MessageBox.Show("CLIENTE " + Atendimento.Cliente.Inscricao + " não encontrado! Cadastrá-lo agora?", "Sim.Alerta!", MessageBoxButton.YesNo, MessageBoxImage.Asterisk) == MessageBoxResult.Yes)
                    {
                        ns.Navigate(new Uri("/Sim.Modulo.Empreendedor;component/View/pAddPJ.xaml", UriKind.Relative));
                        AreaTransferencia.CNPJ  = Atendimento.Cliente.Inscricao;
                        AreaTransferencia.CadPJ = true;
                    }

                    return;
                }

                AsyncPJ(obj.CNPJ);

                Atendimento.Cliente.Inscricao = new mMascaras().CNPJ(obj.CNPJ);
                Atendimento.Cliente.NomeRazao = obj.RazaoSocial;
                Atendimento.Cliente.Telefones = obj.Telefones;
                Atendimento.Cliente.Email     = obj.Email;

                Corpo     = Visibility.Visible;
                Cabecalho = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void ExecuteCommandPesquisarInscricao(object obj)
        {
            try
            {
                if (Atendimento.Cliente.Inscricao == string.Empty)
                {
                    return;
                }

                string identificador = new mMascaras().Remove(Atendimento.Cliente.Inscricao);

                PF.Clear();
                PJ.Clear();

                switch (identificador.Length)
                {
                case 11:
                    ClientePF(new mData().ExistPessoaFisica(identificador));
                    break;

                case 14:
                    ClientePJ(new mData().ExistPessoaJuridica(identificador));
                    break;
                }
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }
        }
Ejemplo n.º 3
0
        private void ExecuteCommandAlterar(object obj)
        {
            try
            {
                if (Atendimento.Cliente.Inscricao == string.Empty)
                {
                    return;
                }

                string identificador = new mMascaras().Remove((string)obj);

                //Cliente.Clear();
                //PJ.Clear();
                //PF.Clear();

                switch (identificador.Length)
                {
                case 11:
                    ns.Navigate(new Uri("/Sim.Modulo.Empreendedor;component/View/pAddPF.xaml", UriKind.Relative));
                    AreaTransferencia.CPF   = (string)obj;  // Atendimento.Cliente.Inscricao;
                    AreaTransferencia.CadPF = true;
                    break;

                case 14:
                    ns.Navigate(new Uri("/Sim.Modulo.Empreendedor;component/View/pAddPJ.xaml", UriKind.Relative));
                    AreaTransferencia.CNPJ  = (string)obj;    // Atendimento.Cliente.Inscricao;
                    AreaTransferencia.CadPJ = true;
                    break;
                }
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }
        }
Ejemplo n.º 4
0
 private void ExecCommandAlterar(object obj)
 {
     try
     {
         if (Logged.Acesso == (int)AccountAccess.Master)
         {
             string identificador = new mMascaras().Remove(obj.ToString());
             ns.Navigate(new Uri("/Sim.Sec.Desenvolvimento;component/Shared/View/Empresa/pView.xaml", UriKind.Relative));
             AreaTransferencia.CNPJ = identificador;
         }
         else
         {
             foreach (Account.Model.mSubModulos m in Logged.Submodulos)
             {
                 if (m.SubModulo == (int)SubModulo.SalaEmpreendedor || m.SubModulo == (int)SubModulo.SebraeAqui)
                 {
                     if (m.Acesso > (int)SubModuloAccess.Consulta)
                     {
                         string identificador = new mMascaras().Remove(obj.ToString());
                         ns.Navigate(new Uri("/Sim.Sec.Desenvolvimento;component/Shared/View/Empresa/pView.xaml", UriKind.Relative));
                         AreaTransferencia.CNPJ = identificador;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 5
0
        private string Autorizacao2020()
        {
            var t = string.Empty;

            Task.Run(() => t = new Repositorio.RDIA().UltimaAutorizacao()).Wait();

            if (t == null || t == string.Empty)
            {
                t = string.Format("{0}00000", 2020);
            }
            else
            {
                t = new mMascaras().Remove(t);
            }


            ulong n = Convert.ToUInt64(t);

            n++;

            string res = n.ToString();

            for (int i = 0; i < 4; i++)
            {
                res = res.Remove(0, 1);
            }

            string r = string.Format("{0}{1}", 2020, res);

            return(Convert.ToUInt64(r).ToString(@"000\.000\.0\-00"));
        }
Ejemplo n.º 6
0
        private void ClientePF(mPF_Ext obj)
        {
            try
            {
                string identificador = new mMascaras().Remove(Atendimento.Cliente.Inscricao);


                if (obj == null)
                {
                    if (MessageBox.Show("CLIENTE " + Atendimento.Cliente.Inscricao + " não encontrado! Cadastrá-lo agora?", "Sim.Alerta!", MessageBoxButton.YesNo, MessageBoxImage.Asterisk) == MessageBoxResult.Yes)
                    {
                        ns.Navigate(new Uri("/Sim.Modulo.Empreendedor;component/View/pAddPF.xaml", UriKind.Relative));
                        //NavigationCommands.GoToPage.Execute(new Uri("/Sim.Modulo.Empreendedor;component/View/pAddPFe.xaml", UriKind.Relative), null);
                        AreaTransferencia.CPF    = Atendimento.Cliente.Inscricao;
                        AreaTransferencia.CPF_On = true;
                    }

                    return;
                }

                Atendimento.Cliente.Inscricao = new mMascaras().CPF(obj.CPF);
                Atendimento.Cliente.NomeRazao = obj.Nome;
                Atendimento.Cliente.Telefones = obj.Telefones;
                Atendimento.Cliente.Email     = obj.Email;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 7
0
        private void ExecuteCommandGetCPF(object obj)
        {
            try
            {
                if (Viabilidade.Requerente.Inscricao == string.Empty)
                {
                    return;
                }

                string identificador = new mMascaras().Remove(Viabilidade.Requerente.Inscricao);

                Requerente.Clear();

                switch (identificador.Length)
                {
                case 11:
                    ClientePF(new mData().ExistPessoaFisica(identificador));
                    break;

                case 14:
                    ClientePJ(new mData().ExistPessoaJuridica(identificador));
                    break;
                }
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }
        }
Ejemplo n.º 8
0
        private FlowDocument ApresentarDados(object cliente)
        {
            string _cliente = new mMascaras().Remove((string)cliente);

            FlowDocument flow = new FlowDocument();

            switch (_cliente.Length)
            {
            case 11:
                flow = FlowPF(_cliente);
                break;

            case 14:
                flow = FlowPJ(_cliente);
                break;
            }

            return(flow);
        }
Ejemplo n.º 9
0
        private async void ApresentarDados(object cliente)
        {
            string _cliente = new mMascaras().Remove((string)cliente);

            await Task.Run(() => {
                FlowDoc.Dispatcher.BeginInvoke(new Action(delegate() {
                    switch (_cliente.Length)
                    {
                    case 11:
                        FlowDoc = FlowPF(_cliente);
                        break;

                    case 14:
                        FlowDoc = FlowPJ(_cliente);
                        break;
                    }
                }));
            });
        }
Ejemplo n.º 10
0
        private async void ApresentarDados(object cliente)
        {
            string _cliente = new mMascaras().Remove((string)cliente);

            await Task.Factory.StartNew(() =>
            {
                FlowDoc.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new Action(delegate()
                {
                    switch (_cliente.Length)
                    {
                    case 11:
                        FlowDoc = FlowPF(_cliente);
                        break;

                    case 14:
                        FlowDoc = FlowPJ(_cliente);
                        break;
                    }
                }));
            });
        }
Ejemplo n.º 11
0
        private void ClientePJ(mPJ_Ext obj)
        {
            try
            {
                string identificador = new mMascaras().Remove(Viabilidade.Requerente.Inscricao);


                if (obj == null)
                {
                    if (MessageBox.Show("CLIENTE " + Viabilidade.Requerente.Inscricao + " não encontrado! Cadastrá-lo agora?", "Sim.Alerta!", MessageBoxButton.YesNo, MessageBoxImage.Asterisk) == MessageBoxResult.Yes)
                    {
                        //NavigationCommands.GoToPage.Execute(new Uri("pAddPJe.xaml", UriKind.RelativeOrAbsolute), null);
                        GlobalNavigation.Navegar = new Uri("/Sim.Sec.Desenvolvimento;component/Shared/View/Empresa/pView.xaml", UriKind.Relative);
                        AreaTransferencia.CNPJ   = Viabilidade.Requerente.Inscricao;
                    }

                    return;
                }

                Requerente.Add(new mCliente()
                {
                    Inscricao = new mMascaras().CNPJ(obj.CNPJ),
                    NomeRazao = obj.RazaoSocial,
                    Telefones = obj.Telefones,
                    Email     = obj.Email
                });

                Viabilidade.Requerente.Inscricao = new mMascaras().CNPJ(obj.CNPJ);
                Viabilidade.Requerente.NomeRazao = obj.RazaoSocial;
                Viabilidade.Requerente.Telefones = obj.Telefones;
                Viabilidade.Requerente.Email     = obj.Email;

                //Corpo = Visibility.Visible;
                //Cabecalho = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 12
0
        private void ClientePF(mPF_Ext obj)
        {
            try
            {
                string identificador = new mMascaras().Remove(Viabilidade.Requerente.Inscricao);


                if (obj == null)
                {
                    if (MessageBox.Show("CLIENTE " + Viabilidade.Requerente.Inscricao + " não encontrado! Cadastrá-lo agora?", "Sim.Alerta!", MessageBoxButton.YesNo, MessageBoxImage.Asterisk) == MessageBoxResult.Yes)
                    {
                        GlobalNavigation.Navegar = new Uri("/Sim.Modulo.Empreendedor;component/View/pAddPF.xaml", UriKind.Relative);
                        //NavigationCommands.GoToPage.Execute(new Uri("/Sim.Modulo.Empreendedor;component/View/pAddPFe.xaml", UriKind.Relative), null);
                        AreaTransferencia.CPF = Viabilidade.Requerente.Inscricao;
                    }

                    return;
                }

                Requerente.Add(new mCliente()
                {
                    Inscricao = new mMascaras().CPF(obj.CPF),
                    NomeRazao = obj.Nome,
                    Telefones = obj.Telefones,
                    Email     = obj.Email
                });

                Viabilidade.Requerente.Inscricao = new mMascaras().CPF(obj.CPF);
                Viabilidade.Requerente.NomeRazao = obj.Nome;
                Viabilidade.Requerente.Telefones = obj.Telefones;
                Viabilidade.Requerente.Email     = obj.Email;

                //Corpo = Visibility.Visible;
                //Cabecalho = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }