Example #1
0
        private void barbtnExcluir_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var objSelecionado = gridView1.GetFocusedRow() as CarteiraBoleto;

            if (objSelecionado == null)
            {
                MessageBox.Show("Selecione uma carteira de boleto.");
                return;
            }

            try
            {
                if (
                    MessageBox.Show("Deseja excluir a carteira?", "Atenção", MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    var con = new ConnectionSqlite();
                    con.ExcluirCarteiraBoleto(objSelecionado);
                    AtualizarDados();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public frmGerarBoleto()
        {
            InitializeComponent();

            var connection = new ConnectionSqlite();

            cbbCarteira.Properties.DataSource = connection.GetAll();
        }
        private void btnGravar_Click(object sender, EventArgs e)
        {
            try
            {
                if (!Validar())
                {
                    return;
                }
                SetCampos();

                var connection = new ConnectionSqlite();
                connection.SalvarCarteiraBoleto(_carteiraBoleto);
                DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #4
0
        private void AtualizarDados()
        {
            var connection = new ConnectionSqlite();

            gridControl1.DataSource = connection.GetAll();
        }