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)); }
public ActionResult PartEdit(UR_PART model) { UrPartBll bll = new UrPartBll(); if (model.PART_ID > 0) { bll.Update(model); } else { bll.Add(model); } ViewBag.Success = true; ViewBag.Message = "修改成功!"; return(View(model)); }