本文整理汇总了C#中JumboTCMS.DAL.Common.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# Common.Delete方法的具体用法?C# Common.Delete怎么用?C# Common.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JumboTCMS.DAL.Common
的用法示例。
在下文中一共展示了Common.Delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteLogs
/// <summary>
/// 清空管理日志
/// </summary>
public void DeleteLogs()
{
using (DbOperHandler _doh = new Common().Doh())
{
_doh.Reset();
_doh.ConditionExpress = "1=1";
_doh.Delete("jcms_normal_adminlogs");
}
}
示例2: DeleteByID
/// <summary>
/// 删除一条数据
/// </summary>
public bool DeleteByID(string _id)
{
using (DbOperHandler _doh = new Common().Doh())
{
_doh.Reset();
_doh.ConditionExpress = "[email protected]";
_doh.AddConditionParameter("@id", _id);
int _del = _doh.Delete("jcms_normal_page");
return (_del == 1);
}
}
示例3: DeleteByFriendID
/// <summary>
/// 通过对方ID删除好友,如果不存在返回false
/// </summary>
/// <param name="_userid">发起方id</param>
/// <param name="_username">发起方name</param>
/// <param name="_friendid">自增长id</param>
/// <returns></returns>
public bool DeleteByFriendID(string _userid, string _username, string _friendid)
{
_username = _username == "" ? "user(id:" + _userid + ")" : _username;
using (DbOperHandler _doh = new Common().Doh())
{
_doh.Reset();
_doh.ConditionExpress = "[email protected] and [email protected]";
_doh.AddConditionParameter("@friendid", _friendid);
_doh.AddConditionParameter("@userid", _userid);
int _del = _doh.Delete("jcms_normal_user_friends");
if (_del == 1)
new JumboTCMS.DAL.Normal_UserNoticeDAL().SendNotite("解除好友", "<a href=\"javascript:void(0);\" onclick=\"ShowUserPage(" + _userid + ");\">" + _username + "</a> 和你解除了好友关系", _friendid, "friend");
return (_del == 1);
}
}
示例4: DeleteByID
/// <summary>
/// 删除一个插件
/// </summary>
/// <param name="_id"></param>
/// <param name="_err">返回错误信息</param>
/// <returns></returns>
public bool DeleteByID(string _id, ref string _err)
{
using (DbOperHandler _doh = new Common().Doh())
{
if (_id != "" && _id != "0")
{
_doh.Reset();
_doh.ConditionExpress = "[email protected]";
_doh.AddConditionParameter("@id", _id);
object[] _values = _doh.GetFields("jcms_normal_extends", "Name,Locked,Enabled,BaseTable");
string eName = _values[0].ToString();
string eLocked = _values[1].ToString();
string eEnabled = _values[2].ToString();
string _delTables = _values[3].ToString();
if (eLocked == "1")
{
_err = "锁定的插件不可删";
return false;
}
if (eEnabled == "1")
{
_err = "先把插件禁用再卸载";
return false;
}
if (_delTables.Trim().Length > 0)//需要删除插件表
{
string[] _delTable = _delTables.Split(',');
for (int i = 0; i < _delTable.Length; i++)
{
_doh.Reset();
_doh.DropTable(_delTable[i]);
}
}
//删除插件整个目录
JumboTCMS.Utils.DirFile.DeleteDir(site.Dir + "extends/" + eName + "/");
_doh.Reset();
_doh.ConditionExpress = "[email protected]";
_doh.AddConditionParameter("@id", _id);
_doh.Delete("jcms_normal_extends");
}
else
{
_err = "参数错误";
return false;
}
return true;
}
}