Example #1
0
        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 = "删除失败!" }));
            }
        }
Example #2
0
        public ActionResult SetForm(PageFormMsg m, string openId, string AppId, string FormTitle)
        {
            if (string.IsNullOrEmpty(openId))
            {
                return(Json(new { isok = false, msg = "提交异常(openId不能为空)" }));
            }

            C_UserInfo u = C_UserInfoBLL.SingleModel.GetModel($"appId='{AppId}' and OpenId='{openId}'");

            if (u == null)
            {
                return(Json(new { isok = false, msg = "提交异常(找不到对应的用户)" }));
            }

            var rmodel = _xcxAppAccountRelationBLL.GetModelByAppid(AppId);

            if (rmodel == null)
            {
                return(Json(new { isok = false, msg = "提交异常(未进行授权)" }));
            }

            m.Rid = rmodel.Id;
            //表示新增
            m.UserId    = u.Id;
            m.FormTitle = FormTitle;
            int id = Convert.ToInt32(PageFormMsgBLL.SingleModel.Add(m));

            if (id > 0)
            {
                return(Json(new { isok = true, msg = "提交成功", obj = id }));
            }
            else
            {
                return(Json(new { isok = false, msg = "提交异常" }));
            }
        }