Example #1
0
        /// <summary>
        /// 注入账户信息变量
        /// </summary>
        private void InjectIdentity()
        {
            string identityName = "账户信息";

            VariableActionModel.Remove(identityName);
            VariableActionModel.Add(new ActionAttributeObject(SecurityDataMap.Instance, VariableDirection.Input));
        }
Example #2
0
        /// <summary>
        /// 读取数据
        /// </summary>
        private void Load()
        {
            ActionVariable        var = null;
            IActionReadRepository rep = Repository as IActionReadRepository;

            if (rep == null)
            {
                throw new ApplicationException("Repository必须实现IActionReadRepository接口");
            }
            ActionXmlSet xmlset = rep.Read();

            if (xmlset == null)
            {
                return;
            }
            if (!string.IsNullOrEmpty(xmlset.XmlAction))
            {
                ModelSerilizer serializer = new ModelSerilizer();
                serializer.Deserialize(xmlset.XmlAction);
            }
            if (xmlset.IsLoadIdentiy)
            {
                InjectIdentity();
            }

            AppContext.Current.ActionModel.ProjectName = xmlset.Name;
            //构造数据模型
            if (!string.IsNullOrEmpty(xmlset.SchemaSet.Schema))
            {
                VariableActionModel.Remove(xmlset.SchemaSet.Name);
                var map = new DataMap(xmlset.SchemaSet.Name);
                map.Init(xmlset.SchemaSet.Schema);
                map.UpdateValues(xmlset.SchemaSet.SchemaValue);
                //将数据模型转换为输入表变量增加到ModelSet
                var = new ActionAttributeObject(map, VariableDirection.Input);
                VariableActionModel.Add(var);
            }
            Switch(StatementType.Main);
        }