protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (!String.IsNullOrEmpty(Url)) { Profile profile = Utility.GetProfile(); FavoriteLinkCollection lc = Utility.Domain.GetFavoriteLinkCollectionByUrl(profile.ProfileID, Url); // set the controls if a Favorite Link match is found if (lc.Count > 0) { updateRow.Visible = true; Chapter07.Domain.FavoriteLink lm = lc[0]; hdnOldFavoriteLinkId.Value = lc[0].ID.ToString(); tbTitle.Text = lm.Title; tbTags.Text = lm.Tags; tbNote.Text = lm.Note; if (lm.Rating > 0) { rblRating.SelectedValue = lm.Rating.ToString(); } cbKeeper.Checked = lm.Keeper; } } List <BaseValidator> validators = Utility.GetValidators(Controls); foreach (BaseValidator validator in validators) { validator.ValidationGroup = ValidationGroup; } ValidationSummary1.ValidationGroup = ValidationGroup; } }
private void AddToFavoriteLinkCollection(FavoriteLinkCollection collection, IDataReader dr) { while (dr.Read()) { FavoriteLink fl = new FavoriteLink(dr); collection.Add(fl); } }
private void AddToFavoriteLinkCollection(FavoriteLinkCollection collection, DataSet ds) { if (ds.Tables.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { FavoriteLink fl = new FavoriteLink(row); collection.Add(fl); } } }
public long SaveFavoriteLink(long profileId, string url, string title, long oldFavoriteLinkId) { // load existing FavoriteLink bool keeper = true; int rating = 1; string tags = String.Empty; string note = String.Empty; FavoriteLinkCollection lc = GetFavoriteLinkCollectionByUrl(profileId, url); if (lc.Count > 0) { FavoriteLink fl = lc[0]; keeper = fl.Keeper; rating = fl.Rating; tags = fl.Tags; note = fl.Note; } return(SaveFavoriteLink(profileId, url, title, keeper, rating, note, tags, DefaultDate, DefaultDate, oldFavoriteLinkId)); }