schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XImagingXhandler.XDAL;
using XCoreBLL.Resource;
using System.Xml;
using System.Web.UI.WebControls;
using System.Xml.Linq;
 
namespace XCore
{
    public class LoopBll
    {
        string strCurrentCulture = "";
        public LoopBll()
        {
            strCurrentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
        }
 
        public MethodLoop GenerateMethodLoopDataByXmlNode(XmlNode xmlNode)
        {
            MethodLoop methodLoop = new MethodLoop();
 
            methodLoop.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
            methodLoop.status = xmlNode.SelectSingleNode("status").InnerText;
            methodLoop.name = xmlNode.SelectSingleNode("name").InnerText;
            methodLoop.label = xmlNode.SelectSingleNode("label").InnerText;
            methodLoop.variableName = xmlNode.SelectSingleNode("variableName").InnerText;
            methodLoop.variablesValue = xmlNode.SelectSingleNode("variablesValue").InnerText;
            methodLoop.variableeValue = xmlNode.SelectSingleNode("variableeValue").InnerText;
            methodLoop.incrementValue = xmlNode.SelectSingleNode("incrementValue").InnerText;
            //methodLoop.content = "";
            return methodLoop;
        }
 
        #region 检查所有属性设置是否满足要求
        /// <summary>
        /// 检查所有属性设置是否满足要求
        /// </summary>
        /// <param name="methodAspirate">循环属性对象</param>
        /// <returns>检查所有属性设置是否满足要求</returns>
        public MethodPropertyInfo CheckProperty(MethodLoop methodLoop)
        {
            MethodPropertyInfo methodPropertyInfo = new MethodPropertyInfo();
 
            if (strCurrentCulture == "zh-CN")
            {
                methodPropertyInfo.property_tips_info = LoopResourceCHS.tipsInfo.ToString();
 
                if (methodLoop.variableName == null || methodLoop.variableName == "")
                {
                    methodPropertyInfo.property_name_info = LoopResourceCHS.variableName.ToString();
                }
                if (methodLoop.variablesValue == null || methodLoop.variablesValue == "")
                {
                    methodPropertyInfo.property_name_info = LoopResourceCHS.variablesValue.ToString();
                }
                if (methodLoop.variableeValue == null || methodLoop.variableeValue == "")
                {
                    methodPropertyInfo.property_name_info = LoopResourceCHS.variableeValue.ToString();
                }
                if (methodLoop.incrementValue == null || methodLoop.incrementValue == "")
                {
                    methodPropertyInfo.property_name_info = LoopResourceCHS.incrementValue.ToString();
                }
            }
            else if (strCurrentCulture == "en-US")
            {
                methodPropertyInfo.property_tips_info = LoopResourceENU.tipsInfo.ToString();
 
                if (methodLoop.variableName == null || methodLoop.variableName == "")
                {
                    methodPropertyInfo.property_name_info = LoopResourceENU.variableName.ToString();
                }
                if (methodLoop.variablesValue == null || methodLoop.variablesValue == "")
                {
                    methodPropertyInfo.property_name_info = LoopResourceENU.variablesValue.ToString();
                }
                if (methodLoop.variableeValue == null || methodLoop.variableeValue == "")
                {
                    methodPropertyInfo.property_name_info = LoopResourceENU.variableeValue.ToString();
                }
                if (methodLoop.incrementValue == null || methodLoop.incrementValue == "")
                {
                    methodPropertyInfo.property_name_info = LoopResourceENU.incrementValue.ToString();
                }
            }
            return methodPropertyInfo;
        }
        #endregion
    }
}