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 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 FieldOperateRight(string fieldName) { TkDebug.AssertArgumentNullOrEmpty(fieldName, "fieldName", null); fList = new RegNameList <FieldOperateRightItem>(); FieldName = fieldName; }
internal void ProcessRefField(RegNameList <Tk5FieldInfoEx> fields) { if (Decoder == null) { return; } SimpleFieldDecoder decoder = Decoder as SimpleFieldDecoder; if (decoder == null || decoder.RefFields == null) { return; } foreach (var refField in decoder.RefFields) { Tk5FieldInfoEx refFieldInfo = fields[refField.RefField]; if (refFieldInfo != null) { refField.CtrlType = refFieldInfo.InternalControl.Control; } else { TkDebug.ThrowToolkitException(string.Format(ObjectUtil.SysCulture, "没有查找到{0}字段的定义,请确认", refField.RefField), this); } } }
public JsonFieldList(string tableName, IEnumerable <Tk5FieldInfoEx> fields) { Table = tableName; var regList = new RegNameList <JsonField>(); Fields = regList; if (fields == null) { return; } foreach (var field in fields) { ControlHtmlPlugInFactory factroy = BaseGlobalVariable.Current .FactoryManager.GetCodeFactory(ControlHtmlPlugInFactory.REG_NAME) .Convert <ControlHtmlPlugInFactory>(); string ctrl = field.ControlName; var searchCtrl = factroy.GetSearchControl(ctrl, field); Fields.Add(new JsonField(field.NickName, searchCtrl)); if (field.ListDetail != null && field.ListDetail.Span) { Fields.Add(new JsonField(field.NickName + "END", searchCtrl)); } } }
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 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); }
public JsonFieldList(string tableName, IEnumerable <Tk5FieldInfoEx> fields, bool hasEditKey) { Table = tableName; var regList = new RegNameList <JsonField>(); Fields = regList; foreach (var field in fields) { if (hasEditKey && field.IsKey) { Fields.Add(new JsonField("OLD_" + field.NickName, "Hidden")); } Fields.Add(new JsonField(field)); if (field.ListDetail != null && field.ListDetail.Span) { Fields.Add(new JsonField(field.NickName + "END", field)); } } // 处理Upload var uploadFields = from item in fields where item.InternalControl.SrcControl == ControlType.Upload && item.Upload != null select item; foreach (var field in uploadFields) { var upload = field.Upload; RemoveItem(regList, upload.SizeField); RemoveItem(regList, upload.ContentField); RemoveItem(regList, upload.MimeTypeField); RemoveItem(regList, upload.ServerPathField); } }
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 static ServiceAccount GetAccount(string account) { TkDebug.AssertArgumentNullOrEmpty(account, "account", null); RegNameList <ServiceAccount> list = GetAccountList().Convert <RegNameList <ServiceAccount> >(); return(list[account]); }
internal WeixinSettings(WeixinXml xml) { AppId = xml.Weixin.AppId; LogRawMessage = xml.Weixin.LogRawMessage; WeixinPath = Path.GetDirectoryName(xml.FullPath); UseLogOnRight = xml.Weixin.UseLogOnRight; WeixinNormalConfig normalConfig = xml.Weixin.Normal; if (normalConfig != null) { Mode = WeixinMode.Normal; OpenId = normalConfig.OpenId; fAppSecret = normalConfig.Secret; fToken = normalConfig.Token; MessageMode = normalConfig.MessageMode; EncodingAESKey = normalConfig.EncodingAESKey; fTemplateMessages = normalConfig.TemplateMessages; PaymentConfigItem pay = normalConfig.Pay; if (pay != null) { fUsePay = true; fMchId = pay.MchId; fPayKey = pay.Key; fDeviceInfo = pay.DeviceInfo; fDeviceIp = pay.DeviceIp; fPayNotifyUrl = UriUtil.CombineUri(pay.NotifyBaseUrl, pay.NotifyUrl).ToString(); } WeixinServiceConfigItem service = normalConfig.Service; if (service != null) { fEnableService = service.Enabled; fWeixinAccount = service.WeixinAccount; } else fEnableService = false; if (MessageMode != MessageMode.Normal) TkDebug.AssertArgumentNullOrEmpty(EncodingAESKey, "当消息是混合或者安全模式时,请配置EncodingAESKey的内容", xml); } else if (xml.Weixin.CorpApps != null) { Mode = WeixinMode.Corporation; fCorpApps = xml.Weixin.CorpApps; TkDebug.Assert(fCorpApps.Count > 0, "至少需要配置一个tk:CorpApp节点", xml); CorpSecretConfig corpSecret = xml.Weixin.CorpSecret; TkDebug.AssertNotNull(corpSecret, "需要配置tk:CorpSecret节点", xml); fCorpUserManagerSecret = corpSecret.UserManager; fCorpMenuSecret = corpSecret.Menu; if (string.IsNullOrEmpty(fCorpMenuSecret)) fCorpMenuSecret = fCorpUserManagerSecret; OpenId = AppId; } else TkDebug.ThrowImpossibleCode(xml); fCurrent = this; }
private static void RemoveItem(RegNameList <JsonField> regList, string name) { var item = regList[name]; if (item != null) { regList.Remove(item); } }
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; }
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)); } }
private static RegNameList <WeixinCorpConfig> CreateList() { RegNameList <WeixinCorpConfig> result = WeixinSettings.Current.CorpApps; if (result == null) { result = new RegNameList <WeixinCorpConfig>(); } return(result); }
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 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 NormalMultiDetailData() { object defaultCreator = DefaultUtil.GetFactoryObject(RazorDataConst.SECTION_NAME, nameof(NormalMultiDetailData)); if (defaultCreator != null && DefaultUtil.CreateConfigObject( defaultCreator, out object defaultObject)) { this.CopyFromObject(defaultObject); } fTableDatas = new RegNameList <SingleTableDetailData>(); }
public StandardCodeTableScheme(string tableName) { TkDebug.AssertArgumentNull(tableName, "tableName", null); TableName = tableName; fCode = DecoderConst.CODE_FIELD; fName = DecoderConst.NAME_FIELD; fFields = new RegNameList <FieldItem>() { fCode, fName, DecoderConst.PY_FIELD, DecoderConst.ACTIVE_FIELD, DecoderConst.SORT_FIELD }; }
internal NormalStatListData(NormalStatListDataConfig config) : base(config) { SubTotalCaption = config.SubTotalCaption; SubTotalPosition = config.SubTotalPosition; TotalCaption = config.TotalCaption; TotalPosition = config.TotalPosition; fDisplayList = config.FieldDisplayList; if (fDisplayList == null) { fDisplayList = new RegNameList <StatFieldDisplayConfig>(); } }
private static bool IsShow(IFieldInfoEx field, PageStyle pageStyle, RegNameList <OverrideFieldConfig> overrideFields) { bool result = (field.Control.DefaultShow & pageStyle) == pageStyle; if (!result) { if (overrideFields != null) { result = overrideFields.ConstainsKey(field.NickName); } } return(result); }
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(); }
public StdCodeTableScheme(string tableName, bool showCodeValue, bool showSort, bool showPy, string pyCaption) { TableName = tableName; fValueField = CodeTableFieldInfoEx.CreateValueField(); fSortField = CodeTableFieldInfoEx.CreateSortField(); fPyField = CodeTableFieldInfoEx.CreatePyField(pyCaption); var nameField = CodeTableFieldInfoEx.CreateNameField(); NameField = nameField; fFields = new RegNameList <CodeTableFieldInfoEx>() { fValueField, nameField, fPyField, fSortField, CodeTableFieldInfoEx.CreateActiveField() }; ShowSort = showSort; ShowPy = showPy; ShowCodeValue = showCodeValue; }
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); }
public NormalStatListData() { object defaultCreator = DefaultUtil.GetFactoryObject(RazorDataConst.SECTION_NAME, nameof(NormalStatListData)); if (defaultCreator == null || !DefaultUtil.CreateConfigObject( defaultCreator, out object defaultObject)) { SubTotalCaption = RazorDataConst.SUB_TOTAL_CAPTION; SubTotalPosition = DataDirection.Foot; TotalCaption = RazorDataConst.TOTAL_CAPTION; TotalPosition = DataDirection.Foot; OperatorPosition = OperatorPosition.None; } else { this.CopyFromObject(defaultObject); } fDisplayList = new RegNameList <StatFieldDisplayConfig>(); }
internal NormalMultiDetailData(NormalMultiDetailDataConfig config) : base(config) { fTableDatas = new RegNameList <SingleTableDetailData>(); if (config.TableDatas != null) { foreach (var tableData in config.TableDatas) { Add(tableData); if (tableData.RazorFields != null) { foreach (var razorField in tableData.RazorFields) { string key = GetKey(tableData.TableName, razorField.NickName); AddDisplayField(new RazorField(key, razorField.ContentType, razorField.Content)); } } } } Header = config.Header; Footer = config.Footer; }
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(); } }
public Workflow(IUnitOfData source, string name, RegNameList <KeyValueItem> parameter, string createUser, int?parentId) : this(source) { // Source = source; WorkflowDbContext dbContext = source as WorkflowDbContext; Config = WorkflowConfig.GetByName(name, source); WorkflowRow = new WF_WORKFLOW_INST(); //WorkflowRow.BeginEdit(); WorkflowRow.WI_ID = dbContext.GetUniId(); //WorkflowRow["WI_ID"] = id; WorkflowId = WorkflowRow.WI_ID; WorkflowRow.WI_WD_NAME = name; WorkflowRow.WI_CREATE_USER = createUser; // WorkflowRow["WI_RETRIEVABLE"] = Config.Retrievable; ////初始化参与人列表 WorkflowRow.WI_REF_LIST = QuoteIdList.GetQuoteId(createUser); WorkflowRow.WI_CREATE_DATE = dbContext.Now; BeginStep step = Config.Steps.BeginStep.CreateStep(this) as BeginStep; step.Parameter = parameter; CurrentStep = step; CurrentState = BeginNRState.Instance; }
public ManualStepConfig() { ControlActions = new RegNameList <ControlActionConfig>(); NotifyActions = new List <string>(); }
public CorpAccessTokenList() { fList = new RegNameList<CorpAccessToken>(); }
public HtmlAttributeBuilder() { fAttrs = new RegNameList <HtmlAttribute>(); }
public WeServiceAccountListObjectSource() { fList = ServiceAccount.GetAccountList().Convert<RegNameList<ServiceAccount>>(); }