public BEHome SelectTopActiveWithROColumns() { BEHome ds = new BEHome(); DAHome da = new DAHome(); da.SelectTopActiveWithROColumns(ds.tbl_Home); return ds; }
public BEHome SelectAllInactive() { BEHome ds = new BEHome(); DAHome da = new DAHome(); da.SelectAllInactive(ds.tbl_Home); return ds; }
public BEHome SelectHomeByID(int HomeID) { BEHome ds = new BEHome(); DAHome da = new DAHome(); da.SelectByID(HomeID.ToString(), ds.tbl_Home); return ds; }
public void Update(BEHome ds) { DAHome da = new DAHome(); da.Update(ds.tbl_Home); }
private void SaveHomeInfo() { bool isNew = false; BPHome bp = new BPHome(); BEHome ds = new BEHome(); BEHome.tbl_HomeRow homeRow = null; int tempImageID1 = 0; if (HomeID > 0) { ds = bp.SelectHomeByID(HomeID); homeRow = ds.tbl_Home.FindByHomeID(HomeID); if (!homeRow.IsHomeImageIDNull()) tempImageID1 = homeRow.HomeImageID; } if (homeRow == null) { homeRow = ds.tbl_Home.Newtbl_HomeRow(); isNew = true; } homeRow.HomeTitle = txtHomeTitle.Text.Trim(); if (txtHomeTitleFR.Text.Trim() != "") homeRow.HomeTitleFR = txtHomeTitleFR.Text.Trim(); else homeRow.SetHomeTitleFRNull(); if (txtHomeText.Text.Trim() != "") homeRow.HomeText = txtHomeText.Text.Trim(); else homeRow.SetHomeTextNull(); if (txtHomeTextFR.Text.Trim() != "") homeRow.HomeTextFR = txtHomeTextFR.Text.Trim(); else homeRow.SetHomeTextFRNull(); if (imgHomeImage.SelectedImage > 0) homeRow.HomeImageID = imgHomeImage.SelectedImage; else homeRow.SetHomeImageIDNull(); homeRow.DateModified = DateTime.Now; homeRow.ModifiedByAdminID = Convert.ToInt32(PageUserID); if (isNew) { homeRow.HomeActive = true; homeRow.DateCreated = DateTime.Now; ds.tbl_Home.Addtbl_HomeRow(homeRow); } bp.Update(ds); HomeID = homeRow.HomeID; if (isNew) { //Add to main Pages table BPPages bpPages = new BPPages(); BEPages dsPages = new BEPages(); BEPages.tbl_PagesRow pageRow = dsPages.tbl_Pages.Newtbl_PagesRow(); pageRow.PageTypeID = PageTypeID; pageRow.PageTypeSpecificID = HomeID; dsPages.tbl_Pages.Addtbl_PagesRow(pageRow); bpPages.Update(dsPages); } SaveLinkInfo(isNew); //Resize images int[] selectedImageIDs = new int[1]; bool doResize = false; if (!homeRow.IsHomeImageIDNull() && (homeRow.HomeImageID != tempImageID1)) { selectedImageIDs[0] = homeRow.HomeImageID; doResize = true; } //if (!homeRow.IsLinkList2ImageIDNull() && (homeRow.LinkList2ImageID != tempImageID2)) //{ // selectedImageIDs[1] = imgLinkList2Image.SelectedImage; // doResize = true; //} if (doResize) ResizePageImages(selectedImageIDs); }