Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("PkDepositDeductionId,FkDepositDeductionHistory,DepositDeductionDescription,DepositDeductionAmount")] TblDepositDeduction tblDepositDeduction)
        {
            if (id != tblDepositDeduction.PkDepositDeductionId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tblDepositDeduction);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TblDepositDeductionExists(tblDepositDeduction.PkDepositDeductionId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FkDepositDeductionHistory"] = new SelectList(_context.TblEmployerDepositHistory, "PkDepositId", "DepositAmount", tblDepositDeduction.FkDepositDeductionHistory);
            return(View(tblDepositDeduction));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("PkDepositDeductionId,FkDepositDeductionHistory,DepositDeductionDescription,DepositDeductionAmount")] TblDepositDeduction tblDepositDeduction)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tblDepositDeduction);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FkDepositDeductionHistory"] = new SelectList(_context.TblEmployerDepositHistory, "PkDepositId", "DepositAmount", tblDepositDeduction.FkDepositDeductionHistory);
            return(View(tblDepositDeduction));
        }