コード例 #1
0
        internal static void PreLoading()
        {
            //Load DeviceDir
            DeviceMgt          = new DeviceDirManager();
            DeviceMgt.FileName = Application.StartupPath + "\\" + DeviceDirManager.IndexFileName;
            if (!DeviceMgt.LoadDeviceDir())
            {
                MessageBox.Show("Cannot load DeviceDir file.");
            }

            //Load XML file
            string FileName = Application.StartupPath + "\\" + SQLInAdapterConfigMgt._FileName;

            if (!SQLInAdapterConfigMgt.Load(FileName))
            {
                if (SQLInAdapterConfigMgt.LastException != null)
                {
                    if (MessageBox.Show("Cannot load configuration file. Do you want to create an empty configuration file?",
                                        "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        SQLInAdapterConfigMgt.Save(SQLInAdapterConfigMgt._FileName);
                    }
                }
            }
        }
コード例 #2
0
        public static AdapterDataBase db = new AdapterDataBase("");//TODO:Add Connection string Here

        public static void Preloading()
        {
            string FileName = Application.StartupPath + "\\" + SQLInAdapterConfigMgt._FileName;


            Log.WriteAppStart("SQLInboundAdapter");

            if (!SQLInAdapterConfigMgt.Load(FileName))
            {
                Log.Write(LogType.Error, "Load configuration failed. \r\n" + FileName + "\r\n" + SQLInAdapterConfigMgt.LastException.Message);
            }
            else
            {
                if (SQLInAdapterConfigMgt.SQLInAdapterConfig.ThirdPartyInteractConfig.ConnectionParameter.FileConnection)
                {
                    db.ConnectionString = SQLInAdapterConfigMgt.SQLInAdapterConfig.ThirdPartyInteractConfig.ConnectionParameter.FileConnectionString;
                }
                else
                {
                    db.ConnectionString = SQLInAdapterConfigMgt.SQLInAdapterConfig.ThirdPartyInteractConfig.ConnectionParameter.ConnectionStr;
                }
            }
        }