Esempio n. 1
0
        public ActionResult SetAddressDefault(int addressID)
        {
            if (addressID < 1)
            {
                return this.Json(new AjaxResponse(0, "参数错误"));
            }

            var service = new UserReceiveAddressService();
            var userID = service.QueryByID(addressID).UserID;

            if (this.UserSession.UserID != userID)
            {
                return this.Json(new AjaxResponse(-1, "无权修改本地址信息"));
            }

            service.SetDefault(addressID, userID);

            return this.Json(new AjaxResponse(1, "操作成功"));
        }
Esempio n. 2
0
        public ActionResult RemoveAddress(int addressID)
        {
            if (addressID < 1)
            {
                return this.Json(new AjaxResponse(0, "没有操作"));
            }

            var service = new UserReceiveAddressService();
            var userID = service.QueryByID(addressID).UserID;

            if (this.UserSession.UserID != userID)
            {
                return this.Json(new AjaxResponse(-1, "无权修改本地址信息"));
            }

            service.RemoveByID(addressID);

            return this.Json(new AjaxResponse(1, "删除成功"));
        }