partial void UpdateSinger(Singer instance);
partial void DeleteSinger(Singer instance);
partial void InsertSinger(Singer instance);
public ActionResult ModSinger(int sid,Singer singer) { if (ModelState.IsValid) { try { TianLaiDBDataContext db = new TianLaiDBDataContext(); singer = db.Singer.SingleOrDefault(d => d.Sid == sid); UpdateModel(singer); db.SubmitChanges(); return Content("<label style='color:#35006A'>操作成功!</label>"); } catch (Exception ex) { ex.ToString(); return Content("<label style='color:Red'>操作失败!</label>"); } } else { return View(singer); } }