Exemple #1
0
 public static void AddConComp(int Company, ConComp comp)
 {
     using (var dbContext = new DataContext())
     {
         dbContext.Companies.Where(x => x.CompanyId == Company).Include(x => x.ConComps).First().ConComps.Add(comp);
         dbContext.SaveChanges();
     }
 }
Exemple #2
0
 public static void RemoveConComp(ConComp conComp)
 {
     using (var dbContext = new DataContext())
     {
         dbContext.ContactCompanies.Remove(conComp);
         dbContext.SaveChanges();
     }
 }
Exemple #3
0
 public static void AddConComp(int Company, string conName, string sec, string notes)
 {
     using (var dbContext = new DataContext())
     {
         ConComp comp = new ConComp()
         {
             CompanyName = conName,
             Sector      = sec,
             StaffNotes  = notes
         };
         dbContext.Companies.Where(x => x.CompanyId == Company).Include(x => x.ConComps).First().ConComps.Add(comp);
         dbContext.SaveChanges();
     }
 }