📄 globleutility2.cs
字号:
using System;
using System.Windows.Forms;
namespace GlobleUtility
{
public class ErrorCode
{
public ErrorCode()
{
}
public void ShowMessage(int nECode)
{
switch(nECode)
{
case 1:
MessageBox.Show(E_1_CreateObjFailed, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 2:
MessageBox.Show(E_2_CreateConnectStringFailed, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 3:
MessageBox.Show(E_3_ConnectDBFailed, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 4:
MessageBox.Show(E_4_VerifyUserFailed, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 5:
MessageBox.Show(E_5_PwdNotMatch, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 6:
MessageBox.Show(E_6_OldPwdError, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 7:
MessageBox.Show(E_7_ExecStoredProcFailed, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 8:
MessageBox.Show(E_8_DBUnknownError, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 9:
MessageBox.Show(E_9_Select, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 10:
MessageBox.Show(E_10_Insert, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 11:
MessageBox.Show(E_11_Update, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
case 12:
MessageBox.Show(E_12_Delete, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
break;
default:
break;
}
}
//1 - 200 公共实用类使用的错误消息编号
public static int E_1_CreateObjFailed_Code = 1;
public static int E_2_CreateConnectStringFailed_Code = 2;
public static int E_3_ConnectDBFailed_Code = 3;
public static int E_4_VerifyUserFailed_Code = 4;
public static int E_5_PwdNotMatch_Code = 5;
public static int E_6_OldPwdError_Code = 6;
public static int E_7_ExecStoredProcFailed_Code = 7;
public static int E_8_DBUnknownError_Code = 8;
public static int E_9_Select_Code = 9;
public static int E_10_Insert_Code = 10;
public static int E_11_Update_Code = 11;
public static int E_12_Delete_Code = 12;
private string E_1_CreateObjFailed = "创建对象失败!";
private string E_2_CreateConnectStringFailed = "生成连接字符串失败!";
private string E_3_ConnectDBFailed = "连接数据库失败!";
private string E_4_VerifyUserFailed = "用户验证失败!原因可能是:\n " +
"(1) 用户名密码组合不合法。\n (2) 用户无访问子系统的权限。\n (3) 用户没有从限定的IP登录。\n" +
" (4) 不允许从你的工作站登录该子系统。";
private string E_5_PwdNotMatch = "新密码与确认密码不匹配,请重新输入!";
private string E_6_OldPwdError = "旧密码错误!";
private string E_7_ExecStoredProcFailed = "执行存储过程失败!";
private string E_8_DBUnknownError = "发生了数据库未知错误!";
private string E_9_Select = "发生了数据表查询错误!";
private string E_10_Insert = "发生了数据表插入错误!";
private string E_11_Update = "发生了数据表更改错误!";
private string E_12_Delete = "发生了数据表删除错误!";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -