Example #1
0
        public ModelSetting()
        {
            PortNames = SerialPort.GetPortNames().ToList();
            SettingXML xML = new SettingXML();

            xML.XmlCreate();//检测配置文件是否存在,否则生成
            SqlConnectString = xML.XmlRead("SqlConnectString");
        }
Example #2
0
        private void Save_Layout()
        {
            Hashtable htDB = new Hashtable();

            htDB["BodyHeight"] = sBodyHH;
            SettingXML sXml = new SettingXML(sProgFolder + "\\" + sSettingFile);

            sXml.WriteXML(htDB);
        }
Example #3
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext              = new ViewModelMainWindow();
            FrameMainWindow.Content  = new PageRealTimeData();
            RbRealTimeData.IsChecked = true;
            SettingXML xML = new SettingXML();

            xML.XmlCreate();
        }
Example #4
0
        /// <summary>
        /// 保存配置
        /// </summary>
        /// <param name="obj"></param>
        private void SaveCommandData(object obj)
        {
            SettingXML xML = new SettingXML
            {
                PortName         = Model.PortName,
                SqlConnectString = Model.SqlConnectString
            };

            xML.XmlSave();
        }
Example #5
0
        public void Save_CompID()
        {
            // 데모용 또는, 관리용 사업자는 저장 안함.
            if (txtCompID.Text == "9999999999" || txtCompID.Text == "0000000000")
            {
                return;
            }

            Hashtable htDB = new Hashtable();

            htDB["CompanyNo"] = txtCompID.Text;
            SettingXML sXml = new SettingXML(sProgFolder + "\\" + "settings_company.xml");

            sXml.WriteXML(htDB);
        }
Example #6
0
        public void Read_CompID()
        {
            Hashtable  htDB = new Hashtable();
            SettingXML sXml = new SettingXML(sProgFolder + "\\" + "settings_company.xml");

            htDB = sXml.ReadXml();

            foreach (DictionaryEntry entry in htDB)
            {
                if (entry.Key.ToString().Equals("CompanyNo"))
                {
                    txtCompID.Text = entry.Value.ToString();
                }
            }
        }
Example #7
0
        private void Read_Layout()
        {
            try
            {
                Hashtable  htDB = new Hashtable();
                SettingXML sXml = new SettingXML(sProgFolder + "\\" + sSettingFile);
                htDB = sXml.ReadXml();

                foreach (DictionaryEntry entry in htDB)
                {
                    if (entry.Key.ToString().Equals("BodyHeight"))
                    {
                        sBodyHH = entry.Value.ToString();
                    }
                }
            }
            catch
            {
            }
        }