private void GlobalNotifyProperty_GlobalPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "CadAmbulanteOK")
            {
                if (AreaTransferencia.CadAmbulanteOK == true)
                {
                    if (Atendimento.Historico.Length > 0)
                    {
                        Atendimento.Historico = string.Concat(Atendimento.Historico, string.Format("\nCOMERCIANTE DE RUA CADASTRADO, PROTOCOLO Nº {0}", AreaTransferencia.CadastroAmbulante));
                    }

                    else
                    {
                        Atendimento.Historico = string.Format(@"COMERCIANTE DE RUA CADASTRADO, PROTOCOLO Nº {0}", AreaTransferencia.CadastroAmbulante);
                    }
                }
            }

            if (e.PropertyName == "CadPF")
            {
                if (AreaTransferencia.CadPF == false)
                {
                    CommandPesquisarInscricao.Execute(null);
                }
            }

            if (e.PropertyName == "CadPJ")
            {
                if (AreaTransferencia.CadPJ == false)
                {
                    CommandPesquisarInscricao.Execute(null);
                }
            }


            if (e.PropertyName == "InscricaoOK")
            {
                if (AreaTransferencia.InscricaoOK == true)
                {
                    mAgenda ag = new mAgenda();

                    Task.Factory.StartNew(() => new mData().Evento(AreaTransferencia.Evento))
                    .ContinueWith(task =>
                    {
                        if (task.IsCompleted)
                        {
                            ag.Clear();
                            ag.Indice     = task.Result.Indice;
                            ag.Codigo     = task.Result.Codigo;
                            ag.Evento     = task.Result.Evento;
                            ag.Tipo       = task.Result.Tipo;
                            ag.TipoString = task.Result.TipoString;
                            ag.Descricao  = task.Result.Descricao;
                            ag.Vagas      = task.Result.Vagas;
                            ag.Data       = task.Result.Data;
                            ag.Hora       = task.Result.Hora;
                            ag.Setor      = task.Result.Setor;
                            ag.Estado     = task.Result.Estado;
                            ag.Criacao    = task.Result.Criacao;
                            ag.Ativo      = task.Result.Ativo;

                            if (Atendimento.Historico.Length > 0)
                            {
                                Atendimento.Historico = string.Concat(Atendimento.Historico, string.Format("\nINSCRIÇÃO {0} NA {1} {2} {3} {4}", AreaTransferencia.Inscricao[AreaTransferencia.Inscricao.Count - 1], ag.TipoString, ag.Evento, ag.Data.ToShortDateString(), ag.Hora.ToShortTimeString()));
                            }

                            else
                            {
                                Atendimento.Historico = string.Format(@"INSCRIÇÃO {0} NA {1} {2} {3} {4}", AreaTransferencia.Inscricao[AreaTransferencia.Inscricao.Count - 1], ag.TipoString, ag.Evento, ag.Data.ToShortDateString(), ag.Hora.ToShortTimeString());
                            }
                        }
                    },
                                  System.Threading.CancellationToken.None,
                                  TaskContinuationOptions.None,
                                  TaskScheduler.FromCurrentSynchronizationContext());
                }
            }
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GlobalNotifyProperty_GlobalPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "DIA_OK")
            {
                if (AreaTransferencia.DIA_OK == true)
                {
                    if (Atendimento.Historico.Length > 0)
                    {
                        Atendimento.Historico = string.Concat(Atendimento.Historico, string.Format("\nD.I.A GERADO COM SUCESSO, Nº {0}", AreaTransferencia.Numero_DIA));
                    }

                    else
                    {
                        Atendimento.Historico = string.Format(@"D.I.A GERADO COM SUCESSO, Nº {0}", AreaTransferencia.Numero_DIA);
                    }
                }
            }

            if (e.PropertyName == "CadAmbulanteOK")
            {
                if (AreaTransferencia.CadAmbulanteOK == true)
                {
                    if (Atendimento.Historico.Length > 0)
                    {
                        Atendimento.Historico = string.Concat(Atendimento.Historico, string.Format("\nCOMERCIANTE DE RUA CADASTRADO, PROTOCOLO Nº {0}", AreaTransferencia.CadastroAmbulante));
                    }

                    else
                    {
                        Atendimento.Historico = string.Format(@"COMERCIANTE DE RUA CADASTRADO, PROTOCOLO Nº {0}", AreaTransferencia.CadastroAmbulante);
                    }
                }
            }

            if (e.PropertyName == "CadPF")
            {
                if (AreaTransferencia.CadPF == false)
                {
                    CommandPesquisarInscricao.Execute(null);
                }
            }

            if (e.PropertyName == "CadPJ")
            {
                if (AreaTransferencia.CadPJ == false)
                {
                    CommandPesquisarInscricao.Execute(null);
                }
            }

            if (e.PropertyName == "ViabilidadeOK")
            {
                if (AreaTransferencia.ViabilidadeOK == true)
                {
                    if (Atendimento.Historico.Length > 0)
                    {
                        Atendimento.Historico = string.Concat(Atendimento.Historico, string.Format("\nVIABILIDADE {0}", AreaTransferencia.Viabilidade));
                    }

                    else
                    {
                        Atendimento.Historico = string.Format(@"VIABILIDADE {0}", AreaTransferencia.Viabilidade);
                    }
                }
            }

            if (e.PropertyName == "MEI_F")
            {
                if (AreaTransferencia.MEI_F == false)
                {
                    if (Atendimento.Historico.Length > 0)
                    {
                        Atendimento.Historico = string.Concat(Atendimento.Historico, string.Format("\nFORMALIZAÇÃO DO MEI CNPJ {0}", AreaTransferencia.CNPJ));
                    }

                    else
                    {
                        Atendimento.Historico = string.Format(@"FORMALIZAÇÃO DO MEI CNPJ {0}", AreaTransferencia.CNPJ);
                    }
                }
            }

            if (e.PropertyName == "MEI_A")
            {
                if (AreaTransferencia.MEI_A == false)
                {
                    if (Atendimento.Historico.Length > 0)
                    {
                        Atendimento.Historico = string.Concat(Atendimento.Historico, string.Format("\nALTERAÇÃO DE DADOS DO MEI CNPJ {0}", AreaTransferencia.CNPJ));
                    }

                    else
                    {
                        Atendimento.Historico = string.Format(@"ALTERAÇÃO DE DADOS DO MEI CNPJ {0}", AreaTransferencia.CNPJ);
                    }
                }
            }

            if (e.PropertyName == "MEI_B")
            {
                if (AreaTransferencia.MEI_B == false)
                {
                    if (Atendimento.Historico.Length > 0)
                    {
                        Atendimento.Historico = string.Concat(Atendimento.Historico, string.Format("\nBAIXA DO MEI CNPJ {0}", AreaTransferencia.CNPJ));
                    }

                    else
                    {
                        Atendimento.Historico = string.Format(@"BAIXA DO MEI CNPJ {0}", AreaTransferencia.CNPJ);
                    }
                }
            }

            if (e.PropertyName == "InscricaoOK")
            {
                if (AreaTransferencia.InscricaoOK == true)
                {
                    mAgenda ag = new mAgenda();

                    Task.Factory.StartNew(() => new mData().Evento(AreaTransferencia.Evento))
                    .ContinueWith(task =>
                    {
                        if (task.IsCompleted)
                        {
                            ag.Clear();
                            ag.Indice     = task.Result.Indice;
                            ag.Codigo     = task.Result.Codigo;
                            ag.Evento     = task.Result.Evento;
                            ag.Tipo       = task.Result.Tipo;
                            ag.TipoString = task.Result.TipoString;
                            ag.Descricao  = task.Result.Descricao;
                            ag.Vagas      = task.Result.Vagas;
                            ag.Data       = task.Result.Data;
                            ag.Hora       = task.Result.Hora;
                            ag.Setor      = task.Result.Setor;
                            ag.Estado     = task.Result.Estado;
                            ag.Criacao    = task.Result.Criacao;
                            ag.Ativo      = task.Result.Ativo;

                            if (Atendimento.Historico.Length > 0)
                            {
                                Atendimento.Historico = string.Concat(Atendimento.Historico, string.Format("\nINSCRIÇÃO {0} NA {1} {2} {3} {4}", AreaTransferencia.Inscricao[AreaTransferencia.Inscricao.Count - 1], ag.TipoString, ag.Evento, ag.Data.ToShortDateString(), ag.Hora.ToShortTimeString()));
                            }

                            else
                            {
                                Atendimento.Historico = string.Format(@"INSCRIÇÃO {0} NA {1} {2} {3} {4}", AreaTransferencia.Inscricao[AreaTransferencia.Inscricao.Count - 1], ag.TipoString, ag.Evento, ag.Data.ToShortDateString(), ag.Hora.ToShortTimeString());
                            }
                        }
                    });
                }
            }
        }