public FileOutChannel Clone() { FileOutChannel ch = new FileOutChannel(); ch.ChannelName = this.ChannelName; ch.Enable = this.Enable; ch.OperationName = this.OperationName; //ch.Rule.RuleID = Rule.RuleID; //do not copy RuleID ch.Rule.RuleName = Rule.RuleName; ch.Rule.MaxRecordCount = Rule.MaxRecordCount; ch.Rule.CheckProcessFlag = Rule.CheckProcessFlag; ch.Rule.AutoUpdateProcessFlag = Rule.AutoUpdateProcessFlag; ch.Rule.QueryCriteria.Type = Rule.QueryCriteria.Type; ch.Rule.QueryCriteria.SQLStatement = Rule.QueryCriteria.SQLStatement; //ch.Rule.QueryCriteriaRuleType = this.Rule.QueryCriteriaRuleType; foreach (FileOutQueryCriterialItem item in Rule.QueryCriteria.MappingList) { FileOutQueryCriterialItem i = item.Clone(); ch.Rule.QueryCriteria.MappingList.Add(i); } foreach (FileOutQueryResultItem item in Rule.QueryResult.MappingList) { FileOutQueryResultItem i = item.Clone(); ch.Rule.QueryResult.MappingList.Add(i); } return(ch); }
public FileOutQueryResultItem Clone() { FileOutQueryResultItem item = new FileOutQueryResultItem(); item.ThirdPartyDBPatamter = this.ThirdPartyDBPatamter.Clone(); item.Translating = this.Translating.Clone(); item.SourceField = this.SourceField; item.TargetField = this.TargetField; item.RedundancyFlag = this.RedundancyFlag; item.GWDataDBField.Table = this.GWDataDBField.Table; item.GWDataDBField.FieldName = this.GWDataDBField.FieldName; return(item); }
public static FileOutChannel BuildReportChannel() { FileOutChannel ch = new FileOutChannel(); #region General ch.ChannelName = "CH_REPORT"; ch.Enable = true; ch.OperationName = ""; ch.Rule.AutoUpdateProcessFlag = true; ch.Rule.CheckProcessFlag = true; ch.Rule.RuleID = "CH_REPORT"; ch.Rule.RuleName = "CH_REPORT"; ch.Rule.QueryCriteria.Type = QueryCriteriaRuleType.DataSet; #endregion #region Critera FileOutQueryCriterialItem ci = new FileOutQueryCriterialItem(); ci.Operator = QueryCriteriaOperator.Equal; ci.Type = QueryCriteriaType.Or; ci.TargetField = "F_INDEX_EVENT_TYPE"; ci.SourceField = "EVENT_TYPE"; ci.GWDataDBField = GWDataDBField.i_EventType.Clone(); ci.Translating.Type = TranslatingType.FixValue; ci.Singal = QueryCriteriaSignal.None; ci.RedundancyFlag = false; ci.ThirdPartyDBPatamter.FieldID = 1; ci.Translating.ConstValue = "30"; ch.Rule.QueryCriteria.MappingList.Add(ci); //CRITERIA ci = new FileOutQueryCriterialItem(); ci.Operator = QueryCriteriaOperator.Equal; ci.Type = QueryCriteriaType.Or; ci.TargetField = "F_INDEX_EVENT_TYPE"; ci.SourceField = "EVENT_TYPE"; ci.GWDataDBField = GWDataDBField.i_EventType.Clone(); ci.Translating.Type = TranslatingType.FixValue; ci.Singal = QueryCriteriaSignal.None; ci.RedundancyFlag = false; ci.ThirdPartyDBPatamter.FieldID = 2; ci.Translating.ConstValue = "31"; ch.Rule.QueryCriteria.MappingList.Add(ci); //CRITERIA ci = new FileOutQueryCriterialItem(); ci.Operator = QueryCriteriaOperator.Equal; ci.Type = QueryCriteriaType.Or; ci.TargetField = "F_INDEX_EVENT_TYPE"; ci.SourceField = "EVENT_TYPE"; ci.GWDataDBField = GWDataDBField.i_EventType.Clone(); ci.Translating.Type = TranslatingType.FixValue; ci.Singal = QueryCriteriaSignal.None; ci.RedundancyFlag = false; ci.ThirdPartyDBPatamter.FieldID = 3; ci.Translating.ConstValue = "32"; ch.Rule.QueryCriteria.MappingList.Add(ci); //CRITERIA ci = new FileOutQueryCriterialItem(); ci.Operator = QueryCriteriaOperator.Equal; ci.Type = QueryCriteriaType.Or; ci.TargetField = "F_INDEX_EVENT_TYPE"; ci.SourceField = "EVENT_TYPE"; ci.GWDataDBField = GWDataDBField.i_EventType.Clone(); ci.Translating.Type = TranslatingType.FixValue; ci.Singal = QueryCriteriaSignal.None; ci.RedundancyFlag = false; ci.ThirdPartyDBPatamter.FieldID = 4; ci.Translating.ConstValue = "33"; ch.Rule.QueryCriteria.MappingList.Add(ci); #endregion #region Result Index int iFieldID = 0; foreach (GWDataDBField f in GWDataDBField.GetFields(GWDataDBTable.Index)) { if (f.GetFullFieldName() == GWDataDBField.i_IndexGuid.GetFullFieldName()) { continue; } if (f.GetFullFieldName() == GWDataDBField.i_DataDateTime.GetFullFieldName()) { continue; } if (f.GetFullFieldName() == GWDataDBField.i_PROCESS_FLAG.GetFullFieldName()) { continue; } //Result FileOutQueryResultItem ri = new FileOutQueryResultItem(); ri.Translating.Type = TranslatingType.None; ri.RedundancyFlag = false; ri.ThirdPartyDBPatamter.SectionName = "F_INDEX"; ri.ThirdPartyDBPatamter.FieldID = ++iFieldID; ri.ThirdPartyDBPatamter.FieldName = f.FieldName.ToUpper(); ri.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.VarChar; ri.ThirdPartyDBPatamter.FileFieldFlag = false; ri.TargetField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ri.GWDataDBField = f.Clone(); ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ch.Rule.QueryResult.MappingList.Add(ri); } #endregion #region Result Patient iFieldID = 0; foreach (GWDataDBField f in GWDataDBField.GetFields(GWDataDBTable.Patient)) { if (f.GetFullFieldName() == GWDataDBField.p_DATA_ID.GetFullFieldName()) { continue; } if (f.GetFullFieldName() == GWDataDBField.p_DATA_DT.GetFullFieldName()) { continue; } //Result FileOutQueryResultItem ri = new FileOutQueryResultItem(); ri.Translating.Type = TranslatingType.None; ri.RedundancyFlag = false; ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ri.ThirdPartyDBPatamter.SectionName = "F_PATIENT"; ri.ThirdPartyDBPatamter.FieldID = ++iFieldID; ri.ThirdPartyDBPatamter.FieldName = f.FieldName.ToUpper(); ri.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.VarChar; ri.ThirdPartyDBPatamter.FileFieldFlag = false; ri.TargetField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ri.GWDataDBField = f.Clone(); ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ch.Rule.QueryResult.MappingList.Add(ri); } #endregion #region Result Order iFieldID = 0; foreach (GWDataDBField f in GWDataDBField.GetFields(GWDataDBTable.Order)) { if (f.GetFullFieldName() == GWDataDBField.o_DATA_ID.GetFullFieldName()) { continue; } if (f.GetFullFieldName() == GWDataDBField.o_DATA_DT.GetFullFieldName()) { continue; } //Result FileOutQueryResultItem ri = new FileOutQueryResultItem(); ri.Translating.Type = TranslatingType.None; ri.RedundancyFlag = false; ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ri.ThirdPartyDBPatamter.SectionName = "F_ORDER"; ri.ThirdPartyDBPatamter.FieldID = ++iFieldID; ri.ThirdPartyDBPatamter.FieldName = f.FieldName.ToUpper(); ri.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.VarChar; ri.ThirdPartyDBPatamter.FileFieldFlag = false; ri.TargetField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ri.GWDataDBField = f.Clone(); ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ch.Rule.QueryResult.MappingList.Add(ri); } #endregion #region Result Order iFieldID = 0; foreach (GWDataDBField f in GWDataDBField.GetFields(GWDataDBTable.Report)) { if (f.GetFullFieldName() == GWDataDBField.r_DATA_ID.GetFullFieldName()) { continue; } if (f.GetFullFieldName() == GWDataDBField.r_DATA_DT.GetFullFieldName()) { continue; } //Result FileOutQueryResultItem ri = new FileOutQueryResultItem(); ri.Translating.Type = TranslatingType.None; ri.RedundancyFlag = false; ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ri.ThirdPartyDBPatamter.SectionName = "F_REPORT"; ri.ThirdPartyDBPatamter.FieldID = ++iFieldID; ri.ThirdPartyDBPatamter.FieldName = f.FieldName.ToUpper(); ri.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.VarChar; ri.ThirdPartyDBPatamter.FileFieldFlag = false; ri.TargetField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ri.GWDataDBField = f.Clone(); ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_"); ch.Rule.QueryResult.MappingList.Add(ri); } #endregion return(ch); }