예제 #1
0
 public int Put(CustomerViewModel customer)
 {
     try
     {
         service.UpdateCustomer(customer);
         return(1);
     }
     catch
     {
         return(0);
     }
 }
예제 #2
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));
 }
예제 #4
0
        public void UpdateCustomer(Customer customer)
        {
            CustomerRespository repo = new CustomerRespository();

            repo.UpdateCustomer(customer);
        }
예제 #5
0
 public IActionResult Put([FromBody] Customer ourCustomer)
 {
     return(Ok(_ourCustomerRespository.UpdateCustomer(ourCustomer)));
 }
예제 #6
0
        public ActionResult UpdateCustomer(Customer customer)
        {
            var user = _customerRepository.UpdateCustomer(customer);

            return(Ok(user));
        }