Beispiel #1
0
 public void AddCompany(Company company)
 {
     using (AMLEntities db = new AMLEntities())
     {
         db.Company.Add(company);
         db.SaveChanges();
         Console.WriteLine("New company added:" + company.Name);
     }
 }
Beispiel #2
0
 public void AddShareholder(Shareholder shareholder)
 {
     using (AMLEntities db = new AMLEntities())
     {
         db.Shareholder.Add(shareholder);
         db.SaveChanges();
         Console.WriteLine("New shareholder added:" + shareholder.FirstName);
     }
 }
Beispiel #3
0
 public Company GetCompanyByName(string fname)
 {
     using (AMLEntities db = new AMLEntities())
     {
         var company = (from s in db.Company
                        where s.Name == fname
                        select s).FirstOrDefault <Company>();
         return(company);
     }
 }
Beispiel #4
0
 public void GetAllCompanies()
 {
     using (AMLEntities db = new AMLEntities())
     {
         var company_list = db.Company.ToList();
         foreach (var company in company_list)
         {
             Console.WriteLine(company.Name + " " + company.CUI);
         }
     }
 }