public ActionResult SetPageIndex(PageIndexControl m) { if (dzaccount == null) { return(Json(new { isok = false, msg = "1系统繁忙account_null!" }, JsonRequestBehavior.AllowGet)); } if (m.RelationId <= 0) { return(Json(new { isok = false, msg = "权限Id不能为空!" }, JsonRequestBehavior.AllowGet)); } XcxAppAccountRelation umodel = XcxAppAccountRelationBLL.SingleModel.GetModel(m.RelationId); if (umodel == null) { return(Json(new { isok = false, msg = "2系统繁忙umodel_null!" }, JsonRequestBehavior.AllowGet)); } if (umodel.AccountId != dzaccount.Id) { return(Json(new { isok = false, msg = "3系统繁忙umodel_null!" }, JsonRequestBehavior.AllowGet)); } PageIndexControl model = PageIndexControlBLL.SingleModel.GetModel($"RelationId={umodel.Id}"); if (model != null) { //表示更新 if (PageIndexControlBLL.SingleModel.Update(m)) { return(Json(new { isok = true, msg = "更新成功", obj = m.Id })); } else { return(Json(new { isok = false, msg = "更新异常", obj = m.Id })); } } else { //表示新增 int id = Convert.ToInt32(PageIndexControlBLL.SingleModel.Add(m)); if (id > 0) { return(Json(new { isok = true, msg = "新增成功", obj = id })); } else { return(Json(new { isok = false, msg = "新增异常" })); } } }
public ActionResult DelFormData(int relationId = 0, int Id = 0) { if (dzaccount == null) { return(Json(new { isok = false, msg = "系统繁忙umodel_null!" }, JsonRequestBehavior.AllowGet)); } if (relationId <= 0) { return(Json(new { isok = false, msg = "relationId不能为空!" }, JsonRequestBehavior.AllowGet)); } XcxAppAccountRelation umodel = XcxAppAccountRelationBLL.SingleModel.GetModel(relationId); if (umodel == null) { return(Json(new { isok = false, msg = "没有权限对象!" }, JsonRequestBehavior.AllowGet)); } if (umodel.AccountId != dzaccount.Id) { return(Json(new { isok = false, msg = "非法操作没有权限删除!" }, JsonRequestBehavior.AllowGet)); } PageIndexControl model = PageIndexControlBLL.SingleModel.GetModel($"RelationId={relationId}"); if (model == null) { return(Json(new { isok = false, msg = "首页未进行配置没有表单数据" })); } PageFormMsg form = PageFormMsgBLL.SingleModel.GetModel(Id); if (form == null) { return(Json(new { isok = false, msg = "没有该表单数据" })); } form.State = -1; if (PageFormMsgBLL.SingleModel.Update(form)) { return(Json(new { isok = true, msg = "删除成功!" })); } else { return(Json(new { isok = false, msg = "删除失败!" })); } }
public ActionResult DelFormDataAll(int relationId = 0) { if (dzaccount == null) { return(Json(new { isok = false, msg = "删除失败(请先登录)!" }, JsonRequestBehavior.AllowGet)); } if (relationId <= 0) { return(Json(new { isok = false, msg = "relationId不能为空!" }, JsonRequestBehavior.AllowGet)); } XcxAppAccountRelation umodel = XcxAppAccountRelationBLL.SingleModel.GetModel(relationId); if (umodel == null) { return(Json(new { isok = false, msg = "删除失败(没有权限对象)!" }, JsonRequestBehavior.AllowGet)); } if (umodel.AccountId != dzaccount.Id) { return(Json(new { isok = false, msg = "删除失败(没有权限)!" }, JsonRequestBehavior.AllowGet)); } PageIndexControl model = PageIndexControlBLL.SingleModel.GetModel($"RelationId={relationId}"); if (model == null) { return(Json(new { isok = false, msg = "首页未进行配置没有表单数据" })); } if (PageFormMsgBLL.SingleModel.ExecuteNonQuery($"update MiniappPageFormMsg set State=-1 where Rid={relationId}") > 0) { return(Json(new { isok = true, msg = "删除成功!" })); } else { return(Json(new { isok = false, msg = "删除失败!" })); } }
/// <summary> /// 获取自定义页面配置信息 /// </summary> /// <param name="AppId"></param> /// <param name="PageId"></param> /// <returns></returns> public ActionResult GetPageMsg(string AppId) { if (string.IsNullOrEmpty(AppId)) { return(Json(new { isok = false, msg = "AppId不能为空!" }, JsonRequestBehavior.AllowGet)); } var umodel = _xcxAppAccountRelationBLL.GetModel($"AppId='{AppId}'"); if (umodel == null) { return(Content("系统繁忙umodel_null")); } string strWhere = $"RelationId={umodel.Id}"; PageIndexControl model = PageIndexControlBLL.SingleModel.GetModel(strWhere); if (model == null) { Json(new { isok = false, msg = "首页未进行配置!" }, JsonRequestBehavior.AllowGet); } return(Json(new { isok = true, msg = "请求成功", obj = model }, JsonRequestBehavior.AllowGet)); }