Example #1
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     if (bsOrcamento.Current != null)
     {
         if (MessageBox.Show("Deseja reabrir Orçamento?", "Pergunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                             MessageBoxDefaultButton.Button1) == DialogResult.Yes)
         {
             try
             {
                 using (TFTarefas ftarefa = new TFTarefas())
                 {
                     ftarefa.pCd_Empresa = (bsOrcamento.Current as TRegistro_Orcamento).Cd_empresa;
                     if (ftarefa.ShowDialog() == DialogResult.OK)
                     {
                         if (ftarefa.pDs_tarefa != null)
                         {
                             TRegistro_Tarefas rtarefa = new TRegistro_Tarefas();
                             rtarefa.Cd_empresa      = ftarefa.pCd_Empresa;
                             rtarefa.Ds_tarefa       = ftarefa.pDs_tarefa;
                             rtarefa.Id_orcamentostr = (bsOrcamento.Current as TRegistro_Orcamento).Id_orcamentostr;
                             rtarefa.Nr_versaostr    = (bsOrcamento.Current as TRegistro_Orcamento).Nr_versaostr;
                             rtarefa.Login           = Utils.Parametros.pubLogin;
                             TCN_Tarefas.Gravar(rtarefa, null);
                         }
                     }
                 }
                 (bsOrcamento.Current as TRegistro_Orcamento).St_registro = "O";
                 TCN_Orcamento.Gravar(bsOrcamento.Current as TRegistro_Orcamento, null);
                 MessageBox.Show("Orçamento reaberto.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             catch (Exception ex)
             { MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); }
         }
     }
 }