/// <summary> /// 添加栏目 /// </summary> /// <param name="permissionColumnName"></param> /// <param name="permissionColumnPreID"></param> /// <param name="orderNum"></param> /// <param name="websiteOwner"></param> /// <returns></returns> public bool AddColumn(string permissionColumnName, long permissionColumnPreID, int orderNum, string websiteOwner, long baseID = 0, int hide = 0) { PermissionColumn nPermissionColumn = new PermissionColumn(); nPermissionColumn.PermissionColumnID = Convert.ToInt64(GetGUID(TransacType.PermissionColumn)); nPermissionColumn.PermissionColumnName = permissionColumnName; nPermissionColumn.PermissionColumnPreID = permissionColumnPreID; nPermissionColumn.OrderNum = orderNum; if (string.IsNullOrWhiteSpace(websiteOwner)) { nPermissionColumn.WebsiteOwner = null; } else { nPermissionColumn.WebsiteOwner = websiteOwner; } nPermissionColumn.PermissionColumnBaseID = baseID; nPermissionColumn.IsHide = hide; return(Add(nPermissionColumn)); }
/// <summary> /// 编辑栏目 /// </summary> /// <param name="permissionColumnName"></param> /// <param name="permissionColumnPreID"></param> /// <param name="orderNum"></param> /// <param name="websiteOwner"></param> /// <returns></returns> public bool EditColumn(long permissionColumnID, string permissionColumnName, long permissionColumnPreID, int orderNum, string websiteOwner) { PermissionColumn nPermissionColumn = GetByKey <PermissionColumn>("PermissionColumnID", permissionColumnID.ToString()); if (nPermissionColumn == null) { throw new Exception("未找到该栏目"); } nPermissionColumn.PermissionColumnName = permissionColumnName; nPermissionColumn.PermissionColumnPreID = permissionColumnPreID; nPermissionColumn.OrderNum = orderNum; if (string.IsNullOrWhiteSpace(websiteOwner)) { nPermissionColumn.WebsiteOwner = null; } else { nPermissionColumn.WebsiteOwner = websiteOwner; } return(Update(nPermissionColumn)); }