public string UpdateFriendSetting(FriendSetting newFriendSetting) { foreach (var friendSetting in FriendSettings) { if (friendSetting.GetStatus() == FriendSettingStatus.AGREE) { if (friendSetting.GetId().Equals(newFriendSetting.GetId())) { friendSetting.SetNote(newFriendSetting.GetNote()); friendSetting.SetDisablePost(newFriendSetting.IsDisablePost()); return(null); } } } return("Can't find the friend: " + newFriendSetting.GetNote() + "[" + newFriendSetting.GetId() + "]"); }
public string AddNewFriendSetting(FriendSetting newFriend) { if (newFriend != null) { if (GetFriendSettingFromAgreeById(newFriend.GetId()) != null) { return("Friend: " + newFriend.GetNote() + "[" + newFriend.GetId() + "] is not a new friend."); } else { FriendSettings.Add(newFriend); return(null); } } return("Input null."); }
public void Update(FriendSetting friendSetting) { Note = friendSetting.GetNote(); DisablePost = friendSetting.IsDisablePost(); Status = friendSetting.GetStatus(); }