89 lines
2.4 KiB
C#
89 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace SOH.JianYan.YiQi.Base
|
|
{
|
|
public partial class frmBaseSetting : Form
|
|
{
|
|
System.Configuration.Configuration conf;
|
|
public frmBaseSetting()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void btn_save_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
var autodec = conf.AppSettings.Settings["autodec"];
|
|
var autodectime = conf.AppSettings.Settings["autodectime"];
|
|
if (cb_zdbc.Checked)
|
|
{
|
|
if(autodec==null)
|
|
{
|
|
conf.AppSettings.Settings.Add("autodec", "1");
|
|
}
|
|
else
|
|
{
|
|
autodec.Value = "1";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (autodec == null)
|
|
{
|
|
conf.AppSettings.Settings.Add("autodec", "0");
|
|
}
|
|
else
|
|
{
|
|
autodec.Value = "0";
|
|
}
|
|
}
|
|
|
|
if(autodectime==null)
|
|
{
|
|
conf.AppSettings.Settings.Add("autodectime", nud_zdbcsj.Value.ToString());
|
|
}
|
|
else
|
|
{
|
|
autodectime.Value = nud_zdbcsj.Value.ToString();
|
|
}
|
|
conf.Save();
|
|
MessageBox.Show("保存成功!");
|
|
}
|
|
|
|
private void frmBaseSetting_Load(object sender, EventArgs e)
|
|
{
|
|
conf = System.Configuration.ConfigurationManager.OpenExeConfiguration(Application.StartupPath + "\\local.ext");
|
|
var autodec= conf.AppSettings.Settings["autodec"];
|
|
var autodectime= conf.AppSettings.Settings["autodectime"];
|
|
if (autodec != null)
|
|
{
|
|
if (autodec.Value == "1")
|
|
{
|
|
cb_zdbc.Checked = true;
|
|
}
|
|
else
|
|
{
|
|
cb_zdbc.Checked = false;
|
|
}
|
|
}
|
|
if(autodectime!=null)
|
|
{
|
|
nud_zdbcsj.Value = decimal.Parse(autodectime.Value);
|
|
}
|
|
else
|
|
{
|
|
nud_zdbcsj.Value = 0;
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|