Example #1
0
        public ActionResult AjaxGetShipTypeList(string paymentcateid, string shipaddrsysno)
        {
            PaymentCategory paymentCate;
            int             shipAddrSysNo;

            if (!Enum.TryParse(paymentcateid, out paymentCate))
            {
                throw new BusinessException("无效的请求");
            }
            if (!int.TryParse(shipaddrsysno, out shipAddrSysNo))
            {
                throw new BusinessException("无效的请求");
            }

            var shippingAddress = CustomerShippingAddresssFacade.GetCustomerShippingAddress(shipAddrSysNo, CurrUser.UserSysNo);

            if (shippingAddress == null)
            {
                return(PartialView("_ShipTypePanel", new List <ShipTypeInfo>(0)));
            }
            ShoppingCart   shoppingCart = ShoppingStorageManager.GetShoppingCartFromCookieOrCreateNew();
            CheckOutResult result       = ShoppingFacade.GetPayAndShipTypeList(null, CurrUser.UserSysNo, shoppingCart);
            var            shipTypeList = result.ShipTypeList;

            //var shipTypeList = ShipTypeFacade.GetSupportedShipTypeList(shippingAddress.ReceiveAreaSysNo, paymentCate);
            return(PartialView("_ShipTypePanel", shipTypeList));
        }
Example #2
0
        public ActionResult EditShippingAddress()
        {
            if (Request["cmd"] == null)
            {
                throw new BusinessException("无效的请求");
            }

            int    contactAddressSysNo;
            string command = Request["cmd"].Trim().ToUpper();

            switch (command)
            {
            case "GET":

                if (Request["id"] == null || !int.TryParse(Request["id"], out contactAddressSysNo))
                {
                    throw new BusinessException("无效的请求");
                }
                else
                {
                    ShippingContactInfo customerShippingAddressInfo = CustomerShippingAddresssFacade.GetCustomerShippingAddress(contactAddressSysNo, CurrUser.UserSysNo);
                    if (customerShippingAddressInfo == null)
                    {
                        throw new BusinessException("无效的收货地址");
                    }
                    return(PartialView("_RMAShippingAddressEditPanel", customerShippingAddressInfo));
                }

            case "DEL":

                if (Request["id"] == null || !int.TryParse(Request["id"], out contactAddressSysNo))
                {
                    throw new BusinessException("无效的请求");
                }
                else
                {
                    CustomerShippingAddresssFacade.DeleteCustomerContactInfo(contactAddressSysNo, CurrUser.UserSysNo);
                    return(Json(new { sysno = contactAddressSysNo }));
                }

            case "DEFAULT":
                if (Request["id"] == null || !int.TryParse(Request["id"], out contactAddressSysNo))
                {
                    throw new BusinessException("无效的请求");
                }
                else
                {
                    CustomerShippingAddresssFacade.SetCustomerContactAsDefault(contactAddressSysNo, CurrUser.UserSysNo);
                    return(Content("y"));
                }

            default:
                break;
            }

            return(Json(""));
        }
Example #3
0
        public ActionResult AjaxGetShippingAddress()
        {
            int contactAddressSysNo;

            if (Request["id"] == null || !int.TryParse(Request["id"], out contactAddressSysNo))
            {
                throw new BusinessException("无效的请求");
            }
            else
            {
                ShippingContactInfo customerShippingAddressInfo = CustomerShippingAddresssFacade.GetCustomerShippingAddress(contactAddressSysNo, CurrUser.UserSysNo);
                if (customerShippingAddressInfo == null)
                {
                    throw new BusinessException("无效的收货地址");
                }
                return(PartialView("_ReceiveAddressEdit", customerShippingAddressInfo));
            }
        }