当前位置: 首页>>代码示例>>C#>>正文


C# Event.AddErrorEventLn方法代码示例

本文整理汇总了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;
			}
		}
开发者ID:marioricci,项目名称:erp-luma,代码行数:45,代码来源:ContactAddWnd.cs

示例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;
			}
		}
开发者ID:marioricci,项目名称:erp-luma,代码行数:28,代码来源:ContactAddHCareWnd.cs

示例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;
     }
 }
开发者ID:marioricci,项目名称:erp-luma,代码行数:23,代码来源:ContactAddWnd.cs


注:本文中的Event.AddErrorEventLn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。