示例#1
0
 public void CreatePerson(Person person)
 {
     using (var db = new EntityUppgiftContext())
     {
         db.Person.Add(person);
         db.SaveChanges();
     }
 }
 public void CreateInventory(Inventory inventory)
 {
     using (var db = new EntityUppgiftContext())
     {
         db.Inventory.Add(inventory);
         db.SaveChanges();
     }
 }
示例#3
0
 public Person GetPersonById(int id)
 {
     using (var db = new EntityUppgiftContext())
     {
         var person = db.Person.Find(id);
         return(person);
     }
 }
示例#4
0
 public void CreateDepartment(Department department)
 {
     using (var db = new EntityUppgiftContext())
     {
         db.Department.Add(department);
         db.SaveChanges();
     }
 }
 public Inventory GetInventoryById(int id)
 {
     using (var db = new EntityUppgiftContext())
     {
         var inventory = db.Inventory.Find(id);
         return(inventory);
     }
 }
示例#6
0
 public Department GetDepartmentById(int id)
 {
     using (var db = new EntityUppgiftContext())
     {
         var department = db.Department.Find(id);
         return(department);
     }
 }
 public void CreatePerson(Product product)
 {
     using (var db = new EntityUppgiftContext())
     {
         db.Product.Add(product);
         db.SaveChanges();
     }
 }
 public Product GetProductById(int id)
 {
     using (var db = new EntityUppgiftContext())
     {
         var product = db.Product.Find(id);
         return(product);
     }
 }
 public void CreateCampaign(Campaign campaign)
 {
     using (var db = new EntityUppgiftContext())
     {
         db.Campaign.Add(campaign);
         db.SaveChanges();
     }
 }
 public Campaign GetCampaignById(int id)
 {
     using (var db = new EntityUppgiftContext())
     {
         var campaign = db.Campaign.Find(id);
         return(campaign);
     }
 }