예제 #1
0
        public virtual JObject GetAppsInFolder(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            string    path    = request.GetString("path", null);
            FormApplicationCollection formApplications;

            //获得数据
            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                formApplications = cn.GetFormApplicationList(path, BPMPermision.Read);

                //将数据转化为Json集合
                JObject rv = new JObject();
                rv[YZJsonProperty.total] = formApplications.Count;

                JArray children = new JArray();
                rv[YZJsonProperty.children] = children;

                foreach (FormApplication tmpformapp in formApplications)
                {
                    string fullName;
                    if (String.IsNullOrEmpty(path))
                    {
                        fullName = tmpformapp.Name;
                    }
                    else
                    {
                        fullName = path + "/" + tmpformapp.Name;
                    }

                    FormApplication formapp = FormApplication.Open(cn, fullName);

                    JObject item = new JObject();
                    children.Add(item);

                    item["Name"]     = formapp.Name;
                    item["FullName"] = fullName;
                    item["rsid"]     = StoreZoneType.FormService.ToString() + "://" + fullName;

                    JArray jStates = new JArray();
                    item["States"] = jStates;
                    foreach (FormState state in formapp.FormStates)
                    {
                        JObject jState = new JObject();
                        jStates.Add(jState);

                        jState["Name"] = state.Name;
                    }

                    item["FormFile"] = formapp.Form;
                }

                return(rv);
            }
        }
예제 #2
0
        public virtual BPMObjectNameCollection GetFormApplicationNames(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            string    folder  = request.GetString("folder", null);

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                FormApplicationCollection formApplications = cn.GetFormApplicationList(folder, BPMPermision.None);

                BPMObjectNameCollection names = new BPMObjectNameCollection();
                foreach (FormApplication formApplication in formApplications)
                {
                    names.Add(formApplication.Name);
                }

                return(names);
            }
        }