Ejemplo n.º 1
0
        /// <summary>
        /// 删除会员
        /// </summary>
        public void User_Del()
        {
            if (!EX_Admin.Power("user_del", "删除会员"))
            {
                AjaxNoPower();
                return;
            }
            string id = RequestTool.RequestString("ids");

            if (id == "")
            {
                Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}");
                return;
            }
            if (RequestTool.GetConfigKey("IsDelFalse").ToLower() == "true")
            {
                List <Lebi_User> users = B_Lebi_User.GetList("id in (lbsql{" + id + "})", "");
                foreach (var u in users)
                {
                    u.IsDel = 1;
                    B_Lebi_User.Update(u);
                }
            }
            else
            {
                List <Lebi_Order> modellist = B_Lebi_Order.GetList("User_id in (lbsql{" + id + "})", "");
                foreach (Lebi_Order model in modellist)
                {
                    B_Lebi_Order.Delete("id = " + model.id + "");
                    B_Lebi_Order_Log.Delete("Order_id = " + model.id + "");
                    B_Lebi_Order_Product.Delete("Order_id = " + model.id + "");
                }
                B_Lebi_User.Delete("id in (lbsql{" + id + "})");
                B_Lebi_Message.Delete("User_id_To in (lbsql{" + id + "})");
                B_Lebi_User_Answer.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Answer.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_BuyMoney.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Card.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Money.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Point.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Product.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Address.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Supplier.Delete("User_id in (lbsql{" + id + "})");
                //B_Lebi_Supplier_ProductType.Delete("Supplier_id in (lbsql{" + id + "})");
                //B_Lebi_Supplier_Verified_Log.Delete("Supplier_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Area.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Money.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Product.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Product_request.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Product_User.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Bill.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Cash.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Comment.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_weixin_qrcode.Delete("User_id in (lbsql{" + id + "})");
            }
            Log.Add("删除会员", "User", id.ToString(), CurrentAdmin, id.ToString());
            Response.Write("{\"msg\":\"OK\"}");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除收货人信息
        /// </summary>
        public void Address_Del()
        {
            string id = RequestTool.RequestSafeString("id");

            if (id == "")
            {
                Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}");
                return;
            }
            B_Lebi_User_Address.Delete("User_id = " + CurrentUser.id + " and id in (lbsql{" + id + "})");
            Lebi_User_Address model = B_Lebi_User_Address.GetModel("User_id = " + CurrentUser.id + " and id = " + CurrentUser.User_Address_id + "");

            if (model == null)
            {
                Lebi_User_Address models = B_Lebi_User_Address.GetModel("User_id = " + CurrentUser.id + "");
                if (models != null)
                {
                    CurrentUser.User_Address_id = B_Lebi_User_Address.GetMaxId("User_id=" + CurrentUser.id + "");
                }
                B_Lebi_User.Update(CurrentUser);
            }
            Response.Write("{\"msg\":\"OK\"}");
        }