MVC基础案例,初学者适用

时间:2021-07-03 08:09:24
【文件属性】:

文件名称:MVC基础案例,初学者适用

文件大小:37.26MB

文件格式:RAR

更新时间:2021-07-03 08:09:24

MVC

public ActionResult IndexList() { string uLoginName = Request["U_LoginName"] == null ? "" : Request["U_LoginName"]; string uName = Request["U_RealName"] == null ? "" : Request["U_RealName"]; string uTel = Request["U_Telephone"] == null ? "" : Request["U_Telephone"]; if (uLoginName == "" && uName == "" && uTel == "") { var json = Json(db.Users); return json; } else { var json = from i in db.Users where i.U_LoginName.Contains(uLoginName) && i.U_RealName.Contains(uName) && i.U_Telephone.Contains(uTel) select i; return Json(json); } } // GET: UsersRole/Details/5 public ActionResult Details(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Users users = db.Users.Find(id); if (users == null) { return HttpNotFound(); } return View(users); }


网友评论