public void Update(DS_ShopTheme ShopTheme) { using (var ct = new DS_ShopThemeDataContext(DbHelperSQL.Connection)) { ct.DS_ShopTheme.Attach(ShopTheme, true); ct.SubmitChanges(); } }
public void Add(DS_ShopTheme ShopTheme) { using (var ct = new DS_ShopThemeDataContext(DbHelperSQL.Connection)) { ct.DS_ShopTheme.InsertOnSubmit(ShopTheme); ct.SubmitChanges(); } }
public void Delete(int ID) { using (var ct = new DS_ShopThemeDataContext(DbHelperSQL.Connection)) { DS_ShopTheme st = ct.DS_ShopTheme.Single(a => a.ID == ID); ct.DS_ShopTheme.DeleteOnSubmit(st); ct.SubmitChanges(); var path = HttpContext.Current.Server.MapPath(ThemePath(ID)); if (Directory.Exists(path)) { Directory.Delete(path, true); } } }