Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 partial void DeleteLandingPage(LandingPage instance);
Ejemplo n.º 3
0
 partial void UpdateLandingPage(LandingPage instance);
Ejemplo n.º 4
0
 partial void InsertLandingPage(LandingPage instance);
Ejemplo n.º 5
0
		private void detach_LandingPages(LandingPage entity)
		{
			this.SendPropertyChanging();
			entity.Website = null;
		}
Ejemplo n.º 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;
        }