Beispiel #1
0
 public LandingPage Get(int id = 0)
 {
     CurtDevDataContext db = new CurtDevDataContext();
     LandingPage landingPage = new LandingPage();
     try {
         landingPage = db.LandingPages.Where(x => x.id.Equals(id)).First();
     } catch { }
     return landingPage;
 }
 partial void DeleteLandingPage(LandingPage instance);
 partial void UpdateLandingPage(LandingPage instance);
 partial void InsertLandingPage(LandingPage instance);
		private void detach_LandingPages(LandingPage entity)
		{
			this.SendPropertyChanging();
			entity.Website = null;
		}
Beispiel #6
0
        public LandingPage Save(int id, string name, int websiteID, DateTime startDate, DateTime endDate, string url = "", string content = null, string linkClasses = null, bool newWindow = false, string conversionID = null, string conversionLabel = null, string menuPosition = "top")
        {
            CurtDevDataContext db = new CurtDevDataContext();
            LandingPage landingPage = new LandingPage();
            try {
                if (id == 0) {
                    landingPage = new LandingPage {
                        name = name,
                        websiteID = websiteID,
                        startDate = startDate,
                        endDate = endDate,
                        url = url.Trim(),
                        pageContent = content,
                        linkClasses = (linkClasses == null) ? linkClasses : linkClasses.Trim(),
                        newWindow = newWindow,
                        conversionID = conversionID,
                        conversionLabel = conversionLabel,
                        menuPosition = menuPosition
                    };
                    db.LandingPages.InsertOnSubmit(landingPage);
                } else {
                    landingPage = db.LandingPages.Where(x => x.id.Equals(id)).First();
                    landingPage.name = name;
                    landingPage.websiteID = websiteID;
                    landingPage.startDate = startDate;
                    landingPage.endDate = endDate;
                    landingPage.url = url.Trim();
                    landingPage.pageContent = content;
                    landingPage.linkClasses = (linkClasses == null) ? linkClasses : linkClasses.Trim();
                    landingPage.newWindow = newWindow;
                    landingPage.conversionID = conversionID;
                    landingPage.conversionLabel = conversionLabel;
                    landingPage.menuPosition = menuPosition;
                }
                db.SubmitChanges();
            } catch {}

            return landingPage;
        }