/// <summary> /// /// </summary> /// <param name="parent"></param> /// <param name="menuType"></param> /// <returns></returns> public static List <int> GetAllChildIdByParent(int parent, EMenuType menuType) { return(SQLDataAccess.ExecuteReadColumn <int>( "[CMS].[sp_GetChildMenuItemByParent]", CommandType.StoredProcedure, "MenuItemID", new SqlParameter("@MenuType", menuType.ToString()), new SqlParameter("@ParentId", parent))); }
/// <summary> /// /// </summary> /// <param name="mItemId"></param> /// <param name="menuType"> </param> /// <returns></returns> public static IEnumerable <int> GetParentMenuItems(int mItemId, EMenuType menuType) { return(SQLDataAccess.ExecuteReadColumnIEnumerable <int>( "[CMS].[sp_GetParentMenuItemsByItemId]", CommandType.StoredProcedure, "MenuItemID", new SqlParameter("@MenuItemID", mItemId), new SqlParameter("@MenuType", menuType.ToString()))); }
/// <summary> /// /// </summary> /// <param name="mItem"></param> /// <param name="menuType"> </param> public static void UpdateMenuItem(AdvMenuItem mItem, EMenuType menuType) { SQLDataAccess.ExecuteNonQuery( "[CMS].[sp_UpdateMenuItemByItemId]", CommandType.StoredProcedure, new SqlParameter("@MenuType", menuType.ToString()), new SqlParameter("@MenuItemID", mItem.MenuItemID), new SqlParameter("@MenuItemParentID", mItem.MenuItemParentID == 0 ? DBNull.Value : (object)mItem.MenuItemParentID), new SqlParameter("@MenuItemName", mItem.MenuItemName), new SqlParameter("@MenuItemIcon", string.IsNullOrEmpty(mItem.MenuItemIcon) ? DBNull.Value : (object)mItem.MenuItemIcon), new SqlParameter("@MenuItemUrlPath", mItem.MenuItemUrlPath), new SqlParameter("@MenuItemUrlType", mItem.MenuItemUrlType), new SqlParameter("@SortOrder", mItem.SortOrder), new SqlParameter("@ShowMode", mItem.ShowMode), new SqlParameter("@Enabled", mItem.Enabled), new SqlParameter("@Blank", mItem.Blank)); }
/// <summary> /// /// </summary> /// <param name="mItem"></param> /// <param name="menuType"> </param> public static void UpdateMenuItem(AdvMenuItem mItem, EMenuType menuType) { SQLDataAccess.ExecuteNonQuery( "[CMS].[sp_UpdateMenuItemByItemId]", CommandType.StoredProcedure, new SqlParameter("@MenuType", menuType.ToString()), new SqlParameter("@MenuItemID", mItem.MenuItemID), new SqlParameter("@MenuItemParentID", mItem.MenuItemParentID == 0 ? DBNull.Value : (object)mItem.MenuItemParentID), new SqlParameter("@MenuItemName", mItem.MenuItemName), new SqlParameter("@MenuItemIcon", string.IsNullOrEmpty(mItem.MenuItemIcon) ? DBNull.Value : (object)mItem.MenuItemIcon), new SqlParameter("@MenuItemUrlPath", mItem.MenuItemUrlPath), new SqlParameter("@MenuItemUrlType", mItem.MenuItemUrlType), new SqlParameter("@SortOrder", mItem.SortOrder), new SqlParameter("@ShowMode", mItem.ShowMode), new SqlParameter("@Enabled", mItem.Enabled), new SqlParameter("@Blank", mItem.Blank), new SqlParameter("@NoFollow", mItem.NoFollow)); }
/// <summary> /// /// </summary> /// <param name="mItemId"></param> /// <param name="menuType"> </param> /// <returns></returns> public static IEnumerable<int> GetParentMenuItems(int mItemId, EMenuType menuType) { return SQLDataAccess.ExecuteReadColumnIEnumerable<int>( "[CMS].[sp_GetParentMenuItemsByItemId]", CommandType.StoredProcedure, "MenuItemID", new SqlParameter("@MenuItemID", mItemId), new SqlParameter("@MenuType", menuType.ToString())); }
/// <summary> /// /// </summary> /// <param name="parent"></param> /// <param name="menuType"></param> /// <returns></returns> public static List<int> GetAllChildIdByParent(int parent, EMenuType menuType) { return SQLDataAccess.ExecuteReadColumn<int>( "[CMS].[sp_GetChildMenuItemByParent]", CommandType.StoredProcedure, "MenuItemID", new SqlParameter("@MenuType", menuType.ToString()), new SqlParameter("@ParentId", parent)); }