public int Put(CustomerViewModel customer) { try { service.UpdateCustomer(customer); return(1); } catch { return(0); } }
public void UpdateCustomer(CustomerModel model) { var customer = customerRespository.GetCustomer(model.Id); if (customer == null) { ThrowHelper.CreateArgumentException("找不到该客户!"); } customer.NickName = model.NickName; customer.Name = model.Name; customer.IsVIP = model.IsVIP; customer.Phone = model.Phone; customerRespository.UpdateCustomer(customer); }
public bool Put([FromBody] Customer ourCustomer) { return(_ourCustomerRespository.UpdateCustomer(ourCustomer)); }
public void UpdateCustomer(Customer customer) { CustomerRespository repo = new CustomerRespository(); repo.UpdateCustomer(customer); }
public IActionResult Put([FromBody] Customer ourCustomer) { return(Ok(_ourCustomerRespository.UpdateCustomer(ourCustomer))); }
public ActionResult UpdateCustomer(Customer customer) { var user = _customerRepository.UpdateCustomer(customer); return(Ok(user)); }