1
I have a Linq that presents data listed according to the required filters (date and unit) by the user and another filter to validate a code with another table (which is not the case). I wonder how I can from a "reconcile" button, change the status (NFBP_STA_LANCTO) of all the items listed in this table.
int _idUnidade = int.Parse(cboUnidade.SelectedValue);
DateTime _dtCred = DateTime.Parse(txtCred.Text, new CultureInfo("pt-br"));
using (NFSeDataContext context = new NFSeDataContext(ConnNFSe))
{
context.Connection.Open();
var _s = (from p in context.NFS_Parcelas
join q in context.NFBP_CONCILIACAO_BRASPAGs on p.NFPA_NR_PARCELA equals q.NFBP_NR_PARCELA
where
_idUnidade == p.NFPA_CD_UNIDADE
&& _dtCred == p.NFPA_DT_MOVIMENTO
&& SqlMethods.Like(p.NFPA_TX_COMPLEMENTO, "%" + q.NFBP_TID + "%")
orderby p.NFPA_NR_PARCELA
select new
{
q.NFBP_STA_LANCTO,
p.NFPA_CD_UNIDADE,
p.NFPA_DT_MOVIMENTO,
q.NFBP_COD_AUTORIZACAO,
q.NFBP_TID,
q.NFBP_VL_BRUTO_TRANSACAO,
q.NFBP_VL_LIQUIDO_TRANSACAO,
p.NFPA_NR_PARCELA,
q.NFBP_BANDEIRA
}).ToList();
context.Connection.Close();
grvConciliacaoBraspag.DataSource = _s;
grvConciliacaoBraspag.DataBind();
Image to make as clear as possible what is being done(front-end):
É Entity Framework?
– Leonel Sanches da Silva
Yes @Ciganomorrisonmendez
– Daniel Nicodemos
What is the key to
Parcelas
?– Leonel Sanches da Silva
PK_NFS_PARCELA @Ciganomorrisonmendez
– Daniel Nicodemos