public string GetSuanLiList(HttpContext context) { //string User = context.Request["UserID"]; string UserCode = context.Request["UserCode"]; if (string.IsNullOrEmpty(UserCode) || UserCode.Trim() == string.Empty) { return(ResultJson(ResultType.error, "请输入用户账号", "")); } AllCore AC = new AllCore(); long UserID = AC.userBLL.GetUserID(UserCode); if (UserID <= 0) { return(ResultJson(ResultType.error, "账号不存在!", "")); } var model = AC.userBLL.GetModel(UserID); GetModel getModel = new GetModel(); getModel.Emoney = model.Emoney; getModel.StockMoney = model.StockMoney; getModel.BonusAccount = model.BonusAccount; getModel.AllBonusAccount = model.AllBonusAccount; getModel.User001 = model.User001; return(ResultJson(ResultType.success, "", getModel)); }
protected void LinkButton3_Click(object sender, EventArgs e) { if (txtCode.Text.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('会员编号不能为空!');", true); return; } lgk.Model.tb_user model_user = userBLL.GetModel(" UserCode='" + txtCode.Text.Trim() + "'"); if (model_user == null) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('会员不存在!');", true); return; } if (model_user.AgentsID != agentBLL.GetIDByIDUser(getLoginID())) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('所属报单中心不正确!');", true); return; } if (txtMoney.Value.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('消费金额不能为空!');", true); return; } decimal money = 0; try { money = Convert.ToDecimal(txtMoney.Value.Trim()); } catch { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('消费金额格式不正确!');", true); return; } if (money <= 0) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('消费金额要大于零!');", true); return; } if (money > model_user.StockAccount) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('重复消费账户余额不足!');", true); return; } lgk.Model.tb_mix model = new lgk.Model.tb_mix(); model.UserID = model_user.UserID; model.Amount = money; model.AddTime = DateTime.Now; model.Source = "报单中心消费"; if (mixBLL.Add(model) > 0) { AllCore acore = new AllCore();//1收入2支出 acore.add_userRecord(new lgk.BLL.tb_user().GetModel(model.UserID).UserCode, DateTime.Now, money, 2); ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('操作成功!');window.location.href='agent_xf.aspx';", true); } else { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('错误!');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { AllCore AC = new AllCore(); //AC. } }
protected void LinkButton3_Click(object sender, EventArgs e) { if (txtCode.Text.Trim() == "") { MessageBox.MyShow(this, "会员编号不能为空!"); return; } lgk.Model.tb_user model_user = userBLL.GetModel(" UserCode='" + txtCode.Text.Trim() + "'"); if (model_user == null) { MessageBox.MyShow(this, "会员不存在!"); return; } if (txtMoney.Value.Trim() == "") { MessageBox.MyShow(this, "消费金额不能为空!"); return; } decimal money = 0; try { money = Convert.ToDecimal(txtMoney.Value.Trim()); } catch { MessageBox.MyShow(this, "消费金额格式不正确!"); return; } if (money <= 0) { MessageBox.MyShow(this, "消费金额要大于零!"); return; } if (money > model_user.StockAccount) { MessageBox.MyShow(this, "重复消费账户余额不足!"); return; } lgk.Model.tb_mix model = new lgk.Model.tb_mix(); model.UserID = model_user.UserID; model.Amount = money; model.AddTime = DateTime.Now; model.Source = "后台消费"; if (mixBLL.Add(model) > 0) { AllCore acore = new AllCore();//1收入2支出 acore.add_userRecord(new lgk.BLL.tb_user().GetModel(model.UserID).UserCode, DateTime.Now, money, 2); MessageBox.MyShow(this, "操作成功!"); } else { MessageBox.MyShow(this, "错误!"); } }
public string GetSuanLiList(HttpContext context) { //string User = context.Request["UserID"]; string UserCode = context.Request["UserCode"]; string Pay = context.Request["Pay"]; //1 什么币 2 什么币 string Remark = context.Request["Remark"]; //备注 string Money = context.Request["Money"]; //金额 string Key = context.Request["Key"]; //key int Page = 0; int Mumber = 0; long UserID = 0; decimal jine = 0; if (string.IsNullOrEmpty(UserCode) || UserCode.Trim() == string.Empty) { return(ResultJson(ResultType.error, "请输入用户账号", "")); } AllCore AC = new AllCore(); UserID = AC.userBLL.GetUserID(UserCode); if (UserID <= 0) { return(ResultJson(ResultType.error, "账号不存在!", "")); } if (!decimal.TryParse(Money, out jine)) { return(ResultJson(ResultType.error, "金额不正确!", "")); } if (jine <= 0) { return(ResultJson(ResultType.error, "金额不能为0!", "")); } if (Pay == "1") { AC.UpdateAccount("", UserID, jine, 0); } else if (Pay == "2") { } else { return(ResultJson(ResultType.error, "支付类型错误!", "")); } SuanLiJournalService svc = new SuanLiJournalService(); SuanLiListModel model = svc.GetSuanLiJournalList(UserID, Page, Mumber); return(ResultJson(ResultType.success, "", model)); }
public string GetSuanLiList(HttpContext context) { AllCore AC = new AllCore(); var model = AC.agent1BLL.GetList(" Flag=1 ").Tables[0]; List <GetModel> list = new List <GetModel>(); for (int i = 0; i < model.Rows.Count; i++) { list.Add(new GetModel { UserCode = model.Rows[i]["AgentCode"].ToString() }); } return(ResultJson(ResultType.success, "", list)); }
protected void VerifiCode_Click(object sender, EventArgs e) { string str = ""; string strPhone = txtPhoneNum.Value.Trim(); if (!new RegexR().isPhones(strPhone)) { str = "手机号码有误!"; return; } else { AllCore core = new AllCore(); lgk.Model.SMS model = new lgk.Model.SMS(); model.IsDeleted = 0; model.IsValid = 1; model.PublishTime = DateTime.Now; model.SCode = new Library.Common().GetRandom(6); model.ToPhone = strPhone; model.SMSContent = model.SCode; model.SendNum = 0; model.ToUserCode = Session.SessionID; model.ValidTime = DateTime.Now.AddMinutes(5); model.TypeID = 4; //推广链接的类别 CacheHelper.Insert_s(Session.SessionID, DateTime.Now.AddMinutes(1).ToString("yyyy-MM-dd HH:mm:ss"), 1 * 60 - 4); //时间减3秒,提前过期缓存 if (new lgk.BLL.SMS().Add(model) > 0) { string strreturn = Library.SMSHelper.SendMessage2(strPhone, model.SCode); if (strreturn == "0") { str = "验证码已发送"; } else { str = "验证码发送失败!"; } SetCountDownBtn(); } else { str = "验证码发送失败!"; } } msg.InnerHtml = str; }
static Config() { //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ AllCore ac = new AllCore(); //合作身份者ID,以2088开头由16位纯数字组成的字符串 partner = ac.getParamVarchar("partnerid").ToString(); //交易安全检验码,由数字和字母组成的32位字符串 key = ac.getParamVarchar("key").ToString(); //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ //字符编码格式 目前支持 gbk 或 utf-8 input_charset = "utf-8"; //签名方式,选择项:RSA、DSA、MD5 sign_type = "MD5"; }
/// <summary> /// 登录 密码登录 /// </summary> /// <param name="context"></param> /// <returns></returns> private string LoginModeByPassword(HttpContext context) { string strusername = context.Request["username"] ?? ""; string strpassword = context.Request["password"] ?? ""; //string strphonecode = context.Request["phonecode"] ?? "1"; //int LoginMode = 1; //密码登录 string message = string.Empty; string hx_passowrd = string.Empty; if (string.IsNullOrEmpty(strusername)) { return(ResultJson(ResultType.error, "请输入用户名", "")); } if (string.IsNullOrEmpty(strpassword)) { return(ResultJson(ResultType.error, "请输入密码", "")); } //if (string.IsNullOrEmpty(strphonecode)) //{ // return ResultJson(ResultType.error, "请输入手机验证码", ""); //} AllCore AC = new AllCore(); long UserID = AC.userBLL.GetUserID(strusername); if (UserID <= 0) { return(ResultJson(ResultType.error, "此账号不存在!", "")); } var model = AC.userBLL.GetModel(UserID); if (model.Password != strpassword.ToUpper()) { return(ResultJson(ResultType.error, "账号密码错误!", "")); } message = "ok"; return(ResultJson(ResultType.success, message, "")); }
public void ProcessRequest(HttpContext context) { string result = "error"; string message = "手机号输入错误!"; string dates = ""; string phone = context.Request["phone"]; string YZM = context.Request["YZM"]; string Type = context.Request["Type"];//0注册 1登陆 string a = context.Session["CheckCode"] == null ? " ": context.Session["CheckCode"].ToString(); if (a == "") { message = "验证码已过期!"; SendResponse(context, result, message, dates); } if (YZM != a) { message = "验证码错误,请输入正确的验证码!"; SendResponse(context, result, message, dates); } //if (phone.Length!=11) //{ // SendResponse(context, result, message, dates); //} AllCore AC = new AllCore(); var User = AC.userBLL.GetModelByPhoneNum(phone);//不存在的情况, 可以注册, 存在那就对比 if (User != null && Type == "1") { if (AC.smsBLL.GetSendCountOfDay(phone) >= 5) //同号码每日限制:5条 { message = "超出短信发送计数限制"; SendResponse(context, result, message, dates); return; } if (AC.smsBLL.GetSendCountOfMinute(phone, 1) >= 1) //同号码每分钟限制:1条 { message = "操作过于频繁,请稍后重试"; SendResponse(context, result, message, dates); return; } string regSwitch = ConfigurationManager.AppSettings["SMS_SWITCH"];//注册短信开关 if (regSwitch.Equals("Open")) { //------------------验证码// lgk.Model.SMS model = new lgk.Model.SMS(); model.IsDeleted = 0; model.IsValid = 0; model.PublishTime = DateTime.Now; model.SCode = new Library.Common().GetRandom(6); model.ToPhone = phone; model.SMSContent = model.SCode; model.SendNum = 1; model.ToUserCode = ""; model.ValidTime = DateTime.Now.AddMinutes(5); model.TypeID = 2; long isid = AC.smsBLL.Add(model); if (isid > 0) { //msg = "验证码已发送"; string strreturn = Library.SMSHelper.SendMessage2(phone, model.SCode); if (strreturn == "0") { result = "success"; message = "发送成功请注意查看手机短信"; } else { AC.smsBLL.UpdateDelete(isid, -1); message = "发送失败"; } } else { message = "验证码发送失败"; } } else { message = "短信接口已经关闭"; } SendResponse(context, result, message, dates); } else if (Type == "0")//注册 { if (User != null) { message = "该手机号已注册"; SendResponse(context, result, message, dates); return; } string regSwitch = ConfigurationManager.AppSettings["SMS_SWITCH"];//注册短信开关 if (regSwitch.Equals("Open")) { //------------------验证码// #region 短信验证码 lgk.Model.SMS model = new lgk.Model.SMS(); model.IsDeleted = 0; model.IsValid = 0; model.PublishTime = DateTime.Now; model.SCode = new Library.Common().GetRandom(6); model.ToPhone = phone; model.SMSContent = model.SCode; model.SendNum = 1; model.ToUserCode = ""; model.ValidTime = DateTime.Now.AddMinutes(5); model.TypeID = 1; #endregion long isid = AC.smsBLL.Add(model); if (isid > 0) { string strreturn = Library.SMSHelper.SendMessage2(phone, model.SCode); if (strreturn == "0") { result = "success"; message = "发送成功请注意查看手机短信"; } else { AC.smsBLL.UpdateDelete(isid, -1); message = "发送失败"; } } else { message = "验证码发送失败"; } } else { message = "短信接口已经关闭"; } SendResponse(context, result, message, dates); } SendResponse(context, result, message, dates); }
public void ProcessRequest(HttpContext context) { string result = "error"; string message = "暂无数据"; string dates = ""; string User = context.Request["UserID"]; string Page_1 = context.Request["Page"]; string Mumber_1 = context.Request["Mumber"]; int Page = 0; int Mumber = 0; long UserID = 0; if (string.IsNullOrEmpty(User) || User.Trim() == string.Empty) { message = "账号不存在"; SendResponse(context, result, message, dates); return; } try { UserID = long.Parse(User); } catch (Exception) { UserID = 0; } try { Page = int.Parse(Page_1); Mumber = int.Parse(Mumber_1); } catch (Exception) { message = "页码错误!"; SendResponse(context, result, message, dates); } if (Page == 0) { Page = 1; } int Start = (Page - 1) * Mumber; int YM = Page * Mumber; AllCore AC = new AllCore(); var model = AC.userBLL.GetModel(UserID);//-查询是否有这个人。 if (model == null) { message = "账号不存在"; SendResponse(context, result, message, dates); return; } SqlConnection conn = new SqlConnection(sconn); conn.Open(); string sql = string.Format(" select * from tb_SuanliJournal where userid= " + UserID + " order by ID desc ;"); SqlDataAdapter da = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); da.Fill(dt); conn.Close(); dates += "\"NotesList\":["; decimal dd = dt.Rows.Count / Mumber; int yu = dt.Rows.Count % Mumber; int GG = 0; if (YM > dt.Rows.Count)//最后一页处理 { if (YM - dt.Rows.Count > Mumber) { GG = 1; } Page = (int)Math.Floor(dd); Start = Mumber * Page; Mumber = yu; } if (yu > 0) { dd += 1; } if (dt.Rows.Count > 0) { if (GG == 1) { Mumber = 0; } for (int i = Start; i < Start + Mumber; i++) { if (Mumber == 1) { string a = dt.Rows[i]["ReduceAmount"].ToString() == "0" ? "{\"SuanLi\":\"+" + dt.Rows[i]["AddAmount"].ToString() : "{\"SuanLi\":\"-" + dt.Rows[i]["ReduceAmount"].ToString(); string b = ""; if (dt.Rows[i]["AddAmount"].ToString() == "0") { b = dt.Rows[i]["MoneyType"].ToString() == "0" ? "生长云图" : ""; } else { b += GetMoneyTypeName(dt.Rows[i]["MoneyType"].ToString()); } dates += a + "\",\"Total\":\"" + dt.Rows[i]["SurplusAmount"].ToString() + "\",\"Suanli_Type\":\"" + b + "\",\"Remark\":\"" + dt.Rows[i]["Remark"].ToString() + "\",\"Time\":\"" + dt.Rows[i]["JoinTime"].ToString() + "\"}"; continue; } if (i == Start + Mumber - 1) { string a = dt.Rows[i]["ReduceAmount"].ToString() == "0" ? "{\"SuanLi\":\"+" + dt.Rows[i]["AddAmount"].ToString() : "{\"SuanLi\":\"-" + dt.Rows[i]["ReduceAmount"].ToString(); string b = ""; if (dt.Rows[i]["AddAmount"].ToString() == "0") { b = dt.Rows[i]["MoneyType"].ToString() == "0" ? "生长云图" : ""; } else { b += GetMoneyTypeName(dt.Rows[i]["MoneyType"].ToString()); } dates += a + "\",\"Total\":\"" + dt.Rows[i]["SurplusAmount"].ToString() + "\",\"Suanli_Type\":\"" + b + "\",\"Remark\":\"" + dt.Rows[i]["Remark"].ToString() + "\",\"Time\":\"" + dt.Rows[i]["JoinTime"].ToString() + "\"}"; continue; } if (Mumber > 1) { string a = dt.Rows[i]["ReduceAmount"].ToString() == "0" ? "{\"SuanLi\":\"+" + dt.Rows[i]["AddAmount"].ToString() : "{\"SuanLi\":\"-" + dt.Rows[i]["ReduceAmount"].ToString(); string b = ""; if (dt.Rows[i]["AddAmount"].ToString() == "0") { b = dt.Rows[i]["MoneyType"].ToString() == "0" ? "生长云图" : ""; } else { b += GetMoneyTypeName(dt.Rows[i]["MoneyType"].ToString()); } dates += a + "\",\"Total\":\"" + dt.Rows[i]["SurplusAmount"].ToString() + "\",\"Suanli_Type\":\"" + b + "\",\"Remark\":\"" + dt.Rows[i]["Remark"].ToString() + "\",\"Time\":\"" + dt.Rows[i]["JoinTime"].ToString() + "\"},"; } } result = "success"; message = "查询成功"; } dates += "]"; dates += ",\"CountPage\":" + dd + ""; SendResponse(context, result, message, dates); }
public void ProcessRequest(HttpContext context) { string result = "error"; string message = "账号不存在!"; string dates = ""; string Emoney = ""; string BonusAccount = ""; string jine = ""; long UserID = 0; string User = context.Request["UserID"]; AllCore AC = new AllCore(); if (string.IsNullOrEmpty(User) || User.Trim() == string.Empty) { message = "账号不存在!"; SendResponse(context, result, message, dates); return; } try { UserID = long.Parse(User); } catch (Exception) { UserID = 0; } var model = AC.userBLL.GetModel(UserID);//-取出当前余额的钱。 if (model == null) { //不存在 message = "账号不存在!"; SendResponse(context, result, message, dates); } Emoney = model.Emoney.ToString(); BonusAccount = model.BonusAccount.ToString(); jine = "],\"Emoney\":\"" + Emoney + "\",\"BonusAccount\":\"" + BonusAccount + "\",\"TotalMachine\":\"" + (model.User004 + model.MachineNumLock) + "\",\"ShengYuSuanLi\":\"" + AC.Get_ShengYuSuanLi(UserID) + "\"}"; SqlConnection conn = new SqlConnection(sconn); conn.Open(); string sql = string.Format("select ID,RandMoney from tb_Rand where UserID=" + UserID + " and Flag=0 and GiveTime <=getdate();"); SqlDataAdapter da = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); da.Fill(dt); conn.Close(); dates += "{\"List\":["; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows.Count == 1) { dates += "{\"ID\":\"" + dt.Rows[i]["ID"].ToString() + "\",\"Money\":\"" + dt.Rows[i]["RandMoney"].ToString() + "\"}"; continue; } if (i == dt.Rows.Count - 1) { dates += "{\"ID\":\"" + dt.Rows[i]["ID"].ToString() + "\",\"Money\":\"" + dt.Rows[i]["RandMoney"].ToString() + "\"}"; continue; } if (dt.Rows.Count > 1) { dates += "{\"ID\":\"" + dt.Rows[i]["ID"].ToString() + "\",\"Money\":\"" + dt.Rows[i]["RandMoney"].ToString() + "\"},"; } } } dates += jine; result = "success"; message = "查询成功!"; SendResponse(context, result, message, dates); }
/// <summary> /// 审核分页申请记录 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { long UserID = long.Parse(e.CommandArgument.ToString()); lgk.Model.tb_user model = userBLL.GetModel(UserID); if (model == null) { MessageBox.MyShow(this, "该会员已删除,无法再进行此操作!"); return; } if (model.IsOpend != 0) { MessageBox.MyShow(this, "该会员已激活,无法再进行此操作!"); return; } if (e.CommandName.Equals("open")) // { AllCore acore = new AllCore(); //1收入2支出 //开通会员检查 int i = acore.OpenCheck(model); if (i != 0) { MessageBox.MyShow(this, acore.OpenCheckErrorMsg(i)); return; } if (flag_open(UserID, 2) > 0) { acore.add_userRecord(model.UserCode, DateTime.Now, model.RegMoney, 2); MessageBox.MyShow(this, "开通成功!"); } else { MessageBox.MyShow(this, "开通失败!"); //开通失败 } } if (e.CommandName.Equals("Empty"))// { if (userBLL.UpdateEmpty(UserID)) { MessageBox.MyShow(this, "开通空单成功!"); } else { MessageBox.MyShow(this, "开通空单失败!"); //开通失败 } } if (e.CommandName.Equals("Remove"))//删除 { //返还注册金额 if (userBLL.Delete(UserID)) { MessageBox.MyShow(this, "删除成功!"); } else { MessageBox.MyShow(this, "删除失败!"); } } BindData(); }
public void ProcessRequest(HttpContext context) { string result = "error"; string message = "账号不存在或签到失败"; string dates = ""; string User = context.Request["UserID"]; string Pass_1 = context.Request["Pass"]; long Pass = 0; long UserID = 0; if (string.IsNullOrEmpty(User) || User.Trim() == string.Empty) { message = "账号不存在!"; SendResponse(context, result, message, dates); return; } try { Pass = long.Parse(Pass_1); UserID = long.Parse(User); } catch (Exception) { Pass = 0; UserID = 0; } AllCore AC = new AllCore(); var model = AC.userBLL.GetModel(UserID);//-。 if (model == null) { //不存在 message = "账号不存在!"; SendResponse(context, result, message, dates); } SqlConnection conn = new SqlConnection(sconn); conn.Open(); string sql = string.Format("select * from tb_Ready_Rand where JoinDate >= convert( datetime, convert(varchar(10),GETDATE(),120) + ' 00:00:00' ) and UserID='" + UserID + "' and TuiJian_QianDao=2 ;"); SqlDataAdapter da = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); da.Fill(dt); conn.Close(); decimal Param = 0; int Qiandao = 0; if (dt.Rows.Count > 0) { result = "success"; message = "您今天已经签到了!"; Qiandao = 2; } else { result = "success"; message = "未签到!"; } Param = AC.getParamAmount("price_2"); if (Pass > 0 && dt.Rows.Count == 0) { int a = AC.Get_Qiandao(UserID); if (a > 0) { Qiandao = 2; result = "success"; message = "签到成功!"; } } dates = "\"QianDao\":" + Qiandao.ToString() + ",\"Param\":" + Param.ToString() + ""; SendResponse(context, result, message, dates); }
public string Treetext(int uid) { string treeTxte = ""; lgk.Model.tb_user Model = new lgk.Model.tb_user(); AllCore allcore = new AllCore(); if (userBLL.GetModel(uid) == null) { return(null); } Model = userBLL.GetModel(uid); string LevelName = ""; if (Model.LevelID == 0) { LevelName = "无等级"; } else { LevelName = levelBLL.GetModel(Model.LevelID).LevelName; } string dd = ""; // decimal allEmoney = 0; // allEmoney =userBLL.GetEmeony(uid); if (Model.IsOpend == 0) { if (allcore.GetLanguage("LoginLable") == "zh-cn") { dd = "[<span style='color:red;'>未开通</span>]"; } else { dd = "[<span style='color:red;'>Not Yet Opened</span>]"; } } else if (Model.IsOpend == 2) { if (allcore.GetLanguage("LoginLable") == "zh-cn") { dd = "已开通"; } else { dd = "[Opened]"; } } if (uid == 2) { return(null); } else { string enlevel = ""; if (Model.LevelID == 0) { enlevel = "无等级"; } else { enlevel = levelBLL.GetModel(Model.LevelID).LevelName; } if (allcore.GetLanguage("LoginLable") == "zh-cn") { if (userBLL.GetLocation(Model.UserID) > 1) { treeTxte = Model.UserCode + "[" + Model.TrueName + "] " + dd; } else { treeTxte = Model.UserCode + "[" + Model.TrueName + "]" + dd; } //treeTxte = Model.UserCode + "[姓名:" + Model.TrueName + " | 级别:" + enlevel + " | 状态:" + dd + ""; } else { //string enlevel = levelBLL.GetModel(Model.LevelID).level03; if (userBLL.GetLocation(Model.UserID) > 1) { treeTxte = Model.UserCode + "[" + Model.TrueName + "]" + dd; } else { treeTxte = Model.UserCode + "[" + Model.TrueName + "]" + dd; } //treeTxte = Model.UserCode + "[姓名:" + Model.TrueName + " | 级别:" + enlevel + " | 状态:" + dd + ""; } //node.NavigateUrl = "RecommendTree.aspx?userid=" + Model.UserID; } return(treeTxte); }
/// <summary> /// 忘记密码 /// </summary> /// <param name="context"></param> /// <returns></returns> private string VerifySmsCode(HttpContext context) { bool flag = false; string msg = string.Empty; long iVerID = 0; AllCore core = new AllCore(); string usercode = context.Request["usercode"] ?? ""; //账号 string strcode = context.Request["code"] ?? ""; //验证码 string strtype = context.Request["type"] ?? ""; //验证码类别 string strpwd = context.Request["pwd"] ?? ""; //新密码 LogHelper.SaveLog(usercode + "," + strcode + "," + strtype + "," + strpwd, ""); int itype = 0; if (string.IsNullOrEmpty(usercode)) { msg = "登录账号为空"; } else if (string.IsNullOrEmpty(strpwd)) { msg = "新密码为空"; } else { lgk.Model.tb_user userModel = core.userBLL.GetModelByUserCode(usercode);// if (userModel == null) { msg = "用户不存在"; } else if (string.IsNullOrEmpty(strcode)) { msg = "手机验证码为空"; } else if (string.IsNullOrEmpty(strtype)) { msg = "验证码类别为空"; } else if (!int.TryParse(strtype, out itype)) { msg = "验证码类别无效"; } //else if (itype > 2 || itype < 1) //{ // msg = "验证码类别无效"; //} else { //短信验证 long checkResult = core.CheckSMSCode(userModel.PhoneNum, strcode, int.Parse(strtype)); if (checkResult < 0) { return(ResultJson(ResultType.error, "验证码无效.", "")); } if (itype == 1) { userModel.Password = strpwd.ToUpper();//登录密码 } else if (itype == 2) { userModel.SecondPassword = strpwd.ToUpper();//登录密码 } else if (itype == 3) { userModel.Password = strpwd.ToUpper();//登录密码 } if (core.userBLL.Update(userModel)) { flag = true; if (iVerID > 0) { core.smsBLL.UpdateState(iVerID, 1);//已验证 } msg = "修改成功"; } else { msg = "修改失败"; } } } if (flag == true) { return(ResultJson(ResultType.success, msg, "")); } else { return(ResultJson(ResultType.error, msg, "")); } }
/// <summary> /// 输入验证 /// </summary> /// <returns></returns> protected bool RegValidate() { lgk.Model.tb_user recommendInfo = new lgk.Model.tb_user(); //lgk.Model.tb_user parentInfo = new lgk.Model.tb_user(); //lgk.Model.tb_agent agentInfo = new lgk.Model.tb_agent(); #region 会员编号验证 if (txtUserCode.Value.Trim() == "") { MessageBox.ShowBox(this.Page, GetLanguage("PleaseNumber"), Library.Enums.ModalTypes.warning);//请输入会员编号 return(false); } //if (!PageValidate.checkUserCode(txtUserCode.Value.Trim())) //{ // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("MemberNumber") + "');", true);//会员编号必须由6-10位的英文字母或数字组成 // return false; //} if (GetUserID(txtUserCode.Value.Trim()) > 0) { MessageBox.ShowBox(this.Page, GetLanguage("Memberexists"), Library.Enums.ModalTypes.info);//该会员编号已存在,请重新输入! return(false); } #endregion if (txtNiceName.Value.Trim() == "") { MessageBox.ShowBox(this.Page, GetLanguage("Nickname"), Library.Enums.ModalTypes.warning);//会员昵称不能为空 return(false); } #region 密码验证 if (txtPassword.Value.Trim() == "") { MessageBox.ShowBox(this.Page, GetLanguage("PasswordISNull"), Library.Enums.ModalTypes.warning);//登录密码不能为空 return(false); } //if (txtPassword.Value.Trim().Length < 6) //{ // MessageBox.ShowBox(this.Page, GetLanguage("PasswordLength"), Library.Enums.ModalTypes.warning);//密码长度不能小于6位 // return false; //} if (txtRegPassword.Value.Trim() == "") { MessageBox.ShowBox(this.Page, GetLanguage("ConfirmPasswordISNull"), Library.Enums.ModalTypes.warning);//确认密码不能为空 return(false); } if (!txtPassword.Value.Trim().Equals(txtRegPassword.Value.Trim())) { MessageBox.ShowBox(this.Page, GetLanguage("TwoPasswordMatch"), Library.Enums.ModalTypes.warning);//两次输入的登录密码不一致 return(false); } if (txtSecondPassword.Value.Trim() == "") { MessageBox.ShowBox(this.Page, GetLanguage("SecondaryISNUll"), Library.Enums.ModalTypes.warning);//二级密码不能为空 return(false); } if (txtRegSecondPassword.Value.Trim() == "") { MessageBox.ShowBox(this.Page, GetLanguage("secondaryPasswordISNull"), Library.Enums.ModalTypes.warning);//确认二级密码不能为空 return(false); } if (!txtSecondPassword.Value.Trim().Equals(txtRegSecondPassword.Value.Trim())) { MessageBox.ShowBox(this.Page, GetLanguage("TwoSecondaryMatch"), Library.Enums.ModalTypes.warning);//两次输入的二级密码不一致 return(false); } #endregion #region 银行验证 //string strBankAccount = this.txtBankAccount.Value.Trim(); //if (txtAlipay.Value.Trim() == "" && string.IsNullOrEmpty(strBankAccount)) //{ // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("AlipayAccount") + "');", true);//支付宝账号不能为空 // return false; //} //if (!string.IsNullOrEmpty(strBankAccount) && !PageValidate.RegexTrueBank(this.txtBankAccount.Value) && string.IsNullOrEmpty(txtAlipay.Value.Trim())) //{ // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("BankCardErrors") + "');", true);//银行卡号输入错误 // return false; //} //string strBankAccountUser = this.txtBankAccountUser.Value.Trim(); //if (!string.IsNullOrEmpty(strBankAccountUser) && !PageValidate.RegexTrueName(txtBankAccountUser.Value.Trim()) && string.IsNullOrEmpty(txtAlipay.Value.Trim())) //{ // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("NameMust") + "');", true);//开户名必须为2-30个中英文 // return false; //} #endregion #region 推荐人验证 string reName = this.txtRecommendCode.Value.Trim(); if (string.IsNullOrEmpty(reName)) { MessageBox.ShowBox(this.Page, GetLanguage("ReferenceNumberIsnull"), Library.Enums.ModalTypes.warning);//推荐人编号不能为空 return(false); } else { recommendInfo = userBLL.GetModel(GetUserID(reName));//推薦用户 if (recommendInfo == null) { MessageBox.ShowBox(this.Page, GetLanguage("featuredNotExist"), Library.Enums.ModalTypes.warning);//该推荐会员不存在 return(false); } if (recommendInfo.IsOpend == 0) { MessageBox.ShowBox(this.Page, GetLanguage("MemberISNull"), Library.Enums.ModalTypes.warning);//该会员尚未开通,不能作为推荐会员 return(false); } } #endregion //if (radioRegQy.SelectedValue == "") //{ // MessageBox.ShowBox(this.Page, "请选择注册区域", Library.Enums.ModalTypes.warning);//会员昵称不能为空 // return false; //} #region 手机号码验证 var strPhoneNum = this.txtUserCode.Value.Trim(); if (!string.IsNullOrEmpty(strPhoneNum) && !PageValidate.RegexPhone(strPhoneNum)) { MessageBox.ShowBox(this.Page, GetLanguage("PhoneMust"), Library.Enums.ModalTypes.error);//联系电话格式错误 return(false); } int userid = GetUserIDbByPhone(strPhoneNum); if (userid > 0) { MessageBox.ShowBox(this.Page, GetLanguage("PhoneRegExists"), Library.Enums.ModalTypes.info);//该手机号码已注册 return(false); } int ct = GetPhoneNumber(strPhoneNum); // int p_phoneNumer = getParamInt("RegisterPhoneNumber"); if (ct >= 1) { MessageBox.ShowBox(this.Page, string.Format(GetLanguage("RegisterPhoneNumber")), Library.Enums.ModalTypes.warning);//该手机号码已注册 return(false); } //身份证判断 AllCore ac = new AllCore(); if (txtIDNumber.Value.Trim().Length < 15 && txtIDNumber.Value.Trim().Length > 18) { MessageBox.ShowBox(this.Page, string.Format("请输入正确的身份证号码!"), Library.Enums.ModalTypes.warning);//请输入正确的身份证号码 return(false); } ct = ac.GetIDCodeNumber(txtIDNumber.Value.Trim()); if (ct >= 1) { MessageBox.ShowBox(this.Page, string.Format(ac.GetLanguage("RegisterIDCodeNumber")), Library.Enums.ModalTypes.warning);//该身份证号注册 return(false); } //服务中心判断 var agentcode = Agent.Value.Trim(); int ID = ac.agentBLL.GetAgentsIDByUserCode(agentcode); if (ID == 0) //服务中心 { MessageBox.ShowBox(this.Page, string.Format("该服务中心不存在!"), Library.Enums.ModalTypes.warning); //请输入正确的身份证号码 return(false); } if (ac.agentBLL.GetModel(ID).Flag == 2) { MessageBox.ShowBox(this.Page, string.Format("该服务中心已被冻结!"), Library.Enums.ModalTypes.warning);//请输入正确的身份证号码 return(false); } #endregion #region 密保问题验证 //if (dropQuestion.SelectedValue.Trim() == "0") //{ // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseSelectQuestion") + "');", true);//请选择密保问题 // return false; //} //if (string.IsNullOrEmpty(txtAnswer.Text)) //{ // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('" + GetLanguage("PleaseAnswer") + "');", true);//请输入密保答案 // return false; //} #endregion #region 商务中心 //int iAgentOpend = getParamInt("AgentSwith");//商务中心是否开启 //if (!string.IsNullOrEmpty(txtAgent.Value.Trim())) //{ // if (iAgentOpend == 1) // { // bool isagent = agentBLL.isExistByName(txtAgent.Value.Trim()); // if (!isagent) // { // MessageBox.ShowBox(this.Page, GetLanguage("AgentNumberExist"), Library.Enums.ModalTypes.warning);//商务中心编号不存在 // return false; // } // } //} //decimal regopen = getParamAmount("RegOpen"); //if(LoginUser.Emoney < regopen) //{ // MessageBox.ShowBox(this.Page, GetLanguage("RegOpenMust"), Library.Enums.ModalTypes.warning);//注册积分不足 // return false; //} #endregion return(true); }
public string Treetext(int uid) { AllCore allcore = new AllCore(); string treeTxte = ""; lgk.Model.tb_user Model = userBLL.GetModel(uid); if (Model == null) { return(null); } string dd = ""; // decimal allEmoney = 0; // allEmoney =userBLL.GetEmeony(uid); //if (Model.IsOpend == 0) //{ // if (allcore.GetLanguage("LoginLable") == "zh-cn") // { // dd = "[<span style='color:red;'>未激活</span>]"; // } // else // { // dd = "[<span style='color:red;'>Not Yet Actived</span>]"; // } //} //else if (Model.IsOpend == 2) //{ // if (allcore.GetLanguage("LoginLable") == "zh-cn") // { // dd = "已激活"; // } // else // { // dd = "[Active]"; // } //} if (uid == 0) { return(null); } else { string enlevel = ""; if (Model.LevelID == 0) { enlevel = "无等级"; } else { enlevel = levelBLL.GetModel(Model.LevelID).LevelName; } if (allcore.GetLanguage("LoginLable") == "zh-cn") { treeTxte = Model.UserCode + "[" + Model.NiceName + "][" + enlevel + "]" + dd; //treeTxte = Model.UserCode + "[姓名:" + Model.TrueName + " | 级别:" + enlevel + " | 状态:" + dd + ""; } else { enlevel = levelBLL.GetModel(Model.LevelID).level03; treeTxte = Model.UserCode + "[" + Model.NiceName + "][" + enlevel + "]" + dd; //treeTxte = Model.UserCode + "[姓名:" + Model.TrueName + " | 级别:" + enlevel + " | 状态:" + dd + ""; } //node.NavigateUrl = "RecommendTree.aspx?userid=" + Model.UserID; } return(treeTxte); }
public void ProcessRequest(HttpContext context) { string result = "error"; string message = ""; string dates = ""; string strID = context.Request["ID"]; string strUserID = context.Request["UserID"]; decimal Money = 0; long ID = 0; long UserID = 0; if (string.IsNullOrEmpty(strID) || strID.Trim() == string.Empty || string.IsNullOrEmpty(strUserID) || strUserID.Trim() == string.Empty) { message = "账号不存在"; SendResponse(context, result, message, dates); return; } try { ID = long.Parse(strID); UserID = long.Parse(strUserID); } catch (Exception) { ID = 0; UserID = 0; message = "账号不存在"; SendResponse(context, result, message, dates); } AllCore core = new AllCore(); lgk.Model.tb_user userModel = core.userBLL.GetModel(UserID); SqlConnection conn = new SqlConnection(sconn); conn.Open(); string sql = string.Format("select ID,RandMoney from tb_Rand where ID=" + ID + " and Flag=0 and UserID= '" + UserID + "' ;"); SqlDataAdapter da = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); da.Fill(dt); conn.Close(); if (dt.Rows.Count > 0) { Money = decimal.Parse(dt.Rows[0]["RandMoney"].ToString()); conn.Open(); string sql_1 = "update tb_Rand set Flag=2,ClickTime=getdate() where ID='" + ID + "' and UserID= '" + UserID + "';update tb_user set BonusAccount+='" + Money + "' where UserID= '" + UserID + "'; "; SqlCommand cmd = new SqlCommand(sql_1, conn); int reInt = cmd.ExecuteNonQuery(); conn.Close(); if (reInt > 0) { AllCore AC = new AllCore(); var model = AC.userBLL.GetModel(UserID); dates = "\"Account\":{\"Emoney\":\"" + model.Emoney.ToString() + "\",\"BonusAccount\":\"" + model.BonusAccount.ToString() + "\",\"ShengYuSuanLi\":\"" + Convert.ToInt32(model.User012) + "\"}"; result = "success"; message = "领取成功!"; //明细记录 var Mjournal = new lgk.Model.tb_journal(); lgk.BLL.tb_journal Bjournal = new lgk.BLL.tb_journal(); Mjournal.UserID = UserID; Mjournal.InAmount = Money; Mjournal.OutAmount = 0; Mjournal.Remark = "领取奖励分 "; Mjournal.RemarkEn = "Collect " + Money + " clouds"; Mjournal.JournalType = 2; Mjournal.BalanceAmount = model.BonusAccount; Mjournal.JournalDate = DateTime.Now; Bjournal.Add(Mjournal); //奖项记录 lgk.Model.tb_bonus Mbonus = new lgk.Model.tb_bonus(); lgk.BLL.tb_bonus Bbonus = new lgk.BLL.tb_bonus(); Mbonus.AddTime = DateTime.Now; Mbonus.TypeID = 1; Mbonus.IsSettled = 1; Mbonus.FromUserID = UserID; Mbonus.Amount = Money; Mbonus.UserID = UserID; Mbonus.Source = "领取奖励分 "; Mbonus.sf = Money; Mbonus.SourceEn = "Collect " + Money + " clouds"; Mbonus.SttleTime = DateTime.Now; Bbonus.Add(Mbonus); //如果冻结奖励分账户大于0,激活矿机时转入明细 if (userModel.User016 > 0) { core.UpdateAccount("User016", userModel.UserID, userModel.User016, 0); // core.UpdateAccount("BonusAccount", userModel.UserID, userModel.User016, 1); // lgk.Model.tb_journal jourInfo = new lgk.Model.tb_journal(); jourInfo.UserID = userModel.UserID; jourInfo.Remark = "奖励分账户进账,冻结奖励分转入奖励分账户"; jourInfo.RemarkEn = "Cash withdrawal"; jourInfo.InAmount = userModel.User016; jourInfo.OutAmount = 0; jourInfo.BalanceAmount = core.userBLL.GetMoney(UserID, "BonusAccount"); jourInfo.JournalDate = DateTime.Now; jourInfo.JournalType = (int)Library.AccountType.奖励分; jourInfo.Journal01 = userModel.UserID; core.journalBLL.Add(jourInfo); } SendResponse(context, result, message, dates); //差一条记录 } } message = "已经领取过"; SendResponse(context, result, message, dates); }
public void ProcessRequest(HttpContext context) { string result = "error"; string message = "暂无数据"; string dates = ""; string User = context.Request["UserID"]; string Page_1 = context.Request["Page"]; string Mumber_1 = context.Request["Mumber"]; int Page = 0; int Mumber = 0; long UserID = 0; if (string.IsNullOrEmpty(User) || User.Trim() == string.Empty) { message = "账号不存在"; SendResponse(context, result, message, dates); return; } try { UserID = long.Parse(User); } catch (Exception) { UserID = 0; } try { Page = int.Parse(Page_1); Mumber = int.Parse(Mumber_1); } catch (Exception) { message = "页码错误!"; SendResponse(context, result, message, dates); } if (Page == 0) { Page = 1; } int Start = (Page - 1) * Mumber; int YM = Page * Mumber; AllCore AC = new AllCore(); var model = AC.userBLL.GetModel(UserID);//-查询是否有这个人。 if (model == null) { message = "账号不存在"; SendResponse(context, result, message, dates); return; } SqlConnection conn = new SqlConnection(sconn); conn.Open(); string sql = string.Format("select ROW_NUMBER()OVER(ORDER BY ID desc )Rank,* from (select ID,RandMoney,ClickTime from tb_Rand where UserID=" + UserID + " and Flag=2 )a order by ID desc ;"); SqlDataAdapter da = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); da.Fill(dt); conn.Close(); dates += "\"NotesList\":["; decimal dd = dt.Rows.Count / Mumber; int yu = dt.Rows.Count % Mumber; int GG = 0; if (YM > dt.Rows.Count)//最后一页处理 { if (YM - dt.Rows.Count > Mumber) { GG = 1; } Page = (int)Math.Floor(dd); Start = Mumber * Page; Mumber = yu; } if (yu > 0) { dd += 1; } if (dt.Rows.Count > 0) { if (GG == 1) { Mumber = 0; } for (int i = Start; i < Start + Mumber; i++) { if (Mumber == 1) { dates += "{\"ID\":\"" + dt.Rows[i]["ID"].ToString() + "\",\"RandMoney\":\"" + dt.Rows[i]["RandMoney"].ToString() + "\",\"ClickTime\":\"" + dt.Rows[i]["ClickTime"].ToString() + "\"}"; continue; } if (i == Start + Mumber - 1) { dates += "{\"ID\":\"" + dt.Rows[i]["ID"].ToString() + "\",\"RandMoney\":\"" + dt.Rows[i]["RandMoney"].ToString() + "\",\"ClickTime\":\"" + dt.Rows[i]["ClickTime"].ToString() + "\"}"; continue; } if (Mumber > 1) { dates += "{\"ID\":\"" + dt.Rows[i]["ID"].ToString() + "\",\"RandMoney\":\"" + dt.Rows[i]["RandMoney"].ToString() + "\",\"ClickTime\":\"" + dt.Rows[i]["ClickTime"].ToString() + "\"},"; } } result = "success"; message = "查询成功"; } dates += "]"; dates += ",\"CountPage\":" + dd + ""; SendResponse(context, result, message, dates); }