Пример #1
0
        private void InsertDataDT(SQLOutboundChanel chn)
        {
            SQLOutQueryResultItem item = new SQLOutQueryResultItem();

            item.ThirdPartyDBPatamter.FieldName = "";
            item.TargetField   = "data_dt";
            item.GWDataDBField = GWDataDBField.i_DataDateTime;
            item.SourceField   = item.GWDataDBField.FieldName;

            chn.Rule.QueryResult.MappingList.Add(item);
        }
Пример #2
0
        public QueryOutParameter(XCollection <SQLOutQueryResultItem> parameters)
        {
            InitializeComponent();
            GetLUTTables();
            parameterList = parameters;
            parameterItem = new SQLOutQueryResultItem();
            type          = "Add";
            this.Text     = "Add Mapping Item";

            GetThirdParaSet(parameters);
        }
Пример #3
0
        public QueryOutParameter(XCollection <SQLOutQueryResultItem> parameters, int index)
        {
            InitializeComponent();
            GetLUTTables();
            parameterList  = parameters;
            parameterItem  = parameters[index];
            type           = "Edit";
            this.Text      = "Edit Mapping Item";
            parameterIndex = index;

            GetThirdParaSet(parameters);
            ShowInformation();
        }
Пример #4
0
        public QueryResult(Channel channel)
        {
            InitializeComponent();
            GetLUTTables();
            ComboxLoader.LoadOleDBType(this.enumCmbbxFieldType);

            channelForm           = channel;
            type                  = "Add";
            this.Text             = "Add Mapping Item";
            sqlOutQueryResultItem = new SQLOutQueryResultItem();

            GetThirdParaSet(channelForm.resultItemList);
            SetThirdPartyNameType();

            this.groupBoxRD.Enabled = (channelForm.QueryMode == ThrPartyDBOperationType.Table.ToString() &&
                                       channelForm.parentForm.DBconfig.ConnectionParameter.FileConnection == false);
        }
Пример #5
0
        private void LoadTableSetting(SQLOutboundChanel chn, GWDataDBTable table, string inboundName, string tablePrefix)
        {
            GWDataDBField[] iFields = GWDataDBField.GetFields(table);
            foreach (GWDataDBField f in iFields)
            {
                if (f.IsAuto)
                {
                    continue;
                }
                string paramName           = f.GetFullFieldName(inboundName).Replace(".", "_");
                SQLOutQueryResultItem item = new SQLOutQueryResultItem();

                item.SourceField   = f.GetFullFieldName(tablePrefix);
                item.GWDataDBField = f;

                item.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.VarChar;
                item.ThirdPartyDBPatamter.FieldName = paramName;
                item.TargetField = paramName;

                chn.Rule.QueryResult.MappingList.Add(item);
            }
        }
