Пример #1
0
        public FileInChannel Clone()
        {
            FileInChannel ch = new FileInChannel();

            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.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 (FileInQueryCriteriaItem item in Rule.QueryCriteria.MappingList)
            {
                FileInQueryCriteriaItem i = item.Clone();
                ch.Rule.QueryCriteria.MappingList.Add(i);
            }
            foreach (FileInQueryResultItem item in Rule.QueryResult.MappingList)
            {
                FileInQueryResultItem i = item.Clone();
                ch.Rule.QueryResult.MappingList.Add(i);
            }

            return(ch);
        }
Пример #2
0
        public FileInQueryResultItem Clone()
        {
            FileInQueryResultItem item = new FileInQueryResultItem();

            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);
        }
Пример #3
0
        public static FileInChannel BuildReportChannel()
        {
            #region General
            FileInChannel ch = new FileInChannel();
            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
            FileInQueryCriteriaItem ci = new FileInQueryCriteriaItem();
            ci.Operator    = QueryCriteriaOperator.Equal;
            ci.Type        = QueryCriteriaType.Or;
            ci.SourceField = "F_INDEX_EVENT_TYPE";
            //ci.TargetField = "EVENT_TYPE";
            //ci.GWDataDBField = f.Clone();
            ci.ThirdPartyDBPatamter.FieldName   = "EVENT_TYPE";
            ci.ThirdPartyDBPatamter.FieldType   = System.Data.OleDb.OleDbType.VarChar;
            ci.ThirdPartyDBPatamter.SectionName = "F_INDEX";
            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 FileInQueryCriteriaItem();
            ci.Operator    = QueryCriteriaOperator.Equal;
            ci.Type        = QueryCriteriaType.Or;
            ci.SourceField = "F_INDEX_EVENT_TYPE";
            //ci.TargetField = "EVENT_TYPE";
            //ci.GWDataDBField = f.Clone();
            ci.ThirdPartyDBPatamter.FieldName   = "EVENT_TYPE";
            ci.ThirdPartyDBPatamter.FieldType   = System.Data.OleDb.OleDbType.VarChar;
            ci.ThirdPartyDBPatamter.SectionName = "F_INDEX";
            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 FileInQueryCriteriaItem();
            ci.Operator    = QueryCriteriaOperator.Equal;
            ci.Type        = QueryCriteriaType.Or;
            ci.SourceField = "F_INDEX_EVENT_TYPE";
            //ci.TargetField = "EVENT_TYPE";
            //ci.GWDataDBField = f.Clone();
            ci.ThirdPartyDBPatamter.FieldName   = "EVENT_TYPE";
            ci.ThirdPartyDBPatamter.FieldType   = System.Data.OleDb.OleDbType.VarChar;
            ci.ThirdPartyDBPatamter.SectionName = "F_INDEX";
            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 FileInQueryCriteriaItem();
            ci.Operator    = QueryCriteriaOperator.Equal;
            ci.Type        = QueryCriteriaType.Or;
            ci.SourceField = "F_INDEX_EVENT_TYPE";
            //ci.TargetField = "EVENT_TYPE";
            //ci.GWDataDBField = f.Clone();
            ci.ThirdPartyDBPatamter.FieldName   = "EVENT_TYPE";
            ci.ThirdPartyDBPatamter.FieldType   = System.Data.OleDb.OleDbType.VarChar;
            ci.ThirdPartyDBPatamter.SectionName = "F_INDEX";
            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
                FileInQueryResultItem ri = new FileInQueryResultItem();
                ri.Translating.Type = TranslatingType.None;
                ri.RedundancyFlag   = false;

                ri.ThirdPartyDBPatamter.SectionName = "F_INDEX";

                ri.ThirdPartyDBPatamter.FieldName     = f.FieldName.ToUpper();
                ri.ThirdPartyDBPatamter.FieldType     = System.Data.OleDb.OleDbType.VarChar;
                ri.ThirdPartyDBPatamter.FileFieldFlag = false;
                ri.ThirdPartyDBPatamter.FieldID       = ++iFieldID;
                ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_");

                ri.GWDataDBField = f.Clone();
                ri.TargetField   = 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
                FileInQueryResultItem ri = new FileInQueryResultItem();
                ri.Translating.Type = TranslatingType.None;
                ri.RedundancyFlag   = false;

                ri.ThirdPartyDBPatamter.SectionName = "F_PATIENT";

                ri.ThirdPartyDBPatamter.FieldName     = f.FieldName.ToUpper();
                ri.ThirdPartyDBPatamter.FieldType     = System.Data.OleDb.OleDbType.VarChar;
                ri.ThirdPartyDBPatamter.FileFieldFlag = false;
                ri.ThirdPartyDBPatamter.FieldID       = ++iFieldID;
                ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_");

                ri.GWDataDBField = f.Clone();
                ri.TargetField   = 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
                FileInQueryResultItem ri = new FileInQueryResultItem();
                ri.Translating.Type = TranslatingType.None;
                ri.RedundancyFlag   = false;

                ri.ThirdPartyDBPatamter.SectionName = "F_ORDER";

                ri.ThirdPartyDBPatamter.FieldName     = f.FieldName.ToUpper();
                ri.ThirdPartyDBPatamter.FieldType     = System.Data.OleDb.OleDbType.VarChar;
                ri.ThirdPartyDBPatamter.FileFieldFlag = false;
                ri.ThirdPartyDBPatamter.FieldID       = ++iFieldID;
                ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_");

                ri.GWDataDBField = f.Clone();
                ri.TargetField   = f.GetFullFieldName().ToUpper().Replace(".", "_");

                ch.Rule.QueryResult.MappingList.Add(ri);
            }
            #endregion

            #region Result Report
            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
                FileInQueryResultItem ri = new FileInQueryResultItem();
                ri.Translating.Type = TranslatingType.None;
                ri.RedundancyFlag   = false;

                ri.ThirdPartyDBPatamter.SectionName = "F_REPORT";

                ri.ThirdPartyDBPatamter.FieldName     = f.FieldName.ToUpper();
                ri.ThirdPartyDBPatamter.FieldType     = System.Data.OleDb.OleDbType.VarChar;
                ri.ThirdPartyDBPatamter.FileFieldFlag = false;
                ri.ThirdPartyDBPatamter.FieldID       = ++iFieldID;
                ri.SourceField = f.GetFullFieldName().ToUpper().Replace(".", "_");

                ri.GWDataDBField = f.Clone();
                ri.TargetField   = f.GetFullFieldName().ToUpper().Replace(".", "_");

                ch.Rule.QueryResult.MappingList.Add(ri);
            }
            #endregion

            return(ch);
        }