Beispiel #1
0
 public void Insert(PurchaseOrder order)
 {
     try
     {
         _context.PurchaseOrder.Add(order);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Beispiel #2
0
 public void Insert(Supplier supplier)
 {
     try
     {
         _context.Supplier.Add(supplier);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Beispiel #3
0
 public void Insert(PositionName positionName)
 {
     try
     {
         _context.PositionName.Add(positionName);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Beispiel #4
0
 public void Insert(Category category)
 {
     try
     {
         _context.Category.Add(category);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Beispiel #5
0
 public void Insert(Client client)
 {
     try
     {
         _context.Client.Add(client);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public void Delete(int id)
 {
     try
     {
         Address address = FindById(id);
         _context.Address.Remove(address);
         _context.SaveChanges();
     }catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public void Insert(Product product)
 {
     try
     {
         _context.Product.Add(product);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Beispiel #8
0
 public void Insert(List <CategoryProduct> categoryProduct)
 {
     try
     {
         _context.CategoryProduct.AddRange(categoryProduct);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Beispiel #9
0
 public void Delete(int id)
 {
     try
     {
         State state = FindById(id);
         _context.State.Remove(state);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Beispiel #10
0
 public void Delete(int id)
 {
     try
     {
         Contact contact = FindById(id);
         _context.Contact.Remove(contact);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Beispiel #11
0
 public void Insert(Employee employee)
 {
     try
     {
         _context.Employee.Add(employee);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }