吉林安睿特调度
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.7 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.VisualBasic;
namespace wcfControlMonitorClient
{
/// <summary>
/// Creator:Richard.liu
/// ºÚÏ»×Óά»¤
/// </summary>
public partial class FrmDarkCasket : Form
{
private static FrmDarkCasket _formInstance;
public static FrmDarkCasket FormInstance
{
get
{
if (_formInstance == null)
{
_formInstance = new FrmDarkCasket();
}
return _formInstance;
}
set { _formInstance = value; }
}
public FrmDarkCasket()
{
InitializeComponent();
_formInstance = this;
}
private void button1_Click(object sender, EventArgs e)
{
try
{
int a = 0;
if (int.TryParse(this.tbDarkCasketDays.Text.Trim(),out a) == false)
{
MessageBox.Show("ºÚÏ»×ÓÎļþµÄ±£Áô¸öÊý±ØÐëÊÇÊý×Ö£¡", "²Ù×÷Ìáʾ£º", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.tbDarkCasketDays.Focus();
return;
}
if (int.TryParse(this.tbDarkCasketSize.Text.Trim(),out a) == false)
{
MessageBox.Show("ºÚÏ»×ÓÎļþ´óСµÄ×î´óÖµ±ØÐëÊÇÊý×Ö£¡", "²Ù×÷Ìáʾ£º", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.tbDarkCasketSize.Focus();
return;
}
double ssize;
ssize = 1048576 * Convert.ToDouble( this.tbDarkCasketSize.Text);
CommonClassLib.AppSettings.SetValue("DarkCasketSize", ssize.ToString());
CommonClassLib.AppSettings.SetValue("DarkCasketSum", this.tbDarkCasketDays.Text);
MessageBox.Show("±£´æ³É¹¦£¡", "²Ù×÷Ìáʾ£º", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.Close();
}
catch (Exception ex)
{
throw ex;
}
}
private void FrmDarkCasket_Load(object sender, EventArgs e)
{
//20100521
this.tbDarkCasketDays.Text=CommonClassLib.AppSettings.GetValue("DarkCasketSum");
this.tbDarkCasketSize.Text = Convert.ToString(Convert.ToDouble( CommonClassLib.AppSettings.GetValue("DarkCasketSize")) / 1048576);
}
private void FrmDarkCasket_FormClosing(object sender, FormClosingEventArgs e)
{
_formInstance = null;
}
}
}