private void SaveLandingPageInfo() { bool isNew = false; BPLandingPages bp = new BPLandingPages(); BELandingPages ds = new BELandingPages(); BELandingPages.tbl_LandingPagesRow page = null; int tempImageID1 = 0; if (LandingPageID > 0) { ds = bp.SelectLandingPageByID(LandingPageID); page = ds.tbl_LandingPages.FindByLandingPageID(LandingPageID); if (!page.IsLandingPageImageID1Null()) tempImageID1 = page.LandingPageImageID1; } if (page == null) { page = ds.tbl_LandingPages.Newtbl_LandingPagesRow(); isNew = true; } if (txtHeading.Text.Trim() != "") page.LandingPageHeading = txtHeading.Text.Trim(); else page.SetLandingPageHeadingNull(); if (edtBody1.Text.Trim() != "" || edtBody1.Text.Trim() != "<p> </p>") page.LandingPageDescription = edtBody1.Text.Trim(); else page.SetLandingPageDescriptionNull(); //image 1 if (imgImage1.SelectedImage > 0) { page.LandingPageImageID1 = imgImage1.SelectedImage; if (ddlImageAlignment1.SelectedValue == "Left" || ddlImageAlignment1.SelectedValue == "Right" || ddlImageAlignment1.SelectedValue == "Top" || ddlImageAlignment1.SelectedValue == "Bottom") page.LandingPageImageAlignment1 = Convert.ToInt32(Enum.Parse(typeof(ImageAlignment), ddlImageAlignment1.SelectedValue)); else page.SetLandingPageImageAlignment1Null(); } else { page.SetLandingPageImageID1Null(); page.SetLandingPageImageAlignment1Null(); } page.DateModified = DateTime.Now; page.ModifiedByAdminID = PageUserID; if (isNew) { page.LandingPageTypeID = SubTypeID; page.LandingPageTitle = SubTypeName; page.LandingPageActive = true; page.DateCreated = DateTime.Now; ds.tbl_LandingPages.Addtbl_LandingPagesRow(page); } bp.Update(ds); if (!page.IsLandingPageImageID1Null() && (page.LandingPageImageID1 != tempImageID1)) ResizePageImages(page.LandingPageImageID1); }
private void BindLandingPageInfo() { BPLandingPages bp = new BPLandingPages(); BELandingPages ds = new BELandingPages(); ds = bp.SelectByLandingPageTypeID(SubTypeID); lblTitle.Text = "Edit " + SubTypeName; if (ds.tbl_LandingPages.Count > 0) { BELandingPages.tbl_LandingPagesRow page = ds.tbl_LandingPages[0]; LandingPageID = page.LandingPageID; txtHeading.Text = page.IsLandingPageHeadingNull() ? "" : page.LandingPageHeading; if (!page.IsLandingPageDescriptionNull()) edtBody1.Text = page.LandingPageDescription; else edtBody1.Text = ""; if (!page.IsLandingPageImageID1Null()) imgImage1.SelectedImage = page.LandingPageImageID1; if (!page.IsLandingPageImageAlignment1Null()) ddlImageAlignment1.SelectedValue = Enum.Parse(typeof(ImageAlignment), page.LandingPageImageAlignment1.ToString()).ToString(); } else edtBody1.Text = ""; }