public Company GetCompany(int idCompany) { Company com = new Company(); using (SUPERPEntities sup = new SUPERPEntities(false)) { com = sup.Companies.Where(o => o.id == idCompany).FirstOrDefault(); } return com; }
public int CreateCompany(Company compa) { using (SUPERPEntities sup = new SUPERPEntities(false)) { sup.Companies.Add(compa); sup.SaveChanges(); Company cont = sup.Companies.OrderByDescending(p => p.id).First(); return (int)cont.id; } }
public void TestCreateCompany() { Company comp = new Company(); comp.name = "testCreate"; comp.siret = "3333"; comp.city = "Bordeaux"; comp.address = "lol"; comp.postalcode = 33300; Assert.IsTrue(clientService.CreateCompany(comp) > 0); }
public bool EditCompany(Company company) { using (SUPERPEntities sup = new SUPERPEntities(false)) { Company contactBdd = sup.Companies.Where(p => p.id == company.id).FirstOrDefault(); if (contactBdd != null) { sup.Entry(contactBdd).CurrentValues.SetValues(company); sup.SaveChanges(); } } return true; }
public void TestDeleteCompany() { Company comp = new Company(); comp.name = "testsupprComp"; comp.siret = "3333"; comp.city = "Bordeaux1"; comp.address = "Saint Louis RPZ"; comp.postalcode = 33300; comp.id = 2; int id = clientService.CreateCompany(comp); Assert.IsTrue(clientService.DeleteCompany(id)); }
public void TestGetCompany() { Company comp = new Company(); comp.name = "testGet"; comp.siret = "3333"; comp.city = "Bordeaux"; comp.address = "lol"; comp.postalcode = 33300; int newCompanyId = clientService.CreateCompany(comp); Assert.IsTrue(newCompanyId > 0); Company compget = new Company(); compget = clientService.GetCompany(newCompanyId); Assert.AreEqual("testGet", comp.name); }
public bool EditCompany(Company company) { return clientBLL.EditCompany(company); }
public int CreateCompany(Company company) { return clientBLL.CreateCompany(company); }
public bool EditCompany(Company company) { return companyDAL.EditCompany(company); }
public int CreateCompany(Company company) { return companyDAL.CreateCompany(company); }