コード例 #1
0
        public override void Alterar()
        {
            try
            {
                base.Alterar();

                if (gv_Status.GetSelectedRows().Count() == 0)
                {
                    throw Excessoes.AlterandoSemRegistro();
                }

                using (var forma = new FStatus_Cadastro {
                    Operacao = Operacao.Alterar, status = gv_Status.GetSelectedRow <E_STATUS>()
                })
                {
                    if (forma.ShowDialog() == DialogResult.OK)
                    {
                        status = forma.status;
                        Buscar();
                    }
                }
            }
            catch (Exception excessao)
            {
                Mensagens.Alerta(excessao.Tratar());
            }
        }
コード例 #2
0
        public override void Adicionar()
        {
            try
            {
                base.Adicionar();

                using (var forma = new FStatus_Cadastro {
                    Operacao = Operacao.Cadastrar
                })
                {
                    if (forma.ShowDialog() == DialogResult.OK)
                    {
                        status = forma.status;
                        Buscar();
                    }
                }
            }
            catch (Exception excessao)
            {
                Mensagens.Alerta(excessao.Tratar());
            }
        }