示例#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);
     }
 }
示例#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);
     }
 }
示例#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);
     }
 }
示例#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);
         }
     }
 }