Esempio n. 1
0
 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();
 }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 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();
 }