public ActionResult MpQrCodeDelete(Guid id) { if (id != Guid.Empty) { MpQrScene qr = MpQrSceneService.GetById(id); try { if (qr != null) { MpQrSceneService.BeginTransaction(); MpQrSceneService.ExcuteSql("update MpUser set SceneId=0 where SceneId>0 and SceneId=" + qr.SceneId.ToString()); MpQrSceneService.Delete(qr); MpQrSceneService.Commit(); } } catch (Exception ex) { if (qr != null) { MpQrSceneService.Rollback(); } Log4NetImpl.Write("delete qrcode:" + ex.ToString()); return(JsonMessage(false, "删除失败")); } } return(JsonMessage(true)); }
public ActionResult MpQrCodeEdit() { string id = RQuery["Id"]; MpQrScene mp = string.IsNullOrWhiteSpace(id) ? null : MpQrSceneService.GetById(new Guid(id)); return(View(mp)); }