Example #1
0
        public ResponseResult <List <EntityAttrValueItem> > QueryEntityAttrValue(EntityInfoEntity entity)
        {
            var result = ResponseResult <List <EntityAttrValueItem> > .Default();

            try
            {
                var list = FBDataService.QueryEntityAttrValue(entity.ID);
                result = ResponseResult <List <EntityAttrValueItem> > .Success(list);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <EntityAttrValueItem> > .Error(
                    string.Format("获取表单属性记录失败,错误{0}", ex.Message)
                    );
            }
            return(result);
        }
Example #2
0
        public ResponseResult <EntityInfoEntity> InsertEntityRowFlow(dynamic eav)
        {
            var result = ResponseResult <EntityInfoEntity> .Default();

            try
            {
                //先保存表单
                EntityInfoWithAttrValueListItem entityAttrValueItem = JsonConvert.DeserializeObject <EntityInfoWithAttrValueListItem>(
                    eav.EntityInfoWithAttrValueListItem.ToString());
                int newID      = FBDataService.InsertRow(entityAttrValueItem);
                var entityInfo = new EntityInfoEntity();
                entityInfo.ID = newID;

                var wfAppRunner = JsonConvert.DeserializeObject <WfAppRunner>(eav.WfAppRunner.ToString());
                wfAppRunner.AppInstanceID = newID.ToString();
                WfAppInteropService wfService = new WfAppInteropService();
                WfExecutedResult    wfResult  = wfService.StartProcess(wfAppRunner);

                //返回结果
                if (wfResult.Status == WfExecutedStatus.Success)
                {
                    result = ResponseResult <EntityInfoEntity> .Success(entityInfo, "表单数据已经保存,流程已经启动!");
                }
                else
                {
                    result = ResponseResult <EntityInfoEntity> .Error(wfResult.Message);
                }
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <EntityInfoEntity> .Error(
                    string.Format("保存实体及其扩展属性失败, 错误:{0}", ex.Message)
                    );
            }
            return(result);
        }