Przeglądaj źródła

fix the resource to adapt all the system

gsp 3 lat temu
rodzic
commit
12c634ea13

+ 11 - 13
OTSIncAReportApp/1-UI/OTSMgrInfo/frmReportSysConfig.cs

@@ -119,6 +119,7 @@ namespace OTSIncAReprotCharts
             string str_DefaultComputedColName = "", str_ElementsColName = "";
             DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXmlData(Application.StartupPath + m_ReportApp.m_OTSReportMgrParamFile, "XMLData");
             DataTable dt = ds.Tables["Member"];
+            string str_scale="";
             foreach (DataRow element in dt.Rows)
             {
                 string RegName = element["RegName"].ToString();
@@ -132,12 +133,16 @@ namespace OTSIncAReprotCharts
                 {
                     str_ElementsColName = element["strValue"].ToString();
                 }
+                if (RegName == "Scale")
+                {
+                    str_scale = element["strValue"].ToString();
+                }
             }
 
-            DataTable dt_scale = ds.Tables["XMLData"];
+            
 
             //比例因子
-            tb_blyz.Text = dt_scale.Rows[0]["Scale"].ToString();
+            tb_blyz.Text = str_scale;
 
             //显示元素
             tb_xsys.Text = str_ElementsColName;
@@ -270,22 +275,15 @@ namespace OTSIncAReprotCharts
         //保存报告文件
         private void btn_ybcsbc_Click(object sender, EventArgs e)
         {
-            int dScale = 0;//比例因子
-            //string ModeFile = tb_bgmb.Text;
-            //string Mode = tb_bgmbwj.Text;
-            //参数设置保存功能粒级文件夹
+          
+         
 
             //参数设置保存功能粒级文件
             strParSizeFile = tb_PartiSizeFileFolder.Text;
 
             String strTritempFile = tb_sjtmb.Text;
             string strTritemp = tb_sjtmbwj.Text;
-            //if (tb_blyz.Text != "")
-            //{
-            //    dScale = Convert.ToInt32(tb_blyz.Text);
-            //}
-
-            //tb_blyz.Text = (dScale).ToString();
+         
 
 
             //保存显示计算项
@@ -299,7 +297,7 @@ namespace OTSIncAReprotCharts
             ret = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.UpdateByAttribute(Application.StartupPath + m_ReportApp.m_OTSReportMgrParamFile, AttributeName_ElementsColName, Value_ElementsColName);
 
             //比例因子
-            OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.EditXmlInfo(Application.StartupPath + m_ReportApp.m_OTSReportMgrParamFile, "XMLData", "Scale", tb_blyz.Text.ToString());
+            OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.EditXmlInfo(Application.StartupPath + m_ReportApp.m_OTSReportMgrParamFile, "Scale", "strValue", tb_blyz.Text.ToString());
 
 
             //因为设置了颗粒列表的显示列,颗粒列表则需要重新加载,设置为null,后面可以重新加载

+ 32 - 0
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/XMLoperate.cs

@@ -325,6 +325,38 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             }
 
 
+        }
+        public static bool EditMemberXmlInfo(string FilePath, string TagName, string Name, string Value)
+        {
+            try
+            {
+                XmlDocument xmlDoc = new XmlDocument();
+
+                xmlDoc.Load(FilePath);    //加载Xml文件  
+
+                XmlNodeList nodeList = xmlDoc.GetElementsByTagName("Member");
+
+                foreach (XmlNode node in nodeList)
+                {
+                    XmlElement ele = (XmlElement)node;
+                    if (ele.GetAttribute("RegName") == TagName)
+                    {
+                        ele.SetAttribute(Name, Value);
+                    }
+
+                   
+
+
+                }
+                xmlDoc.Save(FilePath);
+                return true;
+            }
+            catch (Exception e)
+            {
+                return false;
+            }
+
+
         }
 
         /// <summary>