public Tk5TableScheme(ITableSchemeEx scheme, IInputData input, ISingleMetaData config, Func <ITableSchemeEx, IFieldInfoEx, IInputData, ISingleMetaData, Tk5FieldInfoEx> createFunc) : this() { TkDebug.AssertArgumentNull(scheme, "scheme", null); TkDebug.AssertArgumentNull(input, "input", null); TkDebug.AssertArgumentNull(config, "config", null); TkDebug.AssertArgumentNull(createFunc, "createFunc", null); SetFileDependency(scheme); TableName = scheme.TableName; TableDesc = scheme.TableDesc; NameField = scheme.NameField; PageStyle pageStyle = input.Style.Style; var list = from item in scheme.Fields where (item.Control.DefaultShow & pageStyle) == pageStyle select item; foreach (var item in list) { Tk5FieldInfoEx fieldInfo = createFunc(scheme, item, input, config); fList.Add(fieldInfo); } ProcessRefField(); }
public UnionScheme(string tableName, string tableDesc, string nameField, IEnumerable <ITableSchemeEx> schemes) { TkDebug.AssertArgumentNullOrEmpty(tableName, "tableName", null); TkDebug.AssertArgumentNullOrEmpty(tableDesc, "tableDesc", null); TkDebug.AssertArgumentNull(schemes, "schemes", null); TableName = tableName; TableDesc = tableDesc; fFields = new RegNameList <UnionFieldInfoEx>(); foreach (var scheme in schemes) { foreach (var field in scheme.Fields) { if (!fFields.ConstainsKey(field.NickName)) { if (field is UnionFieldInfoEx) { fFields.Add((UnionFieldInfoEx)field); } else { fFields.Add(new UnionFieldInfoEx(field, null)); } } } } if (string.IsNullOrEmpty(nameField)) { NameField = schemes.FirstOrDefault()?.NameField; } else { NameField = fFields[nameField]; } }
public string Creator(string workflowDefine, string key, string paramList) { try { WorkflowDbContext source = new WorkflowDbContext(connStr); WorkflowConfig.ConnString = connStr; RegNameList <KeyValueItem> param = new RegNameList <KeyValueItem>(); if (!string.IsNullOrEmpty(paramList)) { List <KeyValueItem> list = new List <KeyValueItem>(); list = FastToObject <List <KeyValueItem> >(paramList); list.ForEach(a => param.Add(a)); } param.Add(new KeyValueItem() { Key = "MainKey", Value = key }); var wf = Ataw.Workflow.Core.Workflow.CreateWorkflow(source, workflowDefine, param, GlobalVariable.UserId.ToString(), null); return("OK" + wf.GetWorkflowUrl()); } catch (Exception ex) { return(ex.Message); } }
public LevelScheme(ITableScheme sourceScheme, LevelTreeDefinition levelDef) { fFields = new RegNameList <FieldItem>(); fFields.Add(new KeyFieldItem(sourceScheme[levelDef.IdField])); fFields.Add(new FieldItem(sourceScheme[levelDef.NameField])); TreeScheme.AddFakeField(fFields, sourceScheme); TableName = sourceScheme.TableName; }
public TreeScheme(ITableScheme sourceScheme, DbTreeDefinition treeDef) { fFields = new RegNameList <FieldItem>(); TableName = sourceScheme.TableName; fFields.Add(new KeyFieldItem(sourceScheme[treeDef.IdField])); fFields.Add(new FieldItem(sourceScheme[treeDef.NameField])); fFields.Add(new FieldItem(sourceScheme[treeDef.ParentIdField])); fFields.Add(new FieldItem(sourceScheme[treeDef.LeafField])); fFields.Add(new FieldItem(sourceScheme[treeDef.LayerField])); AddFakeField(fFields, sourceScheme); }
public bool Add(TableResolver resolver) { if (fList.Contains(resolver)) { var srcResolver = fList[resolver.TableName]; srcResolver.MergeCommand(resolver); return(false); } fList.Add(resolver); return(true); }
public static RegNameList <ListTabSheet> CreateTabSheets(this CodeTable codeTable, TkDbContext context, IFieldInfo field) { DataSet ds = new DataSet() { Locale = ObjectUtil.SysCulture }; using (ds) { codeTable.Fill(ds, context); if (ds.Tables.Count == 0) { return(null); } DataTable table = ds.Tables[0]; if (table.Rows.Count == 0) { return(null); } RegNameList <ListTabSheet> result = new RegNameList <ListTabSheet>(); foreach (DataRow row in table.Rows) { object value = row[DecoderConst.CODE_NICK_NAME]; IParamBuilder builder = SqlParamBuilder.CreateEqualSql(context, field, value); ListTabSheet tab = new ListTabSheet(value.ToString(), row[DecoderConst.NAME_NICK_NAME].ToString(), builder); result.Add(tab); } return(result); } }
public void Add(SingleTableDetailData tableData) { TkDebug.AssertArgumentNull(tableData, "tableData", this); fTableDatas.Add(tableData); tableData.Initialize(); }
internal TypeTableScheme(Type type) { TkDebug.AssertArgumentNull(type, "type", null); TableName = type.Name; DisplayNameAttribute dispAttr = Attribute.GetCustomAttribute(type, typeof(DisplayNameAttribute), false) as DisplayNameAttribute; if (dispAttr != null) { TableDesc = dispAttr.DisplayName; } else { TableDesc = TableName; } fList = new RegNameList <PropertyFieldInfo>(); PropertyInfo[] props = type.GetProperties(BIND_ATTRIBUTE); if (props != null) { foreach (var prop in props) { PropertyFieldInfo info = PropertyFieldInfo.Create(prop); if (info != null) { fList.Add(info); } } } NameField = MetaDataUtil.GetNameField(fList); }
// public public Workflow StartWorkFlow(string key, string defineName, string creatorId) { // throw new NotImplementedException(); WorkflowDbContext source = new WorkflowDbContext(AtawAppContext.Current.DefaultConnString); WorkflowConfig.ConnString = AtawAppContext.Current.DefaultConnString; RegNameList <KeyValueItem> param = new RegNameList <KeyValueItem>(); //if (!string.IsNullOrEmpty(paramList)) //{ // List<KeyValueItem> list = new List<KeyValueItem>(); // list = FastToObject<List<KeyValueItem>>(paramList); // list.ForEach(a => param.Add(a)); //} param.Add(new KeyValueItem() { Key = "MainKey", Value = key }); var wf = Workflow.CreateWorkflow(source, defineName, param, creatorId, null); wf.Run(); // return wf.WorkflowId; return(wf); }
private Tk5TableScheme CreateTableScheme(IInputData input, ISingleMetaData item) { ITableSchemeEx sourceScheme = item.CreateSourceScheme(input); Tk5TableScheme scheme = item.CreateTableScheme(sourceScheme, input); fSchemes.Add(scheme); return(scheme); }
public void Add(T item) { if (item == null) { return; } fList.Add(new EasySearchDataItem <T>(item)); }
public void AddItem(FieldOperateRightItem item) { TkDebug.AssertArgumentNull(item, "item", this); fList.Add(item); if (fNullItem == null && item.ContainsNull) { fNullItem = item; } }
public RegNameList <ListTabSheet> CreateTabSheet(IDbDataSource dataSource, IFieldInfoIndexer indexer) { if (TabSheets != null) { RegNameList <ListTabSheet> result = new RegNameList <ListTabSheet>(); foreach (var item in TabSheets) { string sql = item.Condition == null ? null : Expression.Execute(item.Condition, dataSource); IParamBuilder builder = string.IsNullOrEmpty(sql) ? null : SqlParamBuilder.CreateSql(sql); result.Add(new ListTabSheet(item.Id, item.Caption.ToString(ObjectUtil.SysCulture), builder)); } return(result); } if (CodeTabSheet != null) { RegNameList <ListTabSheet> result = new RegNameList <ListTabSheet>(); if (CodeTabSheet.NeedAllTab) { result.Add(new ListTabSheet("_All", "全部", null)); } CodeTable table = PlugInFactoryManager.CreateInstance <CodeTable>( CodeTablePlugInFactory.REG_NAME, CodeTabSheet.CodeRegName); YJC.Toolkit.Decoder.CodeTableContainer data = new YJC.Toolkit.Decoder.CodeTableContainer(); table.Fill(data, dataSource.Context); var tableData = data[CodeTabSheet.CodeRegName]; IFieldInfo info = indexer[CodeTabSheet.NickName]; TkDebug.AssertNotNull(info, "", this); foreach (var item in tableData) { IParamBuilder builder = SqlParamBuilder.CreateEqualSql(dataSource.Context, info, item.Value); var tabSheet = new ListTabSheet(item.Value, item.Name, builder); result.Add(tabSheet); } return(result); } return(null); }
private void Initialize(string tableName, DataTable table, string[] keyFieldArray) { TableName = tableName; DataColumnCollection columns = table.Columns; fFieldInfos = new RegNameList <InternalFieldConfigItem>(); foreach (DataColumn column in columns) { fFieldInfos.Add(new InternalFieldConfigItem(column, keyFieldArray)); } }
public static void AddFakeField(RegNameList <FieldItem> fields, ITableScheme scheme) { Tk5DataXml dataXml = scheme as Tk5DataXml; if (dataXml != null) { if (dataXml.FakeDeleteInfo != null) { fields.Add(new FieldItem(scheme[dataXml.FakeDeleteInfo.FieldName])); } } }
public Tk5TableScheme(Tk5TableScheme scheme, IEnumerable <Tk5FieldInfoEx> fields) { TkDebug.AssertArgumentNull(scheme, "scheme", null); TkDebug.AssertArgumentNull(fields, "fields", null); SetFileDependency(scheme); fList = scheme.fList; TableName = scheme.TableName; TableDesc = scheme.TableDesc; NameField = scheme.NameField; foreach (var item in fields) { fList.Add(item); } ProcessRefField(); }
private void AddAttribute(HtmlAttribute attr) { if (attr == null) { return; } if (fAttrs.Contains(attr)) { HtmlAttribute curAttr = fAttrs[attr.Name]; curAttr.Value = attr.Value; } else { fAttrs.Add(attr); } }
internal static IEnumerable <ITreeNode> GetDisplayTreeNodes(IEnumerable <ITreeNode> data, string id) { RegNameList <DataRowTreeNode> list = new RegNameList <DataRowTreeNode>(); foreach (DataRowTreeNode item in data) { list.Add(item); } DataRowTreeNode newNode = list[id]; while (newNode != null) { newNode = list[newNode.ParentId]; if (newNode != null) { newNode.HasChild = null; } } return(list); }
internal MultipleMixDbDetailSource(IDetailDbConfig config) : base(config) { OneToOneTables = new RegNameList <OneToOneChildTableInfo>(); IMultipleMixDbSourceConfig mix = config as IMultipleMixDbSourceConfig; if (mix != null) { var tableInfos = mix.OneToOneTables; if (tableInfos != null) { foreach (var item in tableInfos) { var info = new OneToOneChildTableInfo(this, item); OneToOneTables.Add(info); } } } if (config.DetailOperators != null) { Operators = config.DetailOperators.CreateObject(); } }
protected void Add(CodeItem item) { TkDebug.AssertArgumentNull(item, "item", this); fData.Add(item); }
public void AddChildTable(ChildTableInfo childTable) { TkDebug.AssertArgumentNull(childTable, "childTable", this); fChildTables.Add(childTable); }
public void AddToken(CorpAccessToken token) { fList.Add(token); }