예제 #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();
 }
예제 #2
0
        public List<CompanyTable> GridPortlet()
        {
            DataClasses1DataContext db = new DataClasses1DataContext();
            var listCompany = db.CompanyTable.ToList();

            return listCompany;
        }
예제 #3
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();
        }
예제 #4
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();
 }