/// <summary> /// Connects to the interface and attempts to apply the query. /// See the comments of the implemented method named BookmarkedByUser in ApiServiceDonors for more /// information. /// Save the action in db using Util.cs /// </summary> /// <param name="idUser">User Id passed by reference to provide the param to know who is the user to search by id in db</param> /// <returns>A list of Bookmarked donors by user</returns> public static List <BookmarkedDonor> BookmarkedByUser(string idUser) { ApiServiceDonors x = new ApiServiceDonors(); Models.Util.SaveAction(Util.Actions.GetBookmarkedDonors.ToString()); return(x.BookmarkedByUser(idUser)); }
/// <summary> /// Save donors in db by userId /// Save the user actions /// See the comments of the implemented method named BookmarkDonor in ApiServiceDonors for more /// information. /// </summary> /// <param name="bookmark">Recive an BookmarkedDonor object</param> /// <returns>If the transaction has been succeced or not</returns> public static bool BookmarkDonor(BookmarkedDonor bookmark) { ApiServiceDonors x = new ApiServiceDonors(); var list=x.BookmarkedByUser(bookmark.User_ID.ToString()); var verify=list.Where(r=> r.Donor_ID ==bookmark.Donor_ID); if (verify.Count() == 0) { var donor = x.BookmarkDonor(bookmark); Models.Util.SaveAction(Util.Actions.BookMarked + ":" + bookmark.Donor_ID + " status:" + donor.ToString() + ""); return donor; } return false; }
/// <summary> /// Save donors in db by userId /// Save the user actions /// See the comments of the implemented method named BookmarkDonor in ApiServiceDonors for more /// information. /// </summary> /// <param name="bookmark">Recive an BookmarkedDonor object</param> /// <returns>If the transaction has been succeced or not</returns> public static bool BookmarkDonor(BookmarkedDonor bookmark) { ApiServiceDonors x = new ApiServiceDonors(); var list = x.BookmarkedByUser(bookmark.User_ID.ToString()); var verify = list.Where(r => r.Donor_ID == bookmark.Donor_ID); if (verify.Count() == 0) { var donor = x.BookmarkDonor(bookmark); Models.Util.SaveAction(Util.Actions.BookMarked + ":" + bookmark.Donor_ID + " status:" + donor.ToString() + ""); return(donor); } return(false); }
/// <summary> /// Connects to the interface and attempts to apply the query. /// See the comments of the implemented method named BookmarkedByUser in ApiServiceDonors for more /// information. /// Save the action in db using Util.cs /// </summary> /// <param name="idUser">User Id passed by reference to provide the param to know who is the user to search by id in db</param> /// <returns>A list of Bookmarked donors by user</returns> public static List<BookmarkedDonor> BookmarkedByUser(string idUser) { ApiServiceDonors x = new ApiServiceDonors(); Models.Util.SaveAction(Util.Actions.GetBookmarkedDonors.ToString()); return x.BookmarkedByUser(idUser); }