public ActionResult PartList() { string keyword = Request["keyword"]; UrPartBll bll = new UrPartBll(); List <UR_PART> allPart = bll.Query(t => string.IsNullOrEmpty(keyword) ? true : t.PART_NAME.Contains(keyword)).ToList(); ViewBag.Keyword = keyword; return(View(allPart)); }
public ActionResult PartDel(int id) { UrPartBll bll = new UrPartBll(); UR_PART model = bll.Query(t => t.PART_ID == id).FirstOrDefault(); if (model != null) { bll.Delete(model, true); } return(Json(BaseModels.OK("成功!"))); }
/// <summary> /// /// </summary> /// <returns></returns> public ActionResult PartEdit(int?id) { UrPartBll bll = new UrPartBll(); UR_PART model = new UR_PART(); if (id.HasValue && id > 0) { model = bll.Query(t => t.PART_ID == id).FirstOrDefault(); } return(View(model)); }