public async Task <IActionResult> Edit(int id, [Bind("ThamNienID,ThamNienLam,Luong")] ThamNien thamNien) { if (id != thamNien.ThamNienID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(thamNien); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ThamNienExists(thamNien.ThamNienID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(thamNien)); }
public async Task Update(ThamNien thamnien) { ThamNien newthamnien = await newContext.ThamNien.FindAsync(thamnien.ThamNienID); newthamnien = thamnien; await newContext.SaveChangesAsync(); }
public async Task Remove(int ID) { ThamNien thamnien = await newContext.ThamNien.FindAsync(ID); newContext.Remove(thamnien); await newContext.SaveChangesAsync(); }
public async Task <IActionResult> Create([Bind("ThamNienID,ThamNienLam,Luong")] ThamNien thamNien) { if (ModelState.IsValid) { _context.Add(thamNien); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(thamNien)); }
public bool Exit(int ID) { ThamNien thamnien = newContext.ThamNien.Find(ID); if (thamnien != null) { return(true); } else { return(false); } }
public override string ToString() { return(string.Format("GV{0} - {1} - Học vị {2} - Thâm niên {3} năm", MaGV.ToString(), TenGV, HocVi, ThamNien.ToString())); }
public async Task <ThamNien> FindById(int ID) { ThamNien thamnien = await newContext.ThamNien.FindAsync(ID); return(thamnien); }
public async Task Add(ThamNien thamnien) { newContext.Add(thamnien); await newContext.SaveChangesAsync(); }