예제 #1
0
        public static int createJobConfig(string outcode, out AbstractJobConfig config)
        {
            int num;
            string str4;
            XmlDocument document2;
            config = null;
            string code = outcode.Substring(0, 6);
            if (!int.TryParse(outcode.Substring(6), out num))
            {
                return -10;
            }
            string dir = TemplatePath + @"recv\" + code + @"\";
            int num2 = dirCheck(dir, code, out str4);
            if (num2 != 0)
            {
                code = code.Substring(0, 4);
                dir = TemplatePath + @"recv\" + code + @"\";
                int num3 = dirCheck(dir, code, out str4);
                switch (num3)
                {
                    case 0:
                        goto Label_015D;

                    case -1:
                        return num2;
                }
                return num3;
            }
            XmlDocument document = new XmlDocument();
            try
            {
                document.Load(str4);
                XmlAttribute attribute = document.DocumentElement.Attributes["erase"];
                if ((attribute != null) && (attribute.Value.ToUpper() == "TRUE"))
                {
                    code = code.Substring(0, 4);
                    dir = TemplatePath + @"recv\" + code + @"\";
                    int num4 = dirCheck(dir, code, out str4);
                    switch (num4)
                    {
                        case 0:
                            goto Label_015D;

                        case -1:
                            return -8;
                    }
                    return num4;
                }
            }
            catch (XmlException exception)
            {
                lastError = exception.Message + "\t" + exception.StackTrace;
                return -4;
            }
            catch (Exception exception2)
            {
                lastError = exception2.Message + "\t" + exception2.StackTrace;
                return -99;
            }
        Label_015D:
            document2 = new XmlDocument();
            try
            {
                XmlNode node;
                document2.Load(str4);
                XmlAttribute attribute2 = document2.DocumentElement.Attributes["style"];
                if ((attribute2 == null) || (attribute2.Value == "normal"))
                {
                    NormalConfig config2 = new NormalConfig();
                    num2 = config2.setDocument(document2);
                    if (num2 == 0)
                    {
                        config2.setDirectories(dir, GymErrPath, GuidePath);
                        num2 = config2.selectRecord(num, out node);
                    }
                    config = config2;
                    return num2;
                }
                if ((attribute2.Value == "combi") || (attribute2.Value == "combination"))
                {
                    CombiConfig config3 = new CombiConfig();
                    num2 = config3.setDocument(document2);
                    if (num2 == 0)
                    {
                        config3.setDirectories(dir, GymErrPath, GuidePath);
                    }
                    config = config3;
                    return num2;
                }
                if (attribute2.Value == "divide")
                {
                    DivideConfig config4 = new DivideConfig();
                    num2 = config4.setDocument(document2);
                    if (num2 == 0)
                    {
                        config4.setDirectories(dir, GymErrPath, GuidePath);
                        num2 = config4.selectRecord(num, out node);
                    }
                    config = config4;
                    return num2;
                }
                return -6;
            }
            catch (XmlException exception3)
            {
                lastError = exception3.Message + "\t" + exception3.StackTrace;
                return -4;
            }
            catch (Exception exception4)
            {
                lastError = exception4.Message + "\t" + exception4.StackTrace;
                return -99;
            }
            return num2;
        }
예제 #2
0
 private static int loadJob(string dir, string code, DateTime dateTime, out AbstractJobConfig config)
 {
     string str;
     config = null;
     int num = dirCheck(dir, code, out str);
     if (num == 0)
     {
         XmlDocument doc = new XmlDocument();
         try
         {
             XmlNode node;
             doc.Load(str);
             XmlAttribute attribute = doc.DocumentElement.Attributes["style"];
             if (((attribute == null) || (attribute.Value == "")) || (attribute.Value == "normal"))
             {
                 NormalConfig config2 = new NormalConfig();
                 num = config2.setDocument(doc);
                 if (num == 0)
                 {
                     config2.setDirectories(dir, GymErrPath, GuidePath);
                     num = config2.selectRecord(dateTime, out node);
                 }
                 config = config2;
                 return num;
             }
             if (attribute.Value == "combi")
             {
                 CombiConfig config3 = new CombiConfig();
                 num = config3.setDocument(doc);
                 if (num == 0)
                 {
                     config3.setDirectories(dir, GymErrPath, GuidePath);
                     for (int i = 0; i < config3.count; i++)
                     {
                         AbstractJobConfig config4;
                         num = createJobConfig(config3.configs[i].code, dateTime, out config4);
                         config3.configs[i].config = config4 as NormalConfig;
                     }
                 }
                 config = config3;
                 return num;
             }
             if (attribute.Value == "divide")
             {
                 DivideConfig config5 = new DivideConfig();
                 num = config5.setDocument(doc);
                 if (num == 0)
                 {
                     config5.setDirectories(dir, GymErrPath, GuidePath);
                     num = config5.selectRecord(dateTime, out node);
                 }
                 config = config5;
                 return num;
             }
             return -6;
         }
         catch (XmlException exception)
         {
             lastError = exception.Message + "\t" + exception.StackTrace;
             return -4;
         }
         catch (Exception exception2)
         {
             lastError = exception2.Message + "\t" + exception2.StackTrace;
             return -99;
         }
     }
     return num;
 }
