Ejemplo n.º 1
0
        public ActionResult DelOrderDetail(string DetailId)
        {
            AjaxResult result = new AjaxResult();

            try
            {
                var detail = OrderDetailLogic.GetEnityById(DetailId);
                if (detail != null)
                {
                    string orderId = detail.c_order_id;
                    OrderDetailLogic.DeleteEntity(DetailId);

                    if (!string.IsNullOrEmpty(orderId))
                    {
                        var list = OrderDetailLogic.GetList().Where(t => t.c_order_id == orderId);
                        if (list.Count() == 0)
                        {
                            OrderLogic.DeleteEntity(orderId);
                        }
                    }
                }
                result.state   = ResultType.success.ToString();
                result.message = "成功";

                return(Content(result.ToJson()));
            }
            catch (Exception ex)
            {
                result.state   = ResultType.error.ToString();
                result.message = string.Format("({0})", ex.Message);
                return(Content(result.ToJson()));

                throw;
            }
        }