/// <summary> /// 注入账户信息变量 /// </summary> private void InjectIdentity() { string identityName = "账户信息"; VariableActionModel.Remove(identityName); VariableActionModel.Add(new ActionAttributeObject(SecurityDataMap.Instance, VariableDirection.Input)); }
/// <summary> /// 清空数据 /// </summary> public void Empty() { MainActionModel.Clear(); VariableActionModel.Clear(); SubActionModel.Clear(); InsertPosition = -1; //ShouldInsertActions = true; if (DataSourceChanged != null) { DataSourceChanged(MainActionModel); } }
public ActionBase FindAction(StatementType statementType, string Name) { if (statementType == StatementType.Main) { return(MainActionModel.FirstOrDefault(c => c.ElementName == Name)); } else if (statementType == StatementType.Sub) { return(SubActionModel.FirstOrDefault(c => c.ElementName == Name)); } else if (statementType == StatementType.Variable) { return(VariableActionModel.FirstOrDefault(c => c.ElementName == Name)); } return(null); }
/// <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); }