예제 #3
0
 private int CreateLayout(CombiConfig Cconfig)
 {
     int num = 0;
     PathInfo info = PathInfo.CreateInstance();
     Directory.CreateDirectory(info.InputHistoryRoot);
     this.JPList = new List<CmbJPRec>();
     this.JPList.Add(new CmbJPRec());
     this.JPList[0].JP = new Naccs.Core.Job.JobPanel();
     this.JPList[0].JPStatus = JobPanelStatus.Closed;
     this.JPList[0].AuCtrlInfoList = new List<AuCtrlInfo>();
     if (Cconfig.configs[0].config != null)
     {
         this.JPList[0].FileName = Cconfig.configs[0].config.Display;
         this.JPList[0].CorrelationFileName = Cconfig.configs[0].config.Correlation;
         this.JPList[0].HistoryFile = info.getInputHistory(Cconfig.configs[0].code);
         this.JPList[0].GuideFile = Cconfig.configs[0].config.Guide;
         this.JPList[0].JobErrs = new JobErrInfo();
         this.JPList[0].Code = Cconfig.configs[0].code;
         this.JPList[0].JCode = Cconfig.configs[0].config.record.jobcode.Trim();
         this.JPList[0].DCode = Cconfig.configs[0].config.record.dispcode.Trim();
     }
     this.InitJobPanel(this.JPList[0].JP);
     num = this.JPList[0].JP.Items.CreateDataSet(this.JPList[0].FileName);
     if (num != 0)
     {
         return num;
     }
     this.pnlRegular.Controls.Add(this.JPList[0].JP);
     this.JPList[0].JP.Dock = DockStyle.Fill;
     this.TC = new TabControl();
     this.TC.TabStop = false;
     this.TC.Name = "tbDefault";
     this.TC.Selected += new TabControlEventHandler(this.TC_Selected);
     this.pnlTab.Controls.Add(this.TC);
     this.TC.Dock = DockStyle.Fill;
     for (int i = 1; i < Cconfig.count; i++)
     {
         this.JPList.Add(new CmbJPRec());
         this.JPList[i].JP = new Naccs.Core.Job.JobPanel();
         this.JPList[i].JPStatus = JobPanelStatus.Closed;
         this.JPList[i].AuCtrlInfoList = new List<AuCtrlInfo>();
         if (Cconfig.configs[i].config != null)
         {
             this.JPList[i].FileName = Cconfig.configs[i].config.Display;
             this.JPList[i].CorrelationFileName = Cconfig.configs[i].config.Correlation;
             this.JPList[i].HistoryFile = info.getInputHistory(Cconfig.configs[i].code);
             this.JPList[i].GuideFile = Cconfig.configs[i].config.Guide;
             this.JPList[i].JobErrs = new JobErrInfo();
             this.JPList[i].Code = Cconfig.configs[i].code;
             this.JPList[i].JCode = Cconfig.configs[i].config.record.jobcode;
             this.JPList[i].DCode = Cconfig.configs[i].config.record.dispcode;
         }
         this.InitJobPanel(this.JPList[i].JP);
         num = this.JPList[i].JP.Items.CreateDataSet(this.JPList[i].FileName);
         if (num != 0)
         {
             return num;
         }
         TabPage page = new TabPage {
             Name = "Tab" + i.ToString(),
             Text = Cconfig.configs[i].tabname
         };
         this.TC.Controls.Add(page);
     }
     return 0;
 }