Exemplo n.º 1
0
        public HttpResponseMessage UpdateCustomer(CustomerOperateDTO dto)
        {
            ResultDTO <object> actionresult = new ResultDTO <object>();

            try
            {
                if (dto.UpType == 1)//正常修改
                {
                    actionresult.SubmitResult = _ICustomerServices.UpdateCustomer(dto);
                }
                else if (dto.UpType == 2)//停启用
                {
                    actionresult.SubmitResult = _ICustomerServices.ChangeStatusCustomer(dto);
                }
            }
            catch (Exception ex)
            {
                actionresult.SubmitResult = false;
                actionresult.Message      = ex.Message;
            }

            HttpResponseMessage result = new HttpResponseMessage
            {
                Content = new StringContent(JsonConvert.SerializeObject(actionresult),
                                            System.Text.Encoding.GetEncoding("UTF-8"),
                                            "application/json")
            };

            return(result);
        }