internal void Get() { Banner tmp = new Banner(); EcommercePlatformDataContext db = new EcommercePlatformDataContext(); tmp = db.Banners.Where(x => x.ID.Equals(this.ID)).FirstOrDefault<Banner>(); this.image = tmp.image; this.title = tmp.title; this.body = tmp.body; this.link = tmp.link; this.order = tmp.order; this.isVisible = tmp.isVisible; }
internal void Save() { EcommercePlatformDataContext db = new EcommercePlatformDataContext(); Banner tmp = db.Banners.Where(x => x.ID.Equals(this.ID)).FirstOrDefault<Banner>(); if (tmp == null) { tmp = new Banner(); } tmp.image = this.image; tmp.title = this.title; tmp.body = this.body; tmp.link = this.link; tmp.order = this.order; tmp.isVisible = this.isVisible; //tmp.OrganizeSort(); if (this.ID == 0) { db.Banners.InsertOnSubmit(tmp); } db.SubmitChanges(); this._ID = tmp.ID; }
partial void UpdateBanner(Banner instance);
partial void DeleteBanner(Banner instance);
partial void InsertBanner(Banner instance);