Пример #1
0
        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));
        }
Пример #2
0
        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("成功!")));
        }
Пример #3
0
        /// <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));
        }
Пример #4
0
        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));
        }