Beispiel #1
0
        public virtual object GetMobileFormSetting(HttpContext context)
        {
            YZRequest request     = new YZRequest(context);
            string    processName = request.GetString("processName");
            Version   version     = request.GetVersion("version");

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

                return(new
                {
                    tables = BPMProcess.GetProcessGlobalTableIdentitys(cn, processName, version),
                    mobileFormSetting = BPMProcess.GetMobileFormSetting(cn, processName, version)
                });
            }
        }
Beispiel #2
0
        public virtual JObject GetProcessForm(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            int       stepid  = request.GetInt32("pid");
            string    uid     = YZAuthHelper.LoginUserAccount;

            BPMProcStep           step;
            BPMTask               task;
            MobileFormSetting     formSetting;
            FlowDataSet           formdataset;
            CommentItemCollection comments;

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

                step        = BPMProcStep.Load(cn, stepid);
                task        = BPMTask.Load(cn, step.TaskID);
                formSetting = BPMProcess.GetMobileFormSetting(cn, task.ProcessName, task.ProcessVersion);
                formdataset = BPMProcess.GetFormData(cn, stepid);
                comments    = BPMTask.GetComments(cn, task.TaskID);
            }

            this.ParseMobileFormSetting(formSetting);

            //准备返回值
            JObject result = new JObject();

            //填充form域(表单信息)
            JObject fieldset;
            JArray  items;
            JObject field;

            JObject form = new JObject();

            result["form"] = form;

            JArray formitems = new JArray();

            form["items"] = formitems;

            //基本信息的fieldset填充
            fieldset = new JObject();
            formitems.Add(fieldset);
            fieldset["xtype"]     = "fieldset";
            fieldset["innerName"] = "Header";

            //fieldset["title", "基本信息");
            items             = new JArray();
            fieldset["items"] = items;

            field = new JObject();
            items.Add(field);
            field["xclass"]  = "YZSoft.form.FormHeader";
            field["padding"] = "16 10 10 16";
            field["task"]    = this.Serialize(task);

            field = new JObject();
            items.Add(field);
            field["xclass"] = "Ext.field.Field";
            field["label"]  = Resources.YZMobile.Aspx_FormData_StepName;
            field["html"]   = step.StepDisplayName;

            field = new JObject();
            items.Add(field);
            field["xclass"] = "Ext.field.Field";
            field["label"]  = Resources.YZMobile.Aspx_FormData_Date;
            field["html"]   = YZStringHelper.DateToStringM(task.CreateAt);

            field = new JObject();
            items.Add(field);
            field["xclass"] = "Ext.field.Field";
            field["label"]  = Resources.YZMobile.Aspx_FormData_Desc;
            field["html"]   = task.Description;

            //应用移动表单设定字段 - 非可重复表
            this.ApplyMasterFields(Model.Process, form, formitems, task, step, formSetting, formdataset);

            //应用移动表单设定字段 - 可重复表
            this.ApplyDetailFields(Model.Process, form, formitems, task, step, formSetting, formdataset);

            //自定义信息
            this.ApplyCustomFields(Model.Process, form, formitems, task, step, formdataset, comments);

            //控件测试
            //this.AddTestingFields(Model.Process, form, formitems, task, step, formdataset, comments);

            return(result);
        }
Beispiel #3
0
        public virtual JObject GetPostForm(HttpContext context)
        {
            YZRequest request        = new YZRequest(context);
            string    processName    = request.GetString("processName");
            Version   processVersion = request.GetVersion("processVersion");
            int       restartTaskID  = request.GetInt32("restartTaskID", -1);
            string    uid            = YZAuthHelper.LoginUserAccount;

            MobileFormSetting     formSetting;
            FlowDataSet           formdataset;
            CommentItemCollection comments = new CommentItemCollection();
            User user = new User();

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

                user.Open(cn, uid);
                formSetting = BPMProcess.GetMobileFormSetting(cn, processName, processVersion);
                formdataset = BPMProcess.GetFormData(cn, processName, processVersion, null, restartTaskID);
            }

            this.ParseMobileFormSetting(formSetting);

            //准备返回值
            JObject result = new JObject();

            //填充form域(表单信息)
            JObject fieldset;
            JArray  items;

            JObject form = new JObject();

            result["form"] = form;

            JArray formitems = new JArray();

            form["items"] = formitems;

            //基本信息的fieldset填充
            fieldset = new JObject();
            formitems.Add(fieldset);
            fieldset["xtype"]     = "fieldset";
            fieldset["hidden"]    = true;
            fieldset["innerName"] = "Header";

            //fieldset["title", "基本信息");
            items             = new JArray();
            fieldset["items"] = items;

            //field = new JObject();
            //items.Add(field);
            //field["xclass"] = "Ext.field.Field";
            //field["label"] = "提交人";
            //field["html"] = user.ShortName;

            //field = new JObject();
            //items.Add(field);
            //field["xclass"] = "Ext.field.Field";
            //field["label"] = Resources.YZMobile.Aspx_FormData_Date;
            //field["html"] = YZStringHelper.DateToStringM(DateTime.Today);

            //field = new JObject();
            //items.Add(field);
            //field["xclass"] = "Ext.field.Field";
            //field["label"] = "部门";
            //field["html"] = "财务部";


            //应用移动表单设定字段 - 非可重复表
            this.ApplyMasterFields(Model.Post, form, formitems, null, null, formSetting, formdataset);

            //应用移动表单设定字段 - 可重复表
            this.ApplyDetailFields(Model.Post, form, formitems, null, null, formSetting, formdataset);

            //自定义信息
            this.ApplyCustomFields(Model.Post, form, formitems, null, null, formdataset, comments);

            //控件测试
            //this.AddTestingFields(Model.Post, form, formitems, null, null, formdataset, comments);

            return(result);
        }