コード例 #1
0
        private void ZoomButton_Click(object sender, EventArgs e)
        {
            bool bReadOnly = false;

            if (AddButton.Enabled)
            {
                bReadOnly = true;
            }
            ZoomBox f1 = new ZoomBox("Descrição da atividade", this, Descricao.Text, bReadOnly, 300);

            f1.ShowDialog();
            Descricao.Text = f1.ReturnText;
        }
コード例 #2
0
        private void BtObs_Click(object sender, EventArgs e)
        {
            if (lvMain.Items.Count == 0 || lvMain.SelectedItems.Count == 0)
            {
                return;
            }

            if (String.IsNullOrEmpty(lvMain.SelectedItems[0].SubItems[2].Text))
            {
                MessageBox.Show("Local ainda não tramitado.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            bool         bReadOnly          = true;
            int          CodCC              = Convert.ToInt16(lvMain.SelectedItems[0].SubItems[2].Text);
            Processo_bll processo_Class     = new Processo_bll(_connection);
            Sistema_bll  sistema_Class      = new Sistema_bll(_connection);
            List <UsuariocentroCusto> Lista = processo_Class.ListaCentrocustoUsuario(sistema_Class.Retorna_User_LoginId(gtiCore.Retorna_Last_User()));

            foreach (UsuariocentroCusto item in Lista)
            {
                if (item.Codigo == CodCC)
                {
                    bReadOnly = false;
                    break;
                }
            }

            ZoomBox f1 = new ZoomBox("Observação do trâmite", this, txtObs.Text, bReadOnly);

            f1.ShowDialog();
            txtObs.Text = f1.ReturnText;

            if (!bReadOnly)
            {
                lvMain.SelectedItems[0].SubItems[11].Text = f1.ReturnText;
                int       Ano    = processo_Class.ExtractAnoProcesso(lblNumProc.Text);
                int       Numero = processo_Class.ExtractNumeroProcessoNoDV(lblNumProc.Text);
                int       Seq    = Convert.ToInt16(lvMain.SelectedItems[0].SubItems[1].Text);
                Exception ex     = processo_Class.Alterar_Observacao_Tramite(Ano, Numero, Seq, txtObs.Text);
                if (ex != null)
                {
                    ErrorBox eBox = new ErrorBox("Erro!", ex.Message, ex);
                    eBox.ShowDialog();
                }
            }
        }