public void DeleteCity(CityModel City) { if (City == null) { throw new ArgumentNullException(); } using (AppTourEntities data = new AppTourEntities()) { CITY current = data.CITY.Where(x => x.ID == City.Id).SingleOrDefault(); if (current != null) { try { data.DeleteObject(current); data.SaveChanges(); } catch (UpdateException upx) { throw new UpdateException(upx.InnerException.Message); } catch (Exception e) { if (e.InnerException != null) { throw new Exception(e.InnerException.Message); } throw; } } } }
public void DeleteEnterprise(LanguageModel language) { if (language == null) { throw new ArgumentNullException("language"); } using (AppTourEntities data = new AppTourEntities()) { LANGUAGE current = data.LANGUAGE.Where(p => p.ID == language.Id).SingleOrDefault(); if (current != null) { try { data.DeleteObject(current); data.SaveChanges(); } catch (UpdateException ex) { if (ex.InnerException != null) { throw new UpdateException(ex.InnerException.Message); } throw; } catch (Exception) { throw; } } } }
public void DeleteApp(AppModel App) { if (App == null) { throw new ArgumentNullException(); } using (AppTourEntities data = new AppTourEntities()) { APP current = data.APP.Where(p => p.ID == App.Id).SingleOrDefault(); if (current != null) { try { data.DeleteObject(current); data.SaveChanges(); } catch (Exception e) { if (e.InnerException != null) { throw new Exception(e.InnerException.Message); } throw; } } } }
public void DeleteEnterprise(EnterpriseModel enterprise) { if (enterprise == null) { throw new ArgumentNullException(); } using (AppTourEntities data = new AppTourEntities()) { ENTERPRISE current = data.ENTERPRISE.Where(p => p.ID == enterprise.Id).SingleOrDefault(); if (current != null) { try { data.DeleteObject(current); data.SaveChanges(); } catch (UpdateException ex) { if (ex.InnerException != null) { throw new UpdateException(ex.InnerException.Message); } throw; } catch (Exception e) { if (e.InnerException != null) { throw new Exception(e.InnerException.Message); } throw; } } } }
public void DeleteCountry(CountryModel Country) { if (Country == null) { throw new ArgumentNullException(); } using (AppTourEntities data = new AppTourEntities()) { COUNTRY current = data.COUNTRY.Where(x => x.ID == Country.Id).SingleOrDefault(); if (current != null) { try { data.DeleteObject(current); data.SaveChanges(); } catch (Exception e) { if (e.InnerException != null) { throw new Exception(e.InnerException.Message); } throw; } } } }
public void DeleteUser(UserModel user) { if (user == null) { throw new ArgumentNullException(); } using (AppTourEntities data = new AppTourEntities()) { USER current = data.USER.Where(p => p.ID == user.Id).SingleOrDefault(); if (current != null) { try { data.DeleteObject(current); data.SaveChanges(); } catch (Exception e) { if (e.InnerException != null) { throw new Exception(e.InnerException.Message); } throw; } } } }
public void DeleteTopic(TopicModel topic) { if (topic == null) { throw new ArgumentNullException(); } using (AppTourEntities data = new AppTourEntities()) { TOPIC current = data.TOPIC.Where(p => p.ID == topic.Id).SingleOrDefault(); if (current != null) { try { data.DeleteObject(current); data.SaveChanges(); } catch (Exception e) { if (e.InnerException != null) { throw new Exception(e.InnerException.Message); } throw; } } } }