Пример #6
0
        //Build a test configuration file
        static public bool BuildTestConfigFile()
        {
            #region 3rd database connection
            SQLOutAdapterConfigMgt.SQLOutAdapterConfig.ThirdPartyInteractConfig.ConnectionParameter.Database = "GWDataDB";
            SQLOutAdapterConfigMgt.SQLOutAdapterConfig.ThirdPartyInteractConfig.ConnectionParameter.Server   = "CNSHW9RSZM1X";
            SQLOutAdapterConfigMgt.SQLOutAdapterConfig.ThirdPartyInteractConfig.ConnectionParameter.User     = "******";
            SQLOutAdapterConfigMgt.SQLOutAdapterConfig.ThirdPartyInteractConfig.ConnectionParameter.Password = "******";

            SQLOutAdapterConfigMgt.SQLOutAdapterConfig.ThirdPartyInteractConfig.TimerEnable   = true;
            SQLOutAdapterConfigMgt.SQLOutAdapterConfig.ThirdPartyInteractConfig.TimerInterval = 1000;
            SQLOutAdapterConfigMgt.SQLOutAdapterConfig.ThirdPartyInteractConfig.ConnectionParameter.ConnectionStr = "Provider=SQLNCLI.1;Data Source=CNSHW9RSZM1X;Password=123456;User ID=sa;Initial Catalog=GWDataDB";
            #endregion


            #region channel Patient_test_sp
            SQLOutboundChanel ch = new SQLOutboundChanel();
            ch.Enable        = true;
            ch.ChannelName   = "Patient_test_SP";
            ch.OperationType = ThrPartyDBOperationType.StorageProcedure;
            ch.OperationName = "dbo.p_Patient_test";
            ch.Rule.AutoUpdateProcessFlag = false;
            ch.Rule.CheckProcessFlag      = true;
            ch.Rule.RuleName = "sp_testpatient";

            // column Patient_test.patientid
            SQLOutQueryResultItem map = new SQLOutQueryResultItem();
            map.SourceField    = "patientid";
            map.TargetField    = "patientid";
            map.RedundancyFlag = true;
            map.ThirdPartyDBPatamter.FieldID   = 0;
            map.ThirdPartyDBPatamter.FieldName = "PatientID";
            map.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.Integer;
            ch.Rule.QueryResult.MappingList.Add(map);

            // column Patient_test.patient_name
            map                = new SQLOutQueryResultItem();
            map.SourceField    = "Patient_name";
            map.TargetField    = "Patient_name";
            map.RedundancyFlag = false;
            map.ThirdPartyDBPatamter.FieldID   = 1;
            map.ThirdPartyDBPatamter.FieldName = "Patient_name";
            map.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.VarChar;
            ch.Rule.QueryResult.MappingList.Add(map);
            // column Patient_test.address
            map                = new SQLOutQueryResultItem();
            map.SourceField    = "Address";
            map.TargetField    = "Address";
            map.RedundancyFlag = false;
            map.ThirdPartyDBPatamter.FieldID   = 2;
            map.ThirdPartyDBPatamter.FieldName = "Address";
            map.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.VarChar;
            ch.Rule.QueryResult.MappingList.Add(map);
            // column patient_test.birthdate
            map                = new SQLOutQueryResultItem();
            map.SourceField    = "BirthDate";
            map.TargetField    = "BirthDate";
            map.RedundancyFlag = false;
            map.ThirdPartyDBPatamter.FieldID   = 3;
            map.ThirdPartyDBPatamter.FieldName = "BirthDate";
            map.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.Date;
            ch.Rule.QueryResult.MappingList.Add(map);
            SQLOutAdapterConfigMgt.SQLOutAdapterConfig.OutboundChanels.Add(ch);
            #endregion

            #region channel Patient_test_table
            ch               = new SQLOutboundChanel();
            ch.ChannelName   = "Patient_test_table";
            ch.Enable        = false;
            ch.OperationType = ThrPartyDBOperationType.Table;
            ch.OperationName = "dbo.p_Patient_test";
            ch.Rule.AutoUpdateProcessFlag = false;
            ch.Rule.CheckProcessFlag      = true;
            ch.Rule.RuleName = "sp_testpatient";

            // column Patient_test.patientid
            map                = new SQLOutQueryResultItem();
            map.SourceField    = "patientid";
            map.TargetField    = "patientid";
            map.RedundancyFlag = true;
            map.ThirdPartyDBPatamter.FieldID   = 0;
            map.ThirdPartyDBPatamter.FieldName = "PatientID";
            map.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.Integer;
            ch.Rule.QueryResult.MappingList.Add(map);

            // column Patient_test.patient_name
            map                = new SQLOutQueryResultItem();
            map.SourceField    = "Patient_name";
            map.TargetField    = "Patient_name";
            map.RedundancyFlag = false;
            map.ThirdPartyDBPatamter.FieldID   = 1;
            map.ThirdPartyDBPatamter.FieldName = "Patient_name";
            map.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.VarChar;
            ch.Rule.QueryResult.MappingList.Add(map);
            // column Patient_test.address
            map                = new SQLOutQueryResultItem();
            map.SourceField    = "Address";
            map.TargetField    = "Address";
            map.RedundancyFlag = false;
            map.ThirdPartyDBPatamter.FieldID   = 2;
            map.ThirdPartyDBPatamter.FieldName = "Address";
            map.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.VarChar;
            ch.Rule.QueryResult.MappingList.Add(map);
            // column patient_test.birthdate
            map                = new SQLOutQueryResultItem();
            map.SourceField    = "BirthDate";
            map.TargetField    = "BirthDate";
            map.RedundancyFlag = false;
            map.ThirdPartyDBPatamter.FieldID   = 3;
            map.ThirdPartyDBPatamter.FieldName = "BirthDate";
            map.ThirdPartyDBPatamter.FieldType = System.Data.OleDb.OleDbType.Date;
            ch.Rule.QueryResult.MappingList.Add(map);
            SQLOutAdapterConfigMgt.SQLOutAdapterConfig.OutboundChanels.Add(ch);
            #endregion

            //save
            return(SQLOutAdapterConfigMgt.Save(SQLOutAdapterConfigMgt._FileName));
        }