private void cmdUpdate_Click(object sender, System.EventArgs e)
{
// Update an existing item.
try
{
if (this.txtSettingKey.Text == string.Empty)
{
MessageBox.Show("You must enter a value for the key.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.txtSettingKey.Select();
return;
}
if (this.txtSettingValue.Text == string.Empty)
{
MessageBox.Show("You must enter a value for the value field.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.txtSettingValue.Select();
return;
}
mcustAppSet = new AppSetting(this.txtSettingKey.Text, this.txtSettingValue.Text);
mcustAppSettings.Update(mcustAppSet);
this.ListCustomSettings();
MessageBox.Show("Existing setting updated.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message, exp.Source, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}