public async Task <IActionResult> EditPost(string id, [Bind("EmpId,SeqNo,ChaDt,Lcb")] Tblsalary tblsalary) { if (id != tblsalary.EmpId) { return(Json("Not Found")); } if (ModelState.IsValid) { try { _context.Update(tblsalary); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException dbex) { if (!TblsalaryExists(tblsalary.EmpId)) { return(Json("Not Found")); } else { return(Json(dbex.Message + " - " + dbex.StackTrace)); } } catch (Exception ex) { return(Json(ex.Message + " - " + ex.StackTrace)); } return(Json("")); } return(Json("Not valid Model")); }
public async Task <IActionResult> Edit(string id, [Bind("EmpId,SeqNo,ChaDt,NotDr,BltNm,BltDt,LstNm,LstDt,DonAp,ReaDr,Lcb")] Tblsalary tblsalary) { if (id != tblsalary.EmpId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblsalary); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblsalaryExists(tblsalary.EmpId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tblsalary)); }
public async Task <IActionResult> Create([Bind("EmpId,SeqNo,ChaDt,Lcb")] Tblsalary tblsalary) { if (ModelState.IsValid) { _context.Add(tblsalary); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tblsalary)); }
public IActionResult CreateEmpId(string EmpId, int SeqNo) { var _e = _context.Tblsalary.Where(x => x.EmpId == EmpId).OrderByDescending(x => x.SeqNo).FirstOrDefault(); SeqNo = _e == null ? 1 : _e.SeqNo + 1; var _m = new Tblsalary() { EmpId = EmpId, SeqNo = SeqNo }; return(View("Create", _m)); }
public async Task <IActionResult> CreatePost([Bind("EmpId,SeqNo,ChaDt,NotDr,BltNm,BltDt,LstNm,LstDt,DonAp,ReaDr,Lcb")] Tblsalary tblsalary) { try { if (ModelState.IsValid) { _context.Add(tblsalary); await _context.SaveChangesAsync(); return(Json("")); } return(Json("Not valid Model")); } catch (Exception ex) { return(Json(ex.Message + " - " + ex.StackTrace)); } }