예제 #1
0
        public FormControlEntity GetControlByWorkId(string workId, string controlId)
        {
            FormControlEntity model = new FormControlEntity();

            using (var db = new RepositoryBase())
            {
                WorkEntity workEntity = db.FindEntity <WorkEntity>(m => m.Id == workId);
                if (workEntity != null && !string.IsNullOrEmpty(workEntity.Id))
                {
                    FlowVersionEntity flowVersionEntity = db.FindEntity <FlowVersionEntity>(m => m.Id == workEntity.FlowVersionId);
                    if (flowVersionEntity != null && !string.IsNullOrEmpty(flowVersionEntity.Id))
                    {
                        FlowEntity flowEntity = db.FindEntity <FlowEntity>(m => m.Id == flowVersionEntity.FlowId);
                        if (flowEntity != null && !string.IsNullOrEmpty(flowEntity.Id))
                        {
                            FormEntity formEntity = db.FindEntity <FormEntity>(m => m.Id == flowEntity.FormId);
                            if (formEntity != null && !string.IsNullOrEmpty(formEntity.Id))
                            {
                                model = db.FindEntity <FormControlEntity>(m => m.FormId == formEntity.Id && m.ControlId == controlId);
                            }
                        }
                    }
                }
            }
            return(model);
        }
예제 #2
0
파일: FormApp.cs 프로젝트: gongthub/Storm
        /// <summary>
        /// 获取当前流程申请时自定义默认值
        /// </summary>
        /// <param name="flowId"></param>
        public string GetCommonCustomDefaultTypeByWorkIdJson(string workId, string controlId)
        {
            string strTypes = string.Empty;

            FormControlEntity formControl = service.GetControlByWorkId(workId, controlId);

            if (formControl != null && !string.IsNullOrEmpty(formControl.Id))
            {
                strTypes = formControl.DefaultType;
            }
            return(strTypes);
        }
예제 #3
0
파일: FormApp.cs 프로젝트: gongthub/Storm
        /// <summary>
        /// 获取当前流程申请时自定义默认值
        /// </summary>
        /// <param name="flowId"></param>
        public string GetCommonCustomDefaultTypeJson(string flowId, string controlId)
        {
            string strTypes = string.Empty;

            FlowEntity flowEntity = flowApp.GetForm(flowId);

            if (flowEntity != null && !string.IsNullOrEmpty(flowEntity.Id) && !string.IsNullOrEmpty(flowEntity.FormId))
            {
                FormControlEntity formControl = service.GetControl(flowEntity.FormId, controlId);
                if (formControl != null && !string.IsNullOrEmpty(formControl.Id))
                {
                    strTypes = formControl.DefaultType;
                }
            }
            return(strTypes);
        }