📄 systembussiness.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// 关于系统设置的业务层操作
/// </summary>
public class SystemBussiness
{
BBSTableTableAdapters.SystemSettingTableAdapter sysTable;
public SystemBussiness()
{
sysTable = new BBSTableTableAdapters.SystemSettingTableAdapter();
}
/// <summary>
/// 初始化系统(即将所有信息删除!)
/// </summary>
public void Initialize()
{
sysTable.Initialize();
}
/// <summary>
/// 根据Key获取Value
/// </summary>
/// <returns>若有记录则返回true;否则返回false</returns>
public bool GetValueByKey(ref SystemEntity sys)
{
DataTable sysValue = sysTable.GetSystemValueByKey(sys.SystemKey);
if (sysValue.Rows.Count==0)
return false;
else
{
sys.SystemValue = sysValue.Rows[0][0].ToString();
return true;
}
}
/// <summary>
/// 根据Key设置Value
/// </summary>
/// <returns>Key和Value是否都赋值</returns>
public bool SetValueByKey(SystemEntity sys)
{
if ((sys.SystemKey == null) || (sys.SystemValue == null))
return false;
else
{
sysTable.SetSystemValueByKey(sys.SystemKey, sys.SystemValue);
return true;
}
}
/// <summary>
/// 添加Key和Value
/// </summary>
/// <returns>Key和Value是否都赋值</returns>
public bool AddValueByKey(SystemEntity sys)
{
if ((sys.SystemKey == null) || (sys.SystemValue == null))
return false;
else
{
sysTable.AddSystemValue(sys.SystemKey, sys.SystemValue);
return true;
}
}
/// <summary>
/// 删除所有系统设置
/// </summary>
public void DeleteAllSetting()
{
sysTable.DeleteAllSetting();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -