public void DeleteCompany(CompanyContract company) { DataClasses1DataContext db = new DataClasses1DataContext(); CompanyTable deleteCompany = db.CompanyTable.Where(e => e.company==company.company).Single(); db.CompanyTable.DeleteOnSubmit(deleteCompany); db.SubmitChanges(); }
public List<CompanyTable> GridPortlet() { DataClasses1DataContext db = new DataClasses1DataContext(); var listCompany = db.CompanyTable.ToList(); return listCompany; }
public void UpdateCompany(CompanyContract company) { DataClasses1DataContext db = new DataClasses1DataContext(); CompanyTable Company = db.CompanyTable.Single(p => p.company == company.company); Company.company = company.company; Company.change = company.change; Company.pctChange = company.pctChange; db.SubmitChanges(); }
public void AddCompany(CompanyContract company) { DataClasses1DataContext db = new DataClasses1DataContext(); CompanyTable Company = new CompanyTable { company = company.company, change = company.change, pctChange = company.pctChange }; db.CompanyTable.InsertOnSubmit(Company); db.SubmitChanges(); }