Example #1
0
        private void listaDesconto()
        {
            dbPagamentosDataContext db = new dbPagamentosDataContext();
            var query = from d in db.DescCartaos select d;

            dgvDesc.DataSource = query;
        }
Example #2
0
        public void carrega()
        {
            dbPagamentosDataContext db = new dbPagamentosDataContext();
            var query = from f in db.FormaPagtos
                        orderby f.Nome
                        select new { idFormaPagto = f.idFormaPagto, CodPagto = f.CodPagto, Nome = f.Nome };

            dgvForma.DataSource = query;
        }
Example #3
0
        private void selecionePaciente(int idCli)
        {
            dbPagamentosDataContext db = new dbPagamentosDataContext();
            var query = (from c in db.CadClientes
                         where c.idCliente == idCli
                         select c).Single <CadCliente>();

            txtNomePct.Text = Convert.ToString(query.Nome);
        }
Example #4
0
        private void buscaForma()
        {
            dbPagamentosDataContext db = new dbPagamentosDataContext();
            var query = from f in db.FormaPagtos
                        select new { Cod = f.CodPagto, Nome = f.Nome };

            cboFormaPgt.ValueMember   = "Cod";
            cboFormaPgt.DisplayMember = "Nome";
            cboFormaPgt.DataSource    = query;
        }
Example #5
0
        private void buscaPaciente()
        {
            dbPagamentosDataContext db = new dbPagamentosDataContext();
            var query = from c in db.CadClientes
                        select new { idCli = c.idCliente, Cpf = c.Cpf };

            cboCpfPct.ValueMember   = "idCli";
            cboCpfPct.DisplayMember = "Cpf";
            cboCpfPct.DataSource    = query;
        }
Example #6
0
        private void selecioneTaxa(int idDesc)
        {
            dbPagamentosDataContext db = new dbPagamentosDataContext();
            var query = (from d in db.DescCartaos
                         where d.idDesc == idDesc
                         select d).Single <DescCartao>();

            txtId.Text   = Convert.ToString(query.idDesc);
            txtTipo.Text = Convert.ToString(query.Nome);
            txtPorc.Text = Convert.ToString(query.Porc);
        }
Example #7
0
        private void btnAtualizar_Click(object sender, EventArgs e)
        {
            dbPagamentosDataContext db = new dbPagamentosDataContext();
            var query = (from d in db.DescCartaos
                         where d.idDesc == Convert.ToInt32(txtId.Text)
                         select d).Single <DescCartao>();

            query.idDesc = Convert.ToInt32(txtId.Text);
            query.Nome   = txtTipo.Text;
            query.Porc   = Convert.ToDecimal(txtPorc.Text);

            db.SubmitChanges();

            txtId.Text   = "";
            txtTipo.Text = "";
            txtPorc.Text = "";
        }