Example #1
0
 private void buscaOrcCompleto()
 {
     if ((bsOrcamento.Current as TRegistro_Orcamento) != null)
     {
         (bsOrcamento.Current as TRegistro_Orcamento).lOrcProjeto =
             TCN_OrcProjeto.Buscar((bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                                   (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                                   (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                                   string.Empty,
                                   string.Empty,
                                   null);
         (bsOrcamento.Current as TRegistro_Orcamento).lOrcProjeto.ForEach(p =>
         {
             p.lFicha =
                 TCN_FichaTec.Buscar(p.Cd_empresa,
                                     p.Id_orcamentostr,
                                     p.Nr_versaostr,
                                     p.Id_projetostr,
                                     p.Id_registrostr,
                                     string.Empty,
                                     null);
         });
         //Buscar Despesas
         (bsOrcamento.Current as TRegistro_Orcamento).lDespesas =
             TCN_Despesas.Buscar((bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                                 (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                                 (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                                 string.Empty,
                                 string.Empty,
                                 null);
         //Buscar Tarefas
         (bsOrcamento.Current as TRegistro_Orcamento).lTarefas =
             TCN_Tarefas.Buscar((bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                                (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                                (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                                null);
         //Buscar mao obra
         (bsOrcamento.Current as TRegistro_Orcamento).lMaoObra =
             TCN_CadMaoObra.Busca(
                 (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                 (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                 (bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                 string.Empty,
                 null);
         //Buscar encargos
         (bsOrcamento.Current as TRegistro_Orcamento).lOEncargo =
             TCN_OrcamentoEncargo.Buscar(
                 string.Empty,
                 (bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                 (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                 (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                 null);
     }
 }
Example #2
0
        private void bsOrcamento_PositionChanged(object sender, EventArgs e)
        {
            if (bsOrcamento.Current != null)
            { //Buscar Atividades
                (bsOrcamento.Current as TRegistro_Orcamento).lOrcProjeto =
                    TCN_OrcProjeto.Buscar((bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                                          (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                                          (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                                          string.Empty,
                                          string.Empty,
                                          null);
                //Buscar Despesas
                (bsOrcamento.Current as TRegistro_Orcamento).lDespesas =
                    TCN_Despesas.Buscar((bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                                        (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                                        (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                                        string.Empty,
                                        string.Empty,
                                        null);
                //Buscar Tarefas
                (bsOrcamento.Current as TRegistro_Orcamento).lTarefas =
                    TCN_Tarefas.Buscar((bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                                       (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                                       (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                                       null);
                //Buscar mao obra
                (bsOrcamento.Current as TRegistro_Orcamento).lMaoObra =
                    TCN_CadMaoObra.Busca(
                        (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                        (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                        (bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                        string.Empty,
                        null);
                (bsOrcamento.Current as TRegistro_Orcamento).lOEncargo =
                    TCN_OrcamentoEncargo.Buscar(string.Empty,
                                                (bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                                                (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                                                (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr, null);
                calculaEncargos();



                bsOrcamento.ResetCurrentItem();
                bsAtividade_PositionChanged(this, new EventArgs());
            }
        }