public int Insert(int siteId, int left, int right, int moduleID, string name, string tag, string icon, string pagetitle, string keywords, string description, string location, int orderIndex ) { base.ExecuteNonQuery( SqlQueryHelper.Create(SP.Category_Insert, new object[, ] { { "@siteid", siteId }, { "@lft", left }, { "@rgt", right }, { "@moduleId", moduleID }, { "@name", name }, { "@tag", tag }, { "@icon", icon }, { "@pagetitle", pagetitle }, { "@keywords", keywords }, { "@description", description }, { "@orderindex", orderIndex }, { "@location", location } }) ); return(int.Parse(base.ExecuteScalar(SqlQueryHelper.Create( "SELECT MAX(id) FROM $PREFIX_categories WHERE siteid=@siteId", new object[, ] { { "@siteid", siteId } })).ToString())); }
/// <summary> /// 删除栏目包含子栏目 /// </summary> /// <param name="id"></param> /// <returns></returns> public bool DeleteSelfAndChildCategoy(int siteId, int lft, int rgt) { base.ExecuteNonQuery( SqlQueryHelper.Create(SP.Category_DeleteByLft, new object[, ] { { "@siteId", siteId }, { "@lft", lft }, { "@rgt", rgt } })); return(true); }
public void UpdateInsertLftRgt(int siteId, int left) { object[,] pa = new object[, ] { { "@siteId", siteId }, { "@lft", left } }; base.ExecuteNonQuery( SqlQueryHelper.Create(SP.Category_UpdateInsertLeft, pa), SqlQueryHelper.Create(SP.Category_UpdateInsertRight, pa) ); }
public int GetMaxRight(int siteId) { object obj = base.ExecuteScalar( SqlQueryHelper.Create(SP.Category_GetMaxRight, new object[, ] { { "@siteId", siteId } } )); if (obj == null) { return(1); } return(int.Parse(obj.ToString())); }
/// <summary> /// 更新栏目 /// </summary> public bool Update(int id, int siteId, int moduleID, string name, string tag, string icon, string pagetitle, string keywords, string description, string location, int orderIndex) { return(base.ExecuteNonQuery( SqlQueryHelper.Create(SP.Category_Update, new object[, ] { { "@siteId", siteId }, { "@moduleId", moduleID }, { "@name", name }, { "@tag", tag }, { "@icon", icon }, { "@pagetitle", pagetitle }, { "@keywords", keywords }, { "@description", description }, { "@location", location }, { "@orderindex", orderIndex }, { "@id", id } })) == 1); }