/// <summary> /// 添加收藏 /// </summary> /// <param name="userFid"></param> /// <param name="roleFid"></param> /// <param name="menuFid"></param> /// <returns></returns> public bool AddFavorite(Guid userFid, Guid roleFid, Guid menuFid) { int cnt = dal.GetCounts("[USER_FID] = N'" + userFid + "' and [ROLE_FID] = N'" + roleFid + "' and [MENU_FID] = N'" + menuFid + "'"); if (cnt > 0) { throw new Exception("MC:1x00000015");///TODO:该页面已添加收藏 } UserFavoritesInfo info = new UserFavoritesInfo(); info.Fid = Guid.NewGuid(); info.MenuFid = menuFid; info.UserFid = userFid; info.RoleFid = roleFid; info.CreateDate = DateTime.Now; info.CreateUser = string.Empty; info.ValidFlag = true; if (dal.Add(info) == 0) { throw new Exception("MC:1x00000015");///TODO:添加收藏失败 } return(true); }
/// <summary> /// InsertInfo /// </summary> /// <param name="info"></param> /// <returns></returns> public long InsertInfo(UserFavoritesInfo info) { return(dal.Add(info)); }