private void SaveRelatedPageLinks() { BPRelatedPageLinks bpRelatedPageLinks = new BPRelatedPageLinks(); BEPages ds = bpRelatedPageLinks.SelectByOriginPageTypeSpecificIDAndOriginPageTypeID(StoryID, PageTypeID); BEPages.tbl_RelatedPageLinksRow relatedPageLinksRow; foreach (BEPages.tbl_RelatedPageLinksRow row in ds.tbl_RelatedPageLinks) row.Delete(); ArrayList selectedIDs = new ArrayList(); if (ddlAdoptionPages.SelectedValue != "0") selectedIDs.Add(Convert.ToInt32(ddlAdoptionPages.SelectedValue)); if (ddlRescueStoryPages.SelectedValue != "" && ddlRescueStoryPages.SelectedValue != "0") selectedIDs.Add(Convert.ToInt32(ddlRescueStoryPages.SelectedValue)); if (ddlLookAtUsNowPages.SelectedValue != "" && ddlLookAtUsNowPages.SelectedValue != "0") selectedIDs.Add(Convert.ToInt32(ddlLookAtUsNowPages.SelectedValue)); foreach (int selectedID in selectedIDs) { relatedPageLinksRow = ds.tbl_RelatedPageLinks.Newtbl_RelatedPageLinksRow(); relatedPageLinksRow.OriginPageTypeSpecificID = StoryID; relatedPageLinksRow.OriginPageTypeID = PageTypeID; relatedPageLinksRow.LinkedPageID = selectedID; ds.tbl_RelatedPageLinks.Addtbl_RelatedPageLinksRow(relatedPageLinksRow); } bpRelatedPageLinks.Update(ds); }
private void DeleteRelatedPageLinks() { BPRelatedPageLinks bpRelatedPageLinks = new BPRelatedPageLinks(); BEPages ds = bpRelatedPageLinks.SelectByOriginPageTypeSpecificIDAndOriginPageTypeID(StoryID, PageTypeID); ds.Merge(bpRelatedPageLinks.SelectLinkedPagesByPageTypeSpecificIDAndPageTypeID(StoryID, PageTypeID)); foreach (BEPages.tbl_RelatedPageLinksRow row in ds.tbl_RelatedPageLinks) row.Delete(); bpRelatedPageLinks.Update(ds); }
private void SaveRelatedPageLinks() { BPRelatedPageLinks bpRelatedPageLinks = new BPRelatedPageLinks(); BEPages ds = bpRelatedPageLinks.SelectByOriginPageTypeSpecificIDAndOriginPageTypeID(AnimalID, PageTypeID); BEPages.tbl_RelatedPageLinksRow relatedPageLinksRow; foreach (BEPages.tbl_RelatedPageLinksRow row in ds.tbl_RelatedPageLinks) row.Delete(); if (ddlRescueStoryPages.SelectedValue != "" && ddlRescueStoryPages.SelectedValue != "0") { relatedPageLinksRow = ds.tbl_RelatedPageLinks.Newtbl_RelatedPageLinksRow(); relatedPageLinksRow.OriginPageTypeSpecificID = AnimalID; relatedPageLinksRow.OriginPageTypeID = PageTypeID; relatedPageLinksRow.LinkedPageID = Convert.ToInt32(ddlRescueStoryPages.SelectedValue); ds.tbl_RelatedPageLinks.Addtbl_RelatedPageLinksRow(relatedPageLinksRow); } bpRelatedPageLinks.Update(ds); }