Ejemplo n.º 1
0
        public ActionResult Switch(Guid shippingId)
        {
            var result = new DataJsonResult();

            Models.Shipping shipping = _currencyService.GetSingleById <Models.Shipping>(shippingId);

            if (shipping != null && shipping.Status != ShippingStatus.Delete)
            {
                string msg = "";
                if (shipping.Status == ShippingStatus.Disabled)
                {
                    shipping.Status = ShippingStatus.Enabled;
                    msg             = "启用";
                }
                else if (shipping.Status == ShippingStatus.Enabled)
                {
                    shipping.Status = ShippingStatus.Disabled;
                    msg             = "禁用";
                }
                var isDelete = _shippingService.UpdateShipping(shipping);

                if (!isDelete)
                {
                    result.ErrorMessage = msg + "失败!";
                }
            }
            else
            {
                result.ErrorMessage = "配送类型不存在!";
            }

            return(Json(result));
        }
Ejemplo n.º 2
0
        public ActionResult SetDefault(Guid shippingId)
        {
            var result = new DataJsonResult();

            Models.Shipping shipping = _currencyService.GetSingleById <Models.Shipping>(shippingId);
            if (shipping != null)
            {
                _shippingService.SetDefault(shippingId);
            }
            else
            {
                result.ErrorMessage = "配送类型不存在!";
            }



            return(Json(result));
        }