public void EditCustomer(CustomerDetail customer) { customer = (CustomerDetail)db.CustomerDetails.Where(cust => cust.customerId == customer.customerId); db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); }
public virtual void Delete(TEntity entityToDelete) { if (_context.Entry(entityToDelete).State == EntityState.Detached) { _dbSet.Attach(entityToDelete); } _dbSet.Remove(entityToDelete); }
public void UpdateCEO(CEO ceo) { ceo = _db.CEOs.FirstOrDefault(cust => cust.CeoId == ceo.CeoId); _db.Entry(ceo).State = EntityState.Modified; _db.SaveChanges(); }
public void UpdateSalers(Saler saler) { saler = _db.Salers.FirstOrDefault(cust => cust.SalerId == saler.SalerId); _db.Entry(saler).State = EntityState.Modified; _db.SaveChanges(); }
public void UpdateSecretaryPayment(SecretaryPayment payment) { payment = _db.SecretaryPayments.FirstOrDefault(cust => cust.SecretaryPaymentId == payment.SecretaryPaymentId); _db.Entry(payment).State = EntityState.Modified; _db.SaveChanges(); }
public void UpdateCannoe(Cannoe cannoe) { cannoe = _db.Cannoes.FirstOrDefault(cust => cust.CannoeId == cannoe.CannoeId); _db.Entry(cannoe).State = EntityState.Modified; _db.SaveChanges(); }
public void UpdateCustomerPayment(CustomerPayment payment) { payment = _db.CustomerPayments.FirstOrDefault(cust => cust.customerPaymentId == payment.customerPaymentId); _db.Entry(payment).State = EntityState.Modified; _db.SaveChanges(); }
public void UpdateShipping(Shipping shipping) { shipping = _db.Shippings.FirstOrDefault(cust => cust.ShippingId == shipping.ShippingId); _db.Entry(shipping).State = EntityState.Modified; _db.SaveChanges(); }
public void UpdateFishOrder(FishOrder order) { order = _db.FishOrders.FirstOrDefault(cust => cust.orderId == order.orderId); _db.Entry(order).State = EntityState.Modified; _db.SaveChanges(); }
public void UpdateFish(Fish fish) { fish = _db.Fish.FirstOrDefault(cust => cust.FishId == fish.FishId); _db.Entry(fish).State = EntityState.Modified; _db.SaveChanges(); }
public void UpdateSecretary(Secretary sec) { sec = _db.Secretaries.FirstOrDefault(cust => cust.SecretaryId == sec.SecretaryId); _db.Entry(sec).State = EntityState.Modified; _db.SaveChanges(); }
public void UpdateCustomer(Customer customer) { customer = _db.Customers.FirstOrDefault(cust => cust.customerId == customer.customerId); _db.Entry(customer).State = EntityState.Modified; _db.SaveChanges(); }