public async Task <IActionResult> Edit(int id, [Bind("SipTblDplId,SipTblEplId,SipTblTreId,SipTblDedDeducciones,SipTblDplBonificacion,SipTblDplIgss,SipTblDplIrtra,SipTblDplIsr,SipTblDplOtros")] SipTblDetallePlanilla sipTblDetallePlanilla) { if (id != sipTblDetallePlanilla.SipTblDplId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sipTblDetallePlanilla); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SipTblDetallePlanillaExists(sipTblDetallePlanilla.SipTblDplId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SipTblEplId"] = new SelectList(_context.SipTblEncabezadoPlanilla, "SipTblEplId", "SipTblEplId", sipTblDetallePlanilla.SipTblEplId); ViewData["SipTblTreId"] = new SelectList(_context.SipTblTrabajoRealizado, "SipTblTreId", "SipTblTreId", sipTblDetallePlanilla.SipTblTreId); return(View(sipTblDetallePlanilla)); }
public async Task <IActionResult> Create([Bind("SipTblDplId,SipTblEplId,SipTblTreId,SipTblDedDeducciones,SipTblDplBonificacion,SipTblDplIgss,SipTblDplIrtra,SipTblDplIsr,SipTblDplOtros")] SipTblDetallePlanilla sipTblDetallePlanilla) { if (ModelState.IsValid) { _context.Add(sipTblDetallePlanilla); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SipTblEplId"] = new SelectList(_context.SipTblEncabezadoPlanilla, "SipTblEplId", "SipTblEplId", sipTblDetallePlanilla.SipTblEplId); ViewData["SipTblTreId"] = new SelectList(_context.SipTblTrabajoRealizado, "SipTblTreId", "SipTblTreId", sipTblDetallePlanilla.SipTblTreId); return(View(sipTblDetallePlanilla)); }