public async Task <IActionResult> EditarTipo(D00_TBGENERAL modelo) { // D00_TBGENERAL general = _generalRepository.listarxIdGeneral(id); var mensaje = await _generalRepository.UpdateGeneral(modelo); TempData["mensajetipo"] = mensaje; return(RedirectToAction("Index", "Tablas")); }
public async Task <D00_TBGENERAL> GetById(int?id) { D00_TBGENERAL general = await(from p in _context.D00_TBGENERAL where p.idTab == id select p).FirstOrDefaultAsync(); return(general); }
public async Task <IActionResult> EditarTipo(int?id) { if (id == null) { return(NotFound()); } D00_TBGENERAL general = await _generalRepository.GetById(id); return(PartialView(general)); }
public async Task <DetalleDTO> GetDetalle(int?id) { DetalleDTO dto = new DetalleDTO(); D00_TBGENERAL general = await generalRepository.GetById(id); dto.idTab = general.idTab; dto.codTab = general.codTab; dto.ldetalle = await GetDetalleByIdGeneral(id); return(dto); }
public async Task <IActionResult> DeleteTipo(D00_TBGENERAL modelo) { try { TempData["mensajetipo"] = await _generalRepository.DeleteGeneral(modelo); return(RedirectToAction("Index")); } catch { return(View()); } }
public async Task <string> UpdateGeneral(D00_TBGENERAL general) { try { _context.Entry(general).Property(x => x.codTab).IsModified = true; _context.Entry(general).Property(x => x.descripcion).IsModified = true; await Save(); return("Actualizacion Exitosa"); } catch (Exception ex) { return("Error al actualizar " + ex.StackTrace); } }
public async Task <string> DeleteGeneral(D00_TBGENERAL modelo) { try { D00_TBGENERAL general = await _context.D00_TBGENERAL.FindAsync(modelo.idTab); _context.D00_TBGENERAL.Remove(general); await Save(); return("Registro eliminado correctamente"); } catch (Exception ex) { return("Error al eliminar" + ex.Message); } }
public async Task <string> InsertGeneral(D00_TBGENERAL general) { try { await _context.D00_TBGENERAL.AddAsync(new D00_TBGENERAL() { codTab = general.codTab, descripcion = general.descripcion, fechaCreate = DateTime.Now }); await Save(); return("Ingreso exitoso"); } catch (Exception ex) { return("Error en el guardado " + ex.StackTrace); } }
public async Task <IActionResult> AgregarTipo(D00_TBGENERAL modelo) { TempData["mensajetipo"] = await _generalRepository.InsertGeneral(modelo); return(RedirectToAction("Index", "Tablas")); }
// GET: Detalle/Delete/5 public async Task <IActionResult> DeleteTipo(int id) { D00_TBGENERAL general = await _generalRepository.GetById(id); return(PartialView(general)); }