83 lines
2.5 KiB
C#
83 lines
2.5 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.FenZhen.Client
|
||
{
|
||
public partial class FrmCallSetting : Form
|
||
{
|
||
public FrmCallSetting()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
System.Configuration.Configuration congf= SOH.Configuration.LocalConfig.Config;
|
||
private void FrmCallSetting_Load(object sender, EventArgs e)
|
||
{
|
||
if(congf.AppSettings.Settings.AllKeys.Contains("wlks"))
|
||
{
|
||
txt_wlks.Text = congf.AppSettings.Settings["wlks"].Value;
|
||
}
|
||
if (congf.AppSettings.Settings.AllKeys.Contains("serverurl"))
|
||
{
|
||
txt_serverurl.Text = congf.AppSettings.Settings["serverurl"].Value;
|
||
}
|
||
if (congf.AppSettings.Settings.AllKeys.Contains("wlksname"))
|
||
{
|
||
txt_ksname.Text = congf.AppSettings.Settings["wlksname"].Value;
|
||
}
|
||
}
|
||
|
||
private void btn_ok_Click(object sender, EventArgs e)
|
||
{
|
||
if(txt_wlks.Text=="")
|
||
{
|
||
MessageBox.Show("物理科室ID不能为空!");
|
||
return;
|
||
}
|
||
if (txt_ksname.Text == "")
|
||
{
|
||
MessageBox.Show("物理科室名称不能为空!");
|
||
return;
|
||
}
|
||
if (txt_serverurl.Text == "")
|
||
{
|
||
MessageBox.Show("服务器URL不能为空!");
|
||
return;
|
||
}
|
||
if (congf.AppSettings.Settings.AllKeys.Contains("wlks"))
|
||
{
|
||
congf.AppSettings.Settings["wlks"].Value= txt_wlks.Text ;
|
||
}
|
||
else
|
||
{
|
||
congf.AppSettings.Settings.Add("wlks", txt_wlks.Text);
|
||
}
|
||
|
||
if (congf.AppSettings.Settings.AllKeys.Contains("serverurl"))
|
||
{
|
||
congf.AppSettings.Settings["serverurl"].Value = txt_serverurl.Text;
|
||
}
|
||
else
|
||
{
|
||
congf.AppSettings.Settings.Add("serverurl", txt_serverurl.Text);
|
||
}
|
||
|
||
if (congf.AppSettings.Settings.AllKeys.Contains("wlksname"))
|
||
{
|
||
congf.AppSettings.Settings["wlksname"].Value =txt_ksname.Text;
|
||
}
|
||
else
|
||
{
|
||
congf.AppSettings.Settings.Add("wlksname", txt_ksname.Text);
|
||
}
|
||
congf.Save();
|
||
DialogResult = DialogResult.OK;
|
||
}
|
||
}
|
||
}
|