本文整理汇总了C#中Event.AddErrorEventLn方法的典型用法代码示例。如果您正苦于以下问题:C# Event.AddErrorEventLn方法的具体用法?C# Event.AddErrorEventLn怎么用?C# Event.AddErrorEventLn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Event
的用法示例。
在下文中一共展示了Event.AddErrorEventLn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ContactAddWnd_KeyDown
private void ContactAddWnd_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
switch (e.KeyData)
{
case Keys.Escape:
dialog = DialogResult.Cancel;
this.Hide();
break;
case Keys.Enter:
if (string.IsNullOrEmpty(txtCustomerName.Text))
{
MessageBox.Show("Please enter a valid customer name.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
Int32 intTerms = 0;
if (!int.TryParse(txtTerms.Text, out intTerms))
{
MessageBox.Show("Please enter a valid whole number in TERMS.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
decimal decCreditLimit = 0;
if (!decimal.TryParse(txtCreditLimit.Text, out decCreditLimit))
{
MessageBox.Show("Please enter a valid credit limit.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
try
{
if (SaveRecord() == true)
{
dialog = DialogResult.OK;
this.Hide();
}
}
catch (Exception ex)
{
Event clsEvent = new Event();
clsEvent.AddErrorEventLn(ex);
MessageBox.Show("Sorry the customer name is already in the database. Please type another customer name." ,"RetailPlus",MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
break;
}
}
示例2: ContactAddHCareWnd_KeyDown
private void ContactAddHCareWnd_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
switch (e.KeyData)
{
case Keys.Escape:
dialog = DialogResult.Cancel;
this.Hide();
break;
case Keys.Enter:
try
{
if (SaveRecord() == true)
{
dialog = DialogResult.OK;
this.Hide();
}
}
catch (Exception ex)
{
Event clsEvent = new Event();
clsEvent.AddErrorEventLn(ex);
MessageBox.Show("Sorry the customer name is already in the database. Please type another customer name." ,"RetailPlus",MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
break;
}
}
示例3: cmdEnter_Click
private void cmdEnter_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(txtCustomerName.Text))
{
MessageBox.Show("Please enter a valid customer name.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
try
{
if (SaveRecord() == true)
{
dialog = DialogResult.OK;
this.Hide();
}
}
catch (Exception ex)
{
Event clsEvent = new Event();
clsEvent.AddErrorEventLn(ex);
MessageBox.Show("Sorry the customer name is already in the database. Please type another customer name.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}