コード例 #1
0
        private void BtEdit_Click(object sender, EventArgs e)
        {
            if (lstMain.SelectedItem == null)
            {
                return;
            }
            inputBox iBox = new inputBox();
            String   sCod = iBox.Show(lstMain.Text, "Informação", "Digite o nome do Documento.", 50);

            if (!string.IsNullOrEmpty(sCod))
            {
                Processo_bll processo_class = new Processo_bll(_connection);
                Documento    reg            = new Documento();
                Documento    dRow           = (Documento)lstMain.SelectedItem;
                reg.Codigo = dRow.Codigo;
                reg.Nome   = sCod.ToUpper();
                Exception ex = processo_class.Alterar_Documento(reg);
                if (ex != null)
                {
                    ErrorBox eBox = new ErrorBox("Atenção", "Documento já cadastrado.", ex);
                    eBox.ShowDialog();
                }
                else
                {
                    Carrega_Lista();
                }
            }
        }