示例#1
0
文件: Form.cs 项目: radtek/EMIP
        public virtual JObject GetFormStateInfo(HttpContext context)
        {
            YZRequest request   = new YZRequest(context);
            string    app       = request.GetString("app");
            string    key       = request.GetString("key", null);
            string    formstate = request.GetString("formstate", null);

            FormApplication formApplication;
            FormState       formState;

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();

                formApplication = FormApplication.Open(cn, app);
                formState       = FormService.GetFormStateBasicInfo(cn, app, formstate);
            }

            JObject rv = new JObject();

            rv[YZJsonProperty.success] = true;
            rv["appShortName"]         = formApplication.Name;
            rv["formstate"]            = formState.Name;
            rv["token"]           = YZSecurityHelper.GenFormApplicationToken(app, key, formState.Name);
            rv["showSaveButton"]  = formState.ShowSaveButton;
            rv["validationGroup"] = formState.ValidationGroup;
            rv["url"]             = YZUtility.GetFormRedirectUrl(formApplication.Form).ToString();
            return(rv);
        }
示例#2
0
文件: Form.cs 项目: radtek/EMIP
        public virtual JObject GetFormApplicationToken(HttpContext context)
        {
            YZRequest request   = new YZRequest(context);
            string    app       = request.GetString("app");
            string    key       = request.GetString("key");
            string    formstate = request.GetString("formstate", null);
            string    token     = YZSecurityHelper.GenFormApplicationToken(app, key, formstate);

            JObject rv = new JObject();

            rv[YZJsonProperty.success] = true;
            rv["token"] = token;
            return(rv);
        }