Пример #1
0
        private void BB_Excluir_Click(object sender, EventArgs e)
        {
            using (TFFichaTec fFicha = new TFFichaTec())
            {
                fFicha.pCd_empresa     = (bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa;
                fFicha.pCd_tabelapreco = (bsCFGEmpreendimento.Current as TRegistro_CadCFGEmpreendimento).Cd_tabelapreco;
                fFicha.vId_Orc         = (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr;
                fFicha.vNr_Ver         = (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr;
                fFicha.vSt_Proj        = true;
                if (fFicha.ShowDialog() == DialogResult.OK)
                {
                    if (fFicha.rFicha != null)
                    {
                        fFicha.rFicha.St_addremessa  = "S";
                        fFicha.rFicha.Cd_empresa     = (bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa;
                        fFicha.rFicha.Id_orcamento   = (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamento;
                        fFicha.rFicha.Nr_versao      = (bsOrcamento.Current as TRegistro_Orcamento).Nr_versao;
                        fFicha.rFicha.Id_registrostr = fFicha.pId_registro;
                        fFicha.rFicha.Id_ficha       = null;
                        fFicha.rFicha.Id_orcamento   = (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamento;

                        TCN_FichaTec.Gravar(fFicha.rFicha, null);
                        bsFicha.Add(fFicha.rFicha);
                    }
                }
            }
        }
Пример #2
0
 private void bsAtividade_PositionChanged(object sender, EventArgs e)
 {
     if (bsAtividade.Current != null)
     {
         (bsAtividade.Current as TRegistro_OrcProjeto).lFicha =
             TCN_FichaTec.Buscar(vCd_Empresa, vId_Orcamento, (bsAtividade.Current as TRegistro_OrcProjeto).Nr_versaostr, (bsAtividade.Current as TRegistro_OrcProjeto).Id_projetostr, (bsAtividade.Current as TRegistro_OrcProjeto).Id_registrostr, string.Empty, null);
         bsAtividade.ResetCurrentItem();
         bsFicha.ResetCurrentItem();
     }
 }
Пример #3
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);
     }
 }
Пример #4
0
 private void bb_inutilizar_Click(object sender, EventArgs e)
 {
     (bsMateriais.DataSource as IEnumerable <TRegistro_FichaTec>)
     .ToList()
     .FindAll(r => r.st_agregar)
     .ForEach(p =>
     {
         TCN_FichaTec.Gravar(p, null);
     });
     bsMateriais.ResetBindings(true);
     DialogResult = DialogResult.OK;
 }
Пример #5
0
        private void bsOrcamento_PositionChanged(object sender, EventArgs e)
        {
            if (bsOrcamento.Current != null)
            {
                //Buscar Projetos
                (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.ResetCurrentItem();

                //if (!(string.IsNullOrEmpty((bsOrcamento.Current as TRegistro_Orcamento).nr_lanctofiscal)))
                //{
                //    bsNotaFiscal.DataSource =
                //                new CamadaDados.Faturamento.NotaFiscal.TCD_LanFaturamento().Select(
                //                    new TpBusca[]
                //                {
                //                    new TpBusca()
                //                    {
                //                        vNM_Campo = string.Empty,
                //                        vOperador = "exists",
                //                        vVL_Busca = "(select 1 from tb_fat_pedido x "+
                //                                    "where x.Nr_Pedido = a.nr_pedido "+
                //                                    "and x.nr_pedido = "+(bsOrcamento.Current as TRegistro_Orcamento).nr_lanctofiscal.ToString()+")"
                //                    }
                //                }, 0, string.Empty);
                //    bsNotaFiscal.ResetCurrentItem();

                //}

                if (bsProjeto.Current != null)
                {
                    (bsProjeto.Current as TRegistro_OrcProjeto).lFicha =
                        TCN_FichaTec.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,
                                            string.Empty,
                                            null);
                }
                bsItens.ResetCurrentItem();
            }
            else
            {
                MessageBox.Show("Selecione um Projeto!", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Пример #6
0
 private void bsProjeto_PositionChanged(object sender, EventArgs e)
 {
     if (bsProjeto.Current != null)
     {
         (bsProjeto.Current as TRegistro_OrcProjeto).lFicha =
             TCN_FichaTec.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,
                                 string.Empty,
                                 null);
     }
     bsItens.ResetCurrentItem();
 }
Пример #7
0
        private void dataGridDefault2_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 0)
            {
                (bsProjeto.Current as TRegistro_OrcProjeto).st_importar = !(bsProjeto.Current as TRegistro_OrcProjeto).st_importar;
                if (bsProjeto.Current != null)
                {
                    (bsProjeto.Current as TRegistro_OrcProjeto).lFicha =
                        TCN_FichaTec.Buscar((bsProjeto.Current as TRegistro_OrcProjeto).Cd_empresa,
                                            (bsProjeto.Current as TRegistro_OrcProjeto).Id_orcamentostr,
                                            (bsProjeto.Current as TRegistro_OrcProjeto).Nr_versaostr,
                                            (bsProjeto.Current as TRegistro_OrcProjeto).Id_projetostr,
                                            (bsProjeto.Current as TRegistro_OrcProjeto).Id_registrostr,
                                            "",
                                            null);

                    (bsProjeto.Current as TRegistro_OrcProjeto).lFicha.ForEach(p => { p.st_agregar = true; p.quantidade_agregar = p.Quantidade; });
                    bsProjeto.ResetCurrentItem();
                }
            }
        }
Пример #8
0
        private void bsProjeto_PositionChanged(object sender, EventArgs e)
        {
            if (bsProjeto.Current != null)
            {
                if (bsProjeto.Count <= 0)
                {
                    (bsProjeto.Current as TRegistro_OrcProjeto).lFicha =
                        TCN_FichaTec.Buscar((bsProjeto.Current as TRegistro_OrcProjeto).Cd_empresa,
                                            (bsProjeto.Current as TRegistro_OrcProjeto).Id_orcamentostr,
                                            (bsProjeto.Current as TRegistro_OrcProjeto).Nr_versaostr,
                                            (bsProjeto.Current as TRegistro_OrcProjeto).Id_projetostr,
                                            (bsProjeto.Current as TRegistro_OrcProjeto).Id_registrostr,
                                            "",
                                            null);


                    (bsProjeto.Current as TRegistro_OrcProjeto).lFicha.ForEach(p => { p.st_agregar = true; p.quantidade_agregar = p.Quantidade; });

                    bsProjeto.ResetCurrentItem();
                }
            }
        }
Пример #9
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);
                (bsOrcamento.Current as TRegistro_Orcamento).lOrcProjeto.ForEach(p =>
                {
                    p.lFicha = TCN_FichaTec.Buscar((bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa,
                                                   (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                                                   (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr,
                                                   p.Id_projetostr, string.Empty, string.Empty, null);
                });

                bsOrcamento.ResetCurrentItem();
            }
        }
Пример #10
0
        private void bsOrcamento_PositionChanged(object sender, EventArgs e)
        {
            if (bsOrcamento.Current != null)
            {
                if ((bsOrcamento.Current as TRegistro_Orcamento).lOrcProjeto.Count <= 0)
                {
                    //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);
                }
                (bsOrcamento.Current as TRegistro_Orcamento).lRequisitos =
                    TCN_RequisitoORc.Buscar(string.Empty, (bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa, (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr,
                                            (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr, 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,
                                                   "",
                                                   null);



                    p.lFicha.ForEach(o => {
                        o.quantidade_agregar = o.Quantidade;
                    });
                });

                if ((bsOrcamento.Current as TRegistro_Orcamento).lDespesas.Count <= 0)
                {
                    //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);
                }
                if ((bsOrcamento.Current as TRegistro_Orcamento).lMaoObra.Count <= 0)
                {
                    //Buscar mao obra
                    (bsOrcamento.Current as TRegistro_Orcamento).lMaoObra =
                        CamadaNegocio.Empreendimento.Cadastro.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);
                }
                if ((bsOrcamento.Current as TRegistro_Orcamento).lOEncargo.Count <= 0)
                {
                    //Buscar encargos
                    (bsOrcamento.Current as TRegistro_Orcamento).lOEncargo =
                        CamadaNegocio.Empreendimento.Cadastro.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);
                }
                bsOrcamento.ResetCurrentItem();
                bsProjeto_PositionChanged(this, new EventArgs());
                bsProjeto.ResetCurrentItem();
            }
        }