Example #1
0
 private void AlterarAtividade()
 {
     if (bsAtividade.Current != null)
     {
         if ((bsAtividade.Current as TRegistro_LanAtividades).St_registro.ToUpper().Equals("C"))
         {
             MessageBox.Show("Não é permitido Alterar Atividade CONCLUÍDA!", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         using (TFTarefa fTarefa = new TFTarefa())
         {
             fTarefa.St_Bloqueio = true;
             fTarefa.rAtividade  = (bsAtividade.Current as TRegistro_LanAtividades);
             if (fTarefa.ShowDialog() == DialogResult.OK)
             {
                 if (fTarefa.rAtividade != null)
                 {
                     try
                     {
                         CamadaNegocio.Servicos.TCN_LanAtividades.Gravar(fTarefa.rAtividade, null);
                         MessageBox.Show("Atividade Alterada com sucesso!", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         this.afterBusca();
                     }
                     catch (Exception ex)
                     { MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); }
                 }
             }
         }
     }
 }
Example #2
0
 private void gAtividades_DoubleClick(object sender, EventArgs e)
 {
     if (bsAtividade.Current != null)
     {
         using (TFTarefa fTarefa = new TFTarefa())
             try
             {
                 fTarefa.St_visualizar = true;
                 fTarefa.Size          = new Size(736, 340 - 43);
                 fTarefa.rAtividade    = bsAtividade.Current as CamadaDados.Servicos.TRegistro_LanAtividades;
                 fTarefa.ShowDialog();
             }
             finally
             {
                 fTarefa.Dispose();
             }
     }
 }