Пример #1
0
 public JsonResult Post(WX_Menu _t)
 {
     if (WMFactory.WXMenu.Insert(_t))
         return Json(ResultMsg.Success("新增成功!"));
     else
         return Json(ResultMsg.Failure("新增失败,请您重试!"));
 }
Пример #2
0
        public JsonResult Put(WX_Menu _t)
        {
            IWXMenuService service = WMFactory.WXMenu;
            WX_Menu entity = service.GetById(_t.Id.ToString());
            if (entity == null)
                return Post(_t);

            entity = AutoMapper<WX_Menu, WX_Menu>.Convert(_t, entity);
            if (service.Update(entity))
                return Json(ResultMsg.Success("更新成功!"));
            else
                return Json(ResultMsg.Failure("更新失败,请您重试!"));
        }
Пример #3
0
 public JsonResult Delete(WX_Menu _t)
 {
     if (WMFactory.WXMenu.Delete(s => s.Id == _t.Id))
         return Json(ResultMsg.Success("删除成功!"));
     else
         return Json(ResultMsg.Failure("删除失败,请您重试!"));
 }