예제 #1
0
        public async Task <JsonResult> Delete(int id)
        {
            CustomerProvider customerProvider = new CustomerProvider();
            var result = await customerProvider.DeleteAsync(id);

            return(Json(new AccessEntityResult {
                Status = result, Data = id, Message = MessageManager.GetErrorMessage(ModuleType.Customer, result)
            }));
            //if (customer==null)
            //{
            //    return Json(new AccessEntityResult { Status = AccessEntityStatusCode.NotFound, Data=id ,Message = MessageManager.GetErrorMessage(ModuleType.Customer, MessageType.NotFound) });
            //}
            //else
            //{
            //    AccessEntityStatusCode statusCode = await customerProvider.DeleteAsync(customer);
            //    return Json(new AccessEntityResult { Status = statusCode, Data = id, Message = MessageManager.GetErrorMessage(ModuleType.Customer, statusCode) });
            //}
        }