protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); if (id == 0) { if (!EX_Admin.Power("supplier_user_add", "添加商家")) { WindowNoPower(); } } else { if (!EX_Admin.Power("supplier_user_edit", "编辑商家")) { WindowNoPower(); } } model = B_Lebi_Supplier.GetModel(id); if (model == null) { model = new Lebi_Supplier(); model.Type_id_SupplierStatus = 441; user = new Lebi_User(); } else { user = B_Lebi_User.GetModel(model.User_id); } Count_pay = B_Lebi_User_Money.Counts("User_id=" + model.User_id + " and Type_id_MoneyType=198"); type = RequestTool.RequestString("type"); }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { if (CurrentUser.id == 0) { Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + "")); } LoadTheme(themecode, siteid, languagecode, pcode); path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>»</em><a href=\"" + URL("P_UserMoney", "") + "\"><span>" + Tag("资金记录") + "</span></a>"; key = Rstring("key"); dateFrom = Rstring("dateFrom"); dateTo = Rstring("dateTo"); DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom"); DateTime lbsql_dateTo = RequestTool.RequestDate("dateTo"); pageindex = RequestTool.RequestInt("page", 1); where = "User_id=" + CurrentUser.id + ""; if (key != "") { where += " and (Remark like lbsql{'%" + key + "%'})"; } if (dateFrom != "" && dateTo != "") { where += " and (datediff(d,Time_Add,'" + FormatDate(lbsql_dateFrom) + "')<=0 and datediff(d,Time_Add,'" + FormatDate(lbsql_dateTo) + "')>=0)"; } user_moneys = B_Lebi_User_Money.GetList(where, "id desc", PageSize, pageindex); int recordCount = B_Lebi_User_Money.Counts(where); PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&key=" + key + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage); NextPage = "?page=" + (pageindex + 1) + "&key=" + key + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + ""; }
/// <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\"}"); }
protected void Page_Load(object sender, EventArgs e) { id = RequestTool.RequestInt("id", 0); if (id == 0) { if (!EX_Admin.Power("user_money_add", "添加会员资金")) { WindowNoPower(); } } else { if (!EX_Admin.Power("user_money_edit", "编辑会员资金")) { WindowNoPower(); } } int user_id = RequestTool.RequestInt("user_id", 0); model = B_Lebi_User_Money.GetModel(id); if (model == null) { model = new Lebi_User_Money(); model.Type_id_MoneyStatus = 181; //有效资金 model.Type_id_MoneyType = 191; //充值 Money = ""; } else { Money = FormatMoney(model.Money, "Number").ToString(); user_id = model.User_id; mode = "user"; } Lebi_User user = B_Lebi_User.GetModel(user_id); if (user == null) { User_Name = RequestTool.RequestString("User_Name"); user = B_Lebi_User.GetModel("UserName=lbsql{'" + User_Name + "'}"); } if (user != null) { mode = "user"; User_Name = user.UserName; } user_ids = RequestTool.RequestString("ids"); if (user_ids != "") { users = B_Lebi_User.GetList("id in (lbsql{" + user_ids + "})", "id desc"); mode = "users"; } su = new SearchUser(CurrentAdmin, CurrentLanguage.Code); }
/// <summary> /// 积分转换 /// </summary> public void PointToMoney() { string t = RequestTool.RequestSafeString("t"); if (!CurrentUserLevel.PointToMoney.Contains(t)) { Response.Write("{\"msg\":\"" + Tag("非法提交") + "\"}"); return; } string[] arr = t.Split(':'); if (arr.Length != 2) { Response.Write("{\"msg\":\"" + Tag("非法提交") + "\"}"); return; } if (Convert.ToDecimal(arr[0]) > Convert.ToDecimal(CurrentUser.Point)) { Response.Write("{\"msg\":\"" + Tag("积分不足") + "\"}"); return; } Lebi_User_Money model = new Lebi_User_Money(); model.Money = Convert.ToDecimal(arr[1]); model.Type_id_MoneyStatus = 181; model.Type_id_MoneyType = 194; model.Remark = "积分兑换"; model.Time_Update = DateTime.Now; model.User_id = CurrentUser.id; model.User_RealName = CurrentUser.RealName; model.User_UserName = CurrentUser.UserName; B_Lebi_User_Money.Add(model); Lebi_User_Point pmodel = new Lebi_User_Point(); pmodel.Point = 0 - Convert.ToDecimal(arr[0]); pmodel.Type_id_PointStatus = 171; pmodel.Remark = "积分兑换"; pmodel.Time_Update = DateTime.Now; pmodel.User_id = CurrentUser.id; pmodel.User_RealName = CurrentUser.RealName; pmodel.User_UserName = CurrentUser.UserName; B_Lebi_User_Point.Add(pmodel); CurrentUser.Point = CurrentUser.Point - Convert.ToDecimal(arr[0]); CurrentUser.Money = CurrentUser.Money + Convert.ToDecimal(arr[1]); B_Lebi_User.Update(CurrentUser); //发送短信 //Lebi_User user = B_Lebi_User.GetModel(CurrentUser.id); SMS.SendSMS_balance(CurrentUser); Response.Write("{\"msg\":\"OK\"}"); }
public bool checkusermoney(Lebi_Order order) { //<-{检查资金明细中是否有消费记录 by lebi.kingdge 2018.8.18 Lebi_User_Money usermoney = B_Lebi_User_Money.GetModel("User_id = " + order.User_id + " and Type_id_MoneyType = 192 and Description like '%" + order.Code + "%'"); if (usermoney == null) { return(false); } if (usermoney.Money != order.Money_Pay) { return(false); } return(true); //}-> }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("usermoney_list", "会员资金列表")) { PageReturnMsg = PageNoPowerMsg(); } PageSize = RequestTool.getpageSize(25); int user_id = RequestTool.RequestInt("user_id", 0); key = RequestTool.RequestString("key"); dateFrom = RequestTool.RequestString("dateFrom"); dateTo = RequestTool.RequestString("dateTo"); type = RequestTool.RequestInt("type", 0); DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom"); DateTime lbsql_dateTo = RequestTool.RequestDate("dateTo"); string where = "1=1"; if (user_id > 0) { where += " and User_id=" + user_id; } if (type > 0) { where += " and Type_id_MoneyType=" + type + ""; } if (key != "") { where += " and (User_UserName like lbsql{'%" + key + "%'} or User_RealName like lbsql{'%" + key + "%'} or Remark like lbsql{'%" + key + "%'})"; } if (dateFrom != "" && dateTo != "") { where += " and (datediff(d,Time_Add,'" + FormatDate(lbsql_dateFrom) + "')<=0 and datediff(d,Time_Add,'" + FormatDate(lbsql_dateTo) + "')>=0)"; } models = B_Lebi_User_Money.GetList(where, "id desc", PageSize, page); int recordCount = B_Lebi_User_Money.Counts(where); PageString = Pager.GetPaginationString("?page={0}&key=" + key + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&type=" + type, page, PageSize, recordCount); user = B_Lebi_User.GetModel(user_id); if (user == null) { user = new Lebi_User(); user.UserName = Tag("全部会员"); } }
/// <summary> /// 编辑会员资金 /// </summary> public void UserMoney_Edit() { int id = RequestTool.RequestInt("id", 0); SearchUser su = new SearchUser(CurrentAdmin, CurrentLanguage.Code); decimal money = RequestTool.RequestDecimal("Money", 0); int Type_id_MoneyType = RequestTool.RequestInt("Type_id_MoneyType", 0); string Remark = RequestTool.RequestString("Remark"); if (id > 0) { if (!EX_Admin.Power("user_money_edit", "编辑会员资金")) { AjaxNoPower(); return; } Lebi_User_Money model = B_Lebi_User_Money.GetModel(id); Lebi_User user = B_Lebi_User.GetModel(model.User_id); Log.Add("编辑会员资金", "User_Money", id.ToString(), CurrentAdmin, user.UserName); if (user == null) { Response.Write("{\"msg\":\"" + Tag("会员账号不存在") + "\"}"); return; } //model.Type_id_MoneyStatus = RequestTool.RequestInt("Type_id_MoneyStatus", 0); model.Type_id_MoneyType = Type_id_MoneyType; model.Admin_UserName = CurrentAdmin.UserName; model.Admin_id = CurrentAdmin.id; model.Remark = Remark; model.Time_Update = DateTime.Now; B_Lebi_User_Money.Update(model); //EX_User.UpdateUserMoney(user); } else { if (!EX_Admin.Power("user_money_add", "添加会员资金")) { AjaxNoPower(); return; } string Mode = RequestTool.RequestString("mode"); string User_Name_To = RequestTool.RequestString("User_Name_To"); string UserLevel_ids = RequestTool.RequestString("UserLevel_ids"); string User_ids = RequestTool.RequestString("User_ids"); string UserName_ids = RequestTool.RequestString("UserName_ids"); if (Mode == "user") { Lebi_User user = B_Lebi_User.GetModel("UserName = lbsql{'" + User_Name_To + "'}"); if (user == null) { Response.Write("{\"msg\":\"" + Tag("会员账号不存在") + "\"}"); return; } Lebi_User_Money model = new Lebi_User_Money(); Log.Add("添加会员资金", "User_Money", id.ToString(), CurrentAdmin, User_Name_To + " ->" + RequestTool.RequestDecimal("Money", 0)); Money.AddMoney(user, money, Type_id_MoneyType, CurrentAdmin, "", Remark); } else { string where = ""; if (User_ids == "") { where = "1=1 " + su.SQL; Log.Add("添加会员资金", "User_Money", "", CurrentAdmin, su.Description + " ->" + RequestTool.RequestDecimal("Money", 0)); } else { where = "id in (" + User_ids + ")"; Log.Add("添加会员资金", "User_Money", "", CurrentAdmin, UserName_ids + " ->" + RequestTool.RequestDecimal("Money", 0)); } List <Lebi_User> modellist = B_Lebi_User.GetList(where, ""); foreach (Lebi_User user in modellist) { Money.AddMoney(user, money, Type_id_MoneyType, CurrentAdmin, "", Remark); } } } string result = "{\"msg\":\"OK\"}"; Response.Write(result); }