public FrmDiscrepancia(Discrepancia discrepancia, string tipoDoc) { InitializeComponent(); _tipoDoc = tipoDoc; discrepanciaBindingSource.DataSource = discrepancia; discrepanciaBindingSource.ResetBindings(false); Load += (s, e) => { using (var ctx = new OpenInvoicePeruDb()) { var tipoDocumento = ctx.Set <TipoDocumento>() .AsNoTracking() .SingleOrDefault(p => p.Codigo == _tipoDoc); if (tipoDocumento == null) { return; } tipoDiscrepanciaBindingSource.DataSource = ctx.Set <TipoDiscrepancia>() .Where(t => t.IdTipoDocumento == tipoDocumento.Id).AsNoTracking().ToList(); tipoDiscrepanciaBindingSource.ResetBindings(false); } }; toolOk.Click += (s, e) => { discrepanciaBindingSource.EndEdit(); DialogResult = DialogResult.OK; }; toolCancel.Click += (s, e) => DialogResult = DialogResult.Cancel; }
public async Task <ParametroConfiguracion> Get(int id) { return(await _context.Set <ParametroConfiguracion>().FindAsync(id)); }
public async Task <Empresa> Get(int id) { return(await _context.Set <Empresa>().FindAsync(id)); }