Exemplo n.º 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 despacho.", 40);

            if (!string.IsNullOrEmpty(sCod))
            {
                Processo_bll processo_class             = new Processo_bll(_connection);
                Despacho     reg                        = new Despacho();
                GtiTypes.CustomListBoxItem selectedData = (GtiTypes.CustomListBoxItem)lstMain.SelectedItem;
                reg.Codigo    = Convert.ToInt16(selectedData._value);
                reg.Descricao = sCod.ToUpper();
                reg.Ativo     = lstMain.GetItemChecked(lstMain.SelectedIndex);
                Exception ex = processo_class.Alterar_Despacho(reg);
                if (ex != null)
                {
                    ErrorBox eBox = new ErrorBox("Atenção", "Despacho já cadastrado.", ex);
                    eBox.ShowDialog();
                }
                else
                {
                    Carrega_Lista();
                }
            }
        }
Exemplo n.º 2
0
        private void BtOKDespacho_Click(object sender, EventArgs e)
        {
            String sDespacho = lvMain.SelectedItems[0].SubItems[7].Text;

            if (sDespacho != cmbDespacho.Text)
            {
                if (MessageBox.Show("Alterar o despacho?", "Confirmação", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Processo_bll clsProcesso = new Processo_bll(_connection);
                    int          Ano         = clsProcesso.ExtractAnoProcesso(lblNumProc.Text);
                    int          Numero      = clsProcesso.ExtractNumeroProcessoNoDV(lblNumProc.Text);
                    int          Seq         = Convert.ToInt16(lvMain.SelectedItems[0].SubItems[1].Text);
                    clsProcesso.Alterar_Despacho(Ano, Numero, Seq, Convert.ToInt16(cmbDespacho.SelectedValue));
                    lvMain.SelectedItems[0].SubItems[7].Text = cmbDespacho.Text;
                    LockForm(true);
                    SetButtonState();
                    pnlDespacho.Hide();
                    lvMain.Enabled = true;
                }
            }
        }
Exemplo n.º 3
0
        private void BtAtivar_Click(object sender, EventArgs e)
        {
            if (lstMain.SelectedItem == null)
            {
                return;
            }
            bCheck = true;
            lstMain.SetItemChecked(lstMain.SelectedIndex, !lstMain.GetItemChecked(lstMain.SelectedIndex));

            Despacho reg = new Despacho();

            GtiTypes.CustomListBoxItem selectedData = (GtiTypes.CustomListBoxItem)lstMain.SelectedItem;
            reg.Codigo    = Convert.ToInt16(selectedData._value);
            reg.Descricao = selectedData._name;
            reg.Ativo     = lstMain.GetItemChecked(lstMain.SelectedIndex);
            Processo_bll clsProcesso = new Processo_bll(_connection);
            Exception    ex          = clsProcesso.Alterar_Despacho(reg);

            if (ex != null)
            {
                ErrorBox eBox = new ErrorBox("Atenção", "Erro desconhecido.", ex);
                eBox.ShowDialog();
            }
        }