示例#1
0
        private void CreateInboundSPScript(IInboundRule[] ruleList)
        {
            string interfaceName  = Program.DeviceMgt.DeviceDirInfor.Header.Name;
            string fnameInstall   = Application.StartupPath + "\\" + RuleScript.InstallSP.FileName;
            string fnameUninstall = Application.StartupPath + "\\" + RuleScript.UninstallSP.FileName;

            Program.Log.Write("Creating install storage procedure script...");
            //using (StreamWriter sw = File.CreateText(fnameInstall))     // 20110706 OSQL & SQLMgmtStudio only support ASCII and UNICODE
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine(GWDataDB.GetUseDataBaseSql());
                foreach (IInboundRule rule in ruleList)
                {
                    string strSql = RuleControl.GetInboundSP(interfaceName, rule);
                    sb.AppendLine(strSql);

                    IRuleSupplier supplier = rule as IRuleSupplier;
                    if (supplier != null)
                    {
                        string strSqlSupplied = supplier.GetInstallDBScript();
                        if (strSqlSupplied != null)
                        {
                            sb.AppendLine(strSqlSupplied);
                        }
                    }
                }
                //sw.Write(sb.ToString());
                File.WriteAllText(fnameInstall, sb.ToString(), Encoding.Unicode);
            }
            Program.Log.Write("Create install storage procedure script succeeded. " + fnameInstall);

            Program.Log.Write("Creating uninstall storage procedure script...");
            using (StreamWriter sw = File.CreateText(fnameUninstall))
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine(GWDataDB.GetUseDataBaseSql());
                foreach (IInboundRule rule in ruleList)
                {
                    string strSql = RuleControl.GetInboundSPUninstall(interfaceName, rule);
                    sb.AppendLine(strSql);

                    IRuleSupplier supplier = rule as IRuleSupplier;
                    if (supplier != null)
                    {
                        string strSqlSupplied = supplier.GetUninstallDBScript();
                        if (strSqlSupplied != null)
                        {
                            sb.AppendLine(strSqlSupplied);
                        }
                    }
                }
                sw.Write(sb.ToString());
            }
            Program.Log.Write("Create uninstall storage procedure script succeeded. " + fnameUninstall);
        }
示例#2
0
 public void Save()
 {
     if (IsChanged)
     {
         channel.SPStatement = txtSPStatement.Text;
     }
     else
     {
         channel.SPStatement = RuleControl.GetInboundSP(interfaceName, channel.Rule, false);
     }
 }
示例#3
0
        private void LoadDefaultInboundSP()
        {
            channelSet.Clear();

            string interfaceName = Program.DeviceMgt.DeviceDirInfor.Header.Name;

            //Patient Table
            SQLInboundChanel chnPatient = channelSet.Add(new SQLInboundChanel());

            chnPatient.Rule.RuleID = GWDataDBTable.Patient.ToString();
            chnPatient.SPName      = "sp_" + interfaceName + "_" + GWDataDBTable.Patient.ToString();

            LoadTableParameter(chnPatient, GWDataDBTable.Index, interfaceName);
            LoadTableParameter(chnPatient, GWDataDBTable.Patient, interfaceName);
            chnPatient.SPStatement = RuleControl.GetInboundSP(interfaceName, chnPatient.Rule, false);

            //Order Table
            SQLInboundChanel chnOrder = channelSet.Add(new SQLInboundChanel());

            chnOrder.Rule.RuleID = GWDataDBTable.Order.ToString();
            chnOrder.SPName      = "sp_" + interfaceName + "_" + GWDataDBTable.Order.ToString();

            LoadTableParameter(chnOrder, GWDataDBTable.Index, interfaceName);
            LoadTableParameter(chnOrder, GWDataDBTable.Patient, interfaceName);
            LoadTableParameter(chnOrder, GWDataDBTable.Order, interfaceName);
            chnOrder.SPStatement = RuleControl.GetInboundSP(interfaceName, chnOrder.Rule, false);


            //Report Table
            SQLInboundChanel chnReport = channelSet.Add(new SQLInboundChanel());

            chnReport.Rule.RuleID = GWDataDBTable.Report.ToString();
            chnReport.SPName      = "sp_" + interfaceName + "_" + GWDataDBTable.Report.ToString();

            LoadTableParameter(chnReport, GWDataDBTable.Index, interfaceName);
            LoadTableParameter(chnReport, GWDataDBTable.Patient, interfaceName);
            LoadTableParameter(chnReport, GWDataDBTable.Order, interfaceName);
            LoadTableParameter(chnReport, GWDataDBTable.Report, interfaceName);
            chnReport.SPStatement = RuleControl.GetInboundSP(interfaceName, chnReport.Rule, false);
        }
示例#4
0
 public void CreatStatement()
 {
     txtSPStatement.Text  = RuleControl.GetInboundSP(interfaceName, channel.Rule, false);
     lblIsChanged.Visible = false;
 }