110,536
社区成员
发帖
与我相关
我的任务
分享
//把以上数据表在程序中映射成的静态类,感觉这样很麻烦,有什么办法可能代替
/// <summary>
/// 用户权限
/// </summary>
public static class Permissions
{
public static class 人事
{
static string m_value = "02";
public static string Value
{
get { return 人事.m_value; }
set { 人事.m_value = value; }
}
public static class 基本资料
{
static string m_value = "02";
public static string Value
{
get { return 基本资料.m_value; }
set { 基本资料.m_value = value; }
}
public static class 分店设置
{
static string m_value = "02";
public static string Value
{
get { return m_value; }
set { m_value = value; }
}
}
}
public static class 员工管理
{
static string m_value = "0202";
public static string Value
{
get { return m_value; }
set { m_value = value; }
}
public static class 查询
{
static string m_value = "020201";
public static string Value
{
get { return m_value; }
set { m_value = value; }
}
}
public static class 新添
{
static string m_value = "020202";
public static string Value
{
get { return m_value; }
set { m_value = value; }
}
}
public static class 修改
{
static string m_value = "020203";
public static string Value
{
get { return m_value; }
set { m_value = value; }
}
}
public static class 删除
{
static string m_value = "020204";
public static string Value
{
get { return m_value; }
set { m_value = value; }
}
}
}
}
}
EmployeeEditForm addNewForm;
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
{
//客户程序的调用,也就是最终要达到的目的啊
if (Permissions.HasPermission(Permissions.人事.员工管理.新添.Value))
{
MessageBox.Show("你无权限", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
if (addNewForm == null || addNewForm.IsDisposed)
{
addNewForm = new EmployeeEditForm(update, OperationCategory.New);
addNewForm.Show();
}
else
{
addNewForm.Activate();
}
}