Esempio n. 1
0
        private void btnDmpImport_Click(object sender, EventArgs e)
        {
            if (!checkDataImportSet())
            {
                return;
            }

            setConfig setconfig = new setConfig();

            Db db = QuickConfig.Common.setXml.getConfig(ConfigName).Db;

            try
            {
                string ansStr = "开始导入数据\r\n";
                foreach (Control ctl in dbControlList)
                {
                    if (ctl is dmpChoose && ((dmpChoose)ctl).Check == true)
                    {
                        string Name   = ((dmpChoose)ctl).Name;
                        DbUser dbuser = db.DbUserList.Find((DbUser ds) => ds.Name == Name);
                        setBAT.OracleImp(Common.getToolsFolder(), Common.getToolsTempFolder(), dbuser.User, dbuser.Password, db.Datasource, dbuser.Dmpfile, db.Impfolder, true);

                        ansStr += dbuser.Label + "数据导出完成\r\n";
                    }
                }
                ansStr += "导入结束\r\n";
                MessageBox.Show(ansStr);
            }
            catch (Exception eg)
            {
                MessageBox.Show(eg.Message.ToString());
            }
        }
Esempio n. 2
0
        private void btn_exec_Click(object sender, EventArgs e)
        {
            Set set = QuickConfig.Common.setXml.getConfig(ConfigName);

            setConfig setconfig = new setConfig();

            List <Btn> btnList = set.Definebtns.BtnList;

            if (this.Type == "bat")
            {
                string filePath = Common.getToolsFolder() + "\\" + this.Filename + "." + this.Type;

                Btn             btn       = btnList.Find((Btn s) => s.Name == this.Name);
                List <string[]> inputList = new List <string[]>();
                foreach (Input input in btn.InputList)
                {
                    string[] str = new string[2];
                    str[0] = input.Key;
                    str[1] = input.Value;
                    inputList.Add(str);
                }

                setBAT.RunBatByDefine(Common.getToolsFolder(), Common.getToolsTempFolder(), this.Filename, inputList, true);
            }
            else if (this.Type == "sql")
            {
                Btn             btn       = btnList.Find((Btn s) => s.Name == this.Name);
                List <string[]> inputList = new List <string[]>();
                foreach (Input input in btn.InputList)
                {
                    string[] str = new string[2];
                    str[0] = input.Key;
                    str[1] = input.Value;
                    inputList.Add(str);
                }

                string user       = btn.Execuser;
                string password   = "";
                string datasource = set.Db.Datasource;
                if (user == set.Db.DbSystemUser.User)
                {
                    password = set.Db.DbSystemUser.Password;
                }
                else if (set.Db.DbUserList.Find((DbUser dbuser) => dbuser.User == user) != null)
                {
                    password = set.Db.DbUserList.Find((DbUser dbuser) => dbuser.User == user).Password;
                }
                else if (set.Db.DbSdeUserList.Find((DbSdeUser dbsdeuser) => dbsdeuser.User == user) != null)
                {
                    password = set.Db.DbSdeUserList.Find((DbSdeUser dbsdeuser) => dbsdeuser.User == user).Password;
                }

                setBAT.SqlExec(Common.getToolsFolder(), Common.getToolsTempFolder(), user, password, datasource, this.Filename, inputList, true);
            }
        }
Esempio n. 3
0
        private void btnConfig_Click(object sender, EventArgs e)
        {
            setXml xml = new setXml();

            xml.addCopyFileXML(Common.getConfigFolder(), Common.getConfigTemplateFolder(), ConfigName, "copyPath");

            Apps apps = QuickConfig.Common.setXml.getConfig(ConfigName).Apps;

            if (!checkAppFolder(apps))
            {
                return;
            }

            setConfig       setconfig = new setConfig();
            List <string[]> checkApp  = new List <string[]>();

            foreach (configCheck cc in configcheckList)
            {
                if (cc.Check)
                {
                    string [] configFolder = new string[2];
                    if (cc.AppType == "ServiceApp")
                    {
                        ServiceApp serviceapp = apps.ServiceAppList.Find((ServiceApp sa) => sa.Name == cc.Name);
                        configFolder[0] = serviceapp.ConfigFolder;
                        configFolder[1] = serviceapp.Path;
                    }
                    else if (cc.AppType == "WebApp")
                    {
                        WebApp serviceapp = apps.WebAppList.Find((WebApp sa) => sa.Name == cc.Name);
                        configFolder[0] = serviceapp.ConfigFolder;
                        configFolder[1] = serviceapp.Path;
                    }
                    else if (cc.AppType == "App")
                    {
                        App serviceapp = apps.AppList.Find((App sa) => sa.Name == cc.Name);
                        configFolder[0] = serviceapp.ConfigFolder;
                        configFolder[1] = serviceapp.Path;
                    }
                    checkApp.Add(configFolder);
                }
            }

            setconfig.config(Common.getConfigTemplateFolder(), Common.getConfigTemplateTempFolder(), ConfigName, checkApp);

            setMessage.MessageShow("", "设置完成!", this.btnConfig);
        }