//private void ddlL() //{ // IList<lgk.Model.tb_level> ddlList = new lgk.BLL.tb_level().GetModelList("LevelID<=7"); // string strUserCode = txtUserCode1.Text.Trim(); // if(strUserCode!=""&&GetUserID(strUserCode)>0) // { // int i = userBLL.GetModel(GetUserID(strUserCode)).LevelID;//当前会员等级 // ddlList = ddlList.Where(o => o.LevelID > i).ToList(); // } // ddlLevel.Items.Clear(); // ListItem li = new ListItem(); // li.Value = "0"; // li.Text = "-请选择-"; // ddlLevel.Items.Add(li); // foreach (lgk.Model.tb_level item in ddlList) // { // ListItem items = new ListItem(); // items.Value = item.LevelID.ToString(); // items.Text = item.LevelName; // ddlLevel.Items.Add(items); // } //} //#region 判断用户是否为最高级别 //public void heightClassHand() //{ // int levlId = 7;//levbll.GetMaxId(); // string strUserCode = txtUserCode1.Text.Trim(); // if(strUserCode!=""&&userBLL.GetModel(GetUserID(strUserCode))!=null) // { // int LevelID = userBLL.GetModel(GetUserID(strUserCode)).LevelID; // if (levlId != 0) // { // if (LevelID >= levlId) // { // Literal1.Text = GetLanguage("highestLevel");//您当前已是最高级别 // btnSubmit.Visible = false; // } // } // } // else // { // return; // } //} //#endregion //private void bind_pro() //{ // string strWhere = " 1=1 ";//1 会员晋升 2 开通服务中心 // if (mk==0) // { // bind_repeater(GetProList(strWhere), Repeater1, "AddDate desc", tr1, AspNetPager1); // } // else if(mk==1) // { // if(txtUserCode1.Text!="") // { // strWhere += " and u.usercode like '%" + txtUserCode1.Text.Trim() + "%'"; // bind_repeater(GetProList(strWhere), Repeater1, "AddDate desc", tr1, AspNetPager1); // } // } // else if(mk==2) // { // string StarTime = this.txtStar.Text.Trim(); // string EndTime = this.txtEnd.Text.Trim(); // if (txtUserCode.Text!="") // { // strWhere += " and u.usercode like '%" + txtUserCode.Text.Trim() + "%'"; // if (StarTime != "") // { // strWhere += string.Format(" and Convert(nvarchar(10),p.AddDate,120) >= '" + StarTime + "'"); // } // if (EndTime != "") // { // strWhere += string.Format(" and Convert(nvarchar(10),p.AddDate,120) <= '" + EndTime + "'"); // } // bind_repeater(GetProList(strWhere), Repeater1, "AddDate desc", tr1, AspNetPager1); // } // else if(StarTime!=""&&EndTime!="") // { // strWhere += string.Format(" and Convert(nvarchar(10),p.AddDate,120) >= '" + StarTime + "'"); // strWhere += string.Format(" and Convert(nvarchar(10),p.AddDate,120) <= '" + EndTime + "'"); // bind_repeater(GetProList(strWhere), Repeater1, "AddDate desc", tr1, AspNetPager1); // } // else // { // return; // } // } // //if (txtUserCode.Text != "") // //{ // // strWhere += " and u.usercode like '%" + txtUserCode.Text.Trim() + "%'"; // //} // //bind_repeater(GetProList(strWhere), Repeater1, "AddDate desc", tr1, AspNetPager1); //} //private void bind_pro1() //{ // string strWhere = " 1=1"; // if(txtUserCode1.Text!="") // { // strWhere += " and u.usercode like '%" + txtUserCode1.Text.Trim() + "%'"; // } // bind_repeater(GetProList(strWhere),Repeater1,"AddDate desc",tr1,AspNetPager1); //} //protected void btnSearch_Click(object sender, EventArgs e) //{ // this.label1.Text = "搜索"; // bind_pro(); //} //protected void btnSubmit_Click(object sender, EventArgs e) //{ // string usercode = txtUserCode1.Text.Trim(); // if (sender==btnSubmit) // { // mk = 1; //标出Button_Click事件触发者 1-点击提交/确认按钮 2-点击查询/搜索按钮 // if (usercode == "") // { // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('请输入要晋升的会员编号!');", true); // return; // } // lgk.Model.tb_user userInfo = userBLL.GetModel(GetUserID(usercode)); // if (userInfo == null) // { // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该会员不存在!');", true); // return; // } // lgk.Model.tb_userPro userpro = proBLL.GetModelByUserID(Convert.ToInt32(userInfo.UserID)); // if (userInfo.IsOpend == 0) // { // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该会员尚未开通,请开通后再进行此操作!');", true); // return; // } // if (userpro != null) // { // if (userpro.Flag == 0) // { // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('该会员尚有申请未审核!');", true); // return; // } // } // int endLevel = Convert.ToInt32(ddlLevel.SelectedValue.Trim()); // if (endLevel == 0) // { // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('请选择晋升级别!');", true); // return; // } // if (endLevel <= userInfo.LevelID) // { // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('请选择高于当前会员的等级!');", true); // return; // } // decimal money = getParamAmount("Level" + ddlLevel.SelectedValue); // if (userInfo != null) // { // //记录升级表 // lgk.Model.tb_userPro upModel = new lgk.Model.tb_userPro(); // upModel.UserID = Convert.ToInt32(userInfo.UserID); // upModel.LastLevel = userInfo.LevelID; // upModel.Remark = "后台晋升"; // upModel.Flag = 0; // upModel.ProMoney = money; // if (userInfo.StockAccount >= money) // { // upModel.Pro003 = userInfo.StockAccount - upModel.ProMoney;//所剩奖金积分(此时为月静态钱包奖金积分) // upModel.Pro001 = 1; //扣除的奖金积分类型( 1表示月静态钱包奖金积分 2表示月动态钱包奖金积分 ) // } // else if (userInfo.StockMoney >= money) // { // upModel.Pro003 = userInfo.StockMoney - upModel.ProMoney;//所剩奖金积分(此时为月分红动态钱包奖金积分) // upModel.Pro001 = 2; //扣除的奖金积分类型( 1表示月静态钱包奖金积分 2表示月动态钱包奖金积分 ) // } // else // { // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('您的奖金积分不足,无法晋升');", true);//奖金积分不足,无法晋升 // return; // } // upModel.EndLevel = endLevel; // upModel.AddDate = DateTime.Now; // upModel.FlagDate = DateTime.Now; // //upModel.Pro008 = "1";//1会员晋升 2 服务中心 // if (proBLL.Add(upModel) > 0) // { // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('升级申请成功!请等待审核..');window.location.href='ProManage.aspx';", true); // return; // } // else // { // ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('会员升级申请失败!');", true); // return; // } // } // else // { // MessageBox.MyShow(this, "该会员不存在!"); // } // //this.label1.Text = "提交"; // bind_pro(); // } // else if(sender==btnSearch) // { // mk = 2; // if(txtUserCode.Text==""&&txtStar.Text.Trim()==""&&txtEnd.Text.Trim()=="") // { // MessageBox.MyShow(this, "请输入会员编号或选择查询时间!"); // } // bind_pro(); // } //} /// <summary> /// 申请记录查询条件 /// </summary> /// <returns></returns> private string GetWhere() { string UC = SafeHelper.GetSafeSqlandHtml(txtUserCode.Text.Trim()); string strWhere = ""; string strStartTime = txtStart.Text.Trim(); string strEndTime = txtEnd.Text.Trim(); strWhere = " u.IsOpend=2 and r.Remit001=3 and p.EndLevel=r.Remit002"; if (UC != "") { strWhere += " and u.UserCode='" + UC + "'"; } if (strStartTime != "" && strEndTime == "") { strWhere += string.Format(" and Convert(nvarchar(10),r.AddDate,120) >= '" + strStartTime + "'"); } else if (strStartTime == "" && strEndTime != "") { strWhere += string.Format(" and Convert(nvarchar(10),r.AddDate,120) <= '" + strEndTime + "'"); } else if (strStartTime != "" && strEndTime != "") { strWhere += string.Format(" and Convert(nvarchar(10),r.AddDate,120) between '" + strStartTime + "' and '" + strEndTime + "'"); } return(strWhere); }
/// <summary> /// 分页控件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void anpReply_PageChanged(object sender, EventArgs e) { if (Request.QueryString["id"] != "") { BindReply(SafeHelper.GetSafeSqlandHtml(Request.QueryString["id"])); } }
public UserResult Login(string userID, string password) { UserResult result = null; string pwd = SafeHelper.EncryptDES(password, userID); bool isExist = SqlHelper.Exists <HrEmploy>(H => H.UserID == userID && H.PassWord == pwd); if (!isExist) { throw AjaxException.ToException(ErrorCode.VErrorCode, "用户名或密码错误!"); } Core.Server.ISessionServer sessionServer = SessionFactory.GetSessionServer(); sessionServer.RegSession(userID, password); HrEmploy userInfo = (DbFactory.DbSession.DbContext as CrmEntities).HrEmploy.FirstOrDefault(H => H.UserID == userID && H.PassWord == pwd); int timeOut = sessionServer.Timeout; DateTime expires = DateTime.Now; expires = expires.AddMinutes(timeOut); if (userInfo != null) { result = new UserResult { id = userInfo.UserID, User = userInfo.ToAjaxResult(), Expires = expires }; } return(result); }
/// <summary> /// 搜索条件 /// </summary> /// <returns></returns> private string getWhere() { StarTime = this.txtStart.Text.Trim(); EndTime = this.txtEnd.Text.Trim(); strWhere = string.Format(" buytype = 1"); if (this.usercode.Text != "") { strWhere += " and usercode like'%" + SafeHelper.GetSafeSqlandHtml(this.usercode.Text.Trim()) + "%' "; } if (StarTime != "" && EndTime == "") { strWhere += string.Format(" and Convert(nvarchar(10),RechargeDate,120) >= '" + StarTime + "' "); } else if (StarTime == "" && EndTime != "") { strWhere += string.Format(" and Convert(nvarchar(10),RechargeDate,120) <= '" + EndTime + "' "); } else if (StarTime != "" && EndTime != "") { strWhere += string.Format(" and Convert(nvarchar(10),RechargeDate,120) between '" + StarTime + "' and '" + EndTime + "' "); } return(strWhere); }
protected void btnSubmit_Click(object sender, EventArgs e) { lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(iOrderID); if (cashorderInfo.SUserID == iUserID && cashorderInfo.SStatus == 0 && cashorderInfo.BStatus == 1 && cashorderInfo.IsFeedback == 0) { cashorderBLL.Feedback(cashorderInfo.OrderID, SafeHelper.GetSafeSqlandHtml(txtReason.Text.Trim()), DateTime.Now);//反馈 #region 短信通知 lgk.BLL.SMS smsBLL = new lgk.BLL.SMS(); lgk.Model.SMS smsModel = new lgk.Model.SMS(); //给卖家发短信通知已付款 // SCode --1:出局短信 2:买家点击已付款 3:卖家点击已收款 4:卖家点击未收款 var user = userBLL.GetModel(cashorderInfo.SUserID); smsModel.ToUserID = cashorderInfo.SUserID; smsModel.ToUserCode = user.UserCode; smsModel.ToPhone = user.PhoneNum; smsModel.PublishTime = DateTime.Now; smsModel.ValidTime = DateTime.Now.AddMinutes(5); smsModel.SendNum = 0; smsModel.SMSContent = cashorderInfo.OrderCode; smsModel.IsValid = 1; smsModel.IsDeleted = 0; smsModel.SCode = "4"; smsModel.TypeID = 0; smsBLL.Add(smsModel); #endregion MessageBox.ShowBox(this.Page, GetLanguage("FeedbackSuccess"), Library.Enums.ModalTypes.success, "CashOrderList.aspx");//反馈成功 } }
public async Task <UserModel> Login([FromForm] UserParam param) { string md5pwd = SafeHelper.MD5TwoEncrypt(param.PassWord); UserInfo userInfo = await _userService.QueryEntity(u => u.UserName == param.UserName && u.PassWord == md5pwd); if (userInfo == null) { throw new UserFriendlyException("用户名或密码错误"); } JwtModel jwtModel = new JwtModel { Uid = userInfo.Id, //Role = "admin" }; string jwtStr = JwtHelper.IssueJwt(jwtModel); return(new UserModel { Token = jwtStr, UserId = userInfo.HexId, UserName = userInfo.UserName, NickName = userInfo.NickName, AvatarUrl = userInfo.AvatarUrl, }); }
public void BindData() { string isearch = SafeHelper.NoHtml((Request.QueryString["st"])); ltSearch.Text = isearch; string strOrderBy = ""; string strSort = ViewState["ItemListSort"].ToString(); if (strSort == "1") { if (dropSort.SelectedValue == "1") { strOrderBy = "[AddTime] desc"; } else if (dropSort.SelectedValue == "2") { strOrderBy = "[RealityPrice] desc"; } else if (dropSort.SelectedValue == "3") { strOrderBy = "[RealityPrice] asc"; } } else if (strSort == "2") { if (dropSell.SelectedValue == "1") { strOrderBy = "[SaleNum] desc"; } } bind_repeater(goodsBLL.GetList(1000, "g.Goods001=1 and g.Goods003=0 and g.GoodsName like '%" + isearch + "%'", strOrderBy), Repeater1, "AddTime desc", li1, AspNetPager1); }
public async Task <JsonResult> LoginOn(ChineseViewModel userInfo) { var data = new AjaxOption <ChineseViewModel>(); #region 验证系列 if (userInfo == null || userInfo.PawName.IsNullOrWhiteSpace() || userInfo.PawPass.IsNullOrWhiteSpace()) { data.Msg = "用户名或密码错误!"; return(Json(data)); } var list = await ChinesInfoBLL.QueryAsync("select top 1 PawGid,PawName,PawPass,PawCreateTime,PawEmail from ChineseInfo where PawName=@PawName and PawDataStatus=1", new { PawName = userInfo.PawName }); if (!list.ExistsData()) { data.Msg = "用户名不存在!"; return(Json(data)); } var model = list.FirstOrDefault(); userInfo.PawPass = SafeHelper.GetShaOne(userInfo.PawPass); if (userInfo.PawPass != model.PawPass) { data.Msg = "密码错误!"; return(Json(data)); } Session["PawChina"] = model;//设置Session #endregion data.Status = true; return(Json(data)); }
public async Task <LoginViewModel> Login([FromBody] LoginParam param) { string md5pwd = SafeHelper.MD5TwoEncrypt(param.PassWord); T_UserInfo userInfo = await _userService.FindAsync(u => u.UserName == param.UserName && u.PassWord == md5pwd); if (userInfo == null) { throw new UserFriendlyException("用户名或密码错误"); } JwtModel jwtModel = new JwtModel { IsAdmin = userInfo.IsAdmin, UserId = userInfo.Id, NickName = userInfo.NickName, UserName = userInfo.UserName, Expiration = TimeSpan.FromSeconds(60 * 60), Role = userInfo.IsAdmin ? string.Join(",", ConstInfo.ClientPolicy, ConstInfo.AdminPolicy) : ConstInfo.ClientPolicy }; var result = JwtHelper.BuildJwtToken(jwtModel); result.NickName = userInfo.NickName; result.AvatarUrl = userInfo.AvatarUrl; result.UseMdEdit = userInfo.UseMdEdit; return(result); }
/// <summary> /// 注册Session /// </summary> /// <param name="userID">用户名</param> /// <param name="password">密码</param> public void RegSession(string userID, string password) { string pwd = SafeHelper.EncryptDES(password, userID); string sessionId = string.Format("{0}.{1}", this.AppName, this.GetSessionID()); if (!SqlHelper.Exists <HrEmploy>(H => H.UserID == userID && H.PassWord == pwd)) { throw new Exception(string.Format("注册SessionID[{0}]失败", sessionId)); } if (!this.sessions.ContainsKey(sessionId)) { lock (lockObject) { HrEmploy info = DbFactory.DbSession.DbContext.Set <HrEmploy>().FirstOrDefault(H => H.UserID == userID && H.PassWord == pwd); SessionMode mode = new SessionMode { SessionID = sessionId, HrEmployee = info }; if (HttpContext.Current != null && HttpContext.Current.Session != null) { HttpContext.Current.Session[sessionId] = mode; } this.sessions.Add(sessionId, mode); } } }
//付款 public bool OrderPay(long userid, long orderid, string picpath, string remark, out string message) { var user = userBLL.GetModel(userid); if (user.IsLock == 1) { message = "账户已冻结,付款失败"; return(false); } lgk.Model.Cashorder cashorderInfo = cashorderBLL.GetModel(orderid); if (cashorderInfo == null) { message = "订单不存在"; return(false); } if (cashorderInfo.BUserID != userid) { message = "订单无效"; return(false); } if (cashorderInfo.BUserID == userid && cashorderInfo.SStatus == 0 && cashorderInfo.BStatus == 0) { remark = SafeHelper.GetSafeSqlandHtml(remark); cashorderBLL.Update(userid, cashorderInfo.OrderID, DateTime.Now, picpath, remark, 1);//付款 message = GetLanguage("Successful"); return(true); } message = "付款失败"; return(false); }
private string GetWhere() { string strWhere = " 1=1 "; string strUserCode = SafeHelper.NoHtml(txtInput.Value.Trim()); if (!string.IsNullOrEmpty(strUserCode)) { string strType = dropType.SelectedValue; if (strType == "1") { strWhere += " and u.usercode like '" + strUserCode + "%'"; } else if (strType == "2") { strWhere += " and u.AgentCode like '" + strUserCode + "%'"; } } #region 注册时间 string strStart = txtStart.Text.Trim(); string strEnd = txtEnd.Text.Trim(); if (strStart != "" && strEnd == "") { strWhere += string.Format(" and Convert(nvarchar(10),OrderDate,120) >= '" + strStart + "'"); } else if (strStart == "" && strEnd != "") { strWhere += string.Format(" and Convert(nvarchar(10),OrderDate,120) <= '" + strEnd + "'"); } else if (strStart != "" && strEnd != "") { strWhere += string.Format(" and Convert(nvarchar(10),OrderDate,120) between '" + strStart + "' and '" + strEnd + "'"); } #endregion return(strWhere); }
//购买记录 private string InvestList(HttpContext context) { int pageSize = 10; //默认每页返回记录数 int _pageindex; string userid = context.Request["userid"] ?? ""; string pageindex = context.Request["pageindex"] ?? ""; //页索引 string findkey = context.Request["findkey"] ?? ""; //搜索关键字 string message = string.Empty; long _userid = 0; int.TryParse(pageindex, out _pageindex); if (_pageindex <= 0) { _pageindex = 1; } if (string.IsNullOrEmpty(userid)) { return(ResultJson(ResultType.error, "请输入用户ID", "")); } if (!string.IsNullOrEmpty(findkey)) { findkey = SafeHelper.GetSafeSql(findkey); } long.TryParse(userid, out _userid); InvestService svc = new InvestService(); var result = svc.InvestList(_userid, _pageindex, pageSize, findkey); return(ResultJson(ResultType.success, message, result)); }
public override UserInfo BeforeInsert(UserInfo model) { //密码加密 model.PassWord = SafeHelper.MD5TwoEncrypt(model.PassWord); if (string.IsNullOrEmpty(model.NickName)) { model.NickName = model.UserName; } return(base.BeforeInsert(model)); }
private string GetAccountList(HttpContext context) { int pageSize = 10; //默认每页返回记录数 int _pageindex; int _type; string userid = context.Request["userid"] ?? ""; string pageindex = context.Request["pageindex"] ?? ""; //页索引 string findkey = context.Request["findkey"] ?? ""; //搜索关键字 string type = context.Request["type"] ?? ""; //类型 if (string.IsNullOrEmpty(userid)) { return(ResultJson(ResultType.error, "请输入用户ID", "")); } if (string.IsNullOrEmpty(pageindex)) { return(ResultJson(ResultType.error, "页索引不能为空", "")); } if (string.IsNullOrEmpty(type)) { return(ResultJson(ResultType.error, "类型不能为空", "")); } int.TryParse(pageindex, out _pageindex); if (_pageindex <= 0) { _pageindex = 1; } long _userid = 0; long.TryParse(userid, out _userid); int.TryParse(type, out _type); if (!string.IsNullOrEmpty(findkey)) { findkey = SafeHelper.GetSafeSql(findkey); } AccountService svc = new AccountService(); object result; if ("1".Equals(type)) { result = svc.AccountList(_userid, _pageindex, pageSize, findkey, _type); } else { result = svc.AccountYTList(_userid, _pageindex, pageSize, findkey, _type); } return(ResultJson(ResultType.success, "获取成功", result)); }
private string GetWhere() { string strWhere = ""; string strUserCode = SafeHelper.NoHtml(txtUserCode.Value.Trim()); if (!string.IsNullOrEmpty(strUserCode)) { strWhere += " u.usercode like '" + strUserCode + "%'"; } return(strWhere); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["id"] != "") { BindData(SafeHelper.GetSafeSqlandHtml(Request.QueryString["id"])); BindReply(SafeHelper.GetSafeSqlandHtml(Request.QueryString["id"])); if (Request.QueryString["type"] == "1") { UpdateState(Request.QueryString["id"]); } } } }
/// <summary> /// 回复 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnRepeat_Click(object sender, EventArgs e) { lgk.Model.tb_user user = LoginUser; lgk.Model.tb_leaveReMsg leaveReMsg = new lgk.Model.tb_leaveReMsg(); leaveReMsg.LeaveID = Convert.ToInt64(Request.QueryString["id"]); leaveReMsg.UserType = 1; leaveReMsg.UserID = user.UserID; leaveReMsg.UserCode = Page.User.Identity.Name; leaveReMsg.ReContent = SafeHelper.GetSafeSqlandHtml(this.txtPubContext.Text.Trim()); leaveReMsg.ReTime = DateTime.Now; if (leaveReMsgBLL.Add(leaveReMsg) > 0 && UpdateState(leaveReMsg.LeaveID, "IsReply") > 0) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('回复成功!');window.location.href='LeaveWordsDetail.aspx?id=" + Request.QueryString["id"] + "'", true); } else { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('回复失败!');", true); } }
protected void btnSub_Click(object sender, EventArgs e) { lgk.Model.tb_user user = new lgk.Model.tb_user(); user = userBLL.GetModel(" usercode='" + SafeHelper.GetSafeSqlandHtml(this.txtUserCode.Text.Trim()) + "' "); string usercode = txtUserCode.Text.Trim(); if (string.IsNullOrEmpty(usercode)) { MessageBox.MyShow(this, "请填写要充值的会员账号!"); return; } if (user == null) { MessageBox.MyShow(this, "该会员账号不存在!"); return; } string tMoney = this.txtMoney.Text.Trim(); if (string.IsNullOrEmpty(tMoney)) { MessageBox.MyShow(this, "充值数量不能为空!"); return; } int num = tMoney.ToInt(); int flag = proc_BuyMachine(user.UserID, num, 1); if (flag == 2) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('充值矿机成功');window.location.href='AddMachine.aspx';", true); return; } else { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('充值矿机失败!');", true); return; } }
/// <summary> /// 申请记录查询条件 /// </summary> /// <returns></returns> private string GetWhere() { string strWhere = "1=1"; var strTitle = SafeHelper.GetSafeSqlandHtml(this.txtTitle.Value.Trim()); if (!string.IsNullOrEmpty(strTitle)) { strWhere += " AND NewsTitle LIKE '%" + strTitle + "%'"; } string strStartTime = txtStart.Text.Trim(); string strEndTime = txtEnd.Text.Trim(); if (currentCulture == "en-us") { strStartTime = txtStartEn.Text.Trim(); strEndTime = txtEndEn.Text.Trim(); strWhere += " AND New01=1"; } else { strWhere += " AND New01=0"; } if (strStartTime != "" && strEndTime == "" && PageValidate.IsDateTime(strStartTime)) { strWhere += string.Format(" AND Convert(nvarchar(10),PublishTime,120) >= '" + strStartTime + "'"); } else if (strStartTime == "" && strEndTime != "" && PageValidate.IsDateTime(strEndTime)) { strWhere += string.Format(" AND Convert(nvarchar(10),PublishTime,120) <= '" + strEndTime + "'"); } else if (strStartTime != "" && strEndTime != "" && PageValidate.IsDateTime(strStartTime) && PageValidate.IsDateTime(strEndTime)) { strWhere += string.Format(" AND Convert(nvarchar(10),PublishTime,120) between '" + strStartTime + "' and '" + strEndTime + "'"); } return(strWhere); }
protected void btnSubmit_Click(object sender, EventArgs e) { if (txtTitle.Value == "") { MessageBox.ShowBox(this.Page, GetLanguage("TitleIsNull"), Library.Enums.ModalTypes.warning);//标题不能为空 return; } if (txtPubContext.Text == "") { MessageBox.ShowBox(this.Page, GetLanguage("ContentIsNull"), Library.Enums.ModalTypes.warning);//内容不能为空 return; } lgk.Model.tb_leaveMsg leaveMsg = new lgk.Model.tb_leaveMsg() { MsgTitle = SafeHelper.GetSafeSqlandHtml(txtTitle.Value), MsgContent = SafeHelper.GetSafeSqlandHtml(this.txtPubContext.Text.Trim()), LeaveTime = DateTime.Now, IsRead = 0, IsReply = 0, FromUserType = 1, UserID = LoginUser.UserID, UserCode = LoginUser.UserCode, FromIDIsDel = 0, ToIDIsDel = 0, ToUserID = 1, ToUserType = 2, ToUserCode = "admin" }; if (leaveMsgBLL.Add(leaveMsg) > 0) { MessageBox.ShowBox(this.Page, GetLanguage("SentSuccessfully"), Library.Enums.ModalTypes.success, "LeaveOut.aspx");//发送成功 } else { MessageBox.ShowBox(this.Page, GetLanguage("SendFailed"), Library.Enums.ModalTypes.error);//发送失败 } }
//激活列表 private string ActiveList(HttpContext context) { int pageSize = 10; //默认每页返回记录数 int _pageindex; string userid = context.Request["userid"] ?? ""; string pageindex = context.Request["pageindex"] ?? ""; //页索引 string findkey = context.Request["findkey"] ?? ""; //搜索关键字 string message = string.Empty; long _userid = 0; _pageindex = pageindex.ToInt(); if (_pageindex <= 0) { _pageindex = 1; } if (string.IsNullOrEmpty(userid)) { return(ResultJson(ResultType.error, "请输入用户ID", "")); } if (!string.IsNullOrEmpty(findkey)) { findkey = SafeHelper.GetSafeSql(findkey); } long.TryParse(userid, out _userid); InvestService svc = new InvestService(); var result = svc.ActiveList(_userid, _pageindex, pageSize, findkey); var info = svc.GetInfo(_userid); Dictionary <string, object> dict = new Dictionary <string, object>(); dict.Add("info", info); // dict.Add("list", result); // return(ResultJson(ResultType.success, message, dict)); }
public void ShowData() { string gID = SafeHelper.NoHtml(Request.QueryString["gid"]); long Igid = 0; if (long.TryParse(gID, out Igid)) { hdgid.Value = gID; hduid.Value = getLoginID().ToString(); lgk.Model.tb_goods gModel = goodsBLL.GetModel(Igid); if (gModel != null) { ltGoodsCode.Text = gModel.GoodsCode; ltGoodsName.Text = gModel.GoodsName; ltPrice.Text = gModel.Price.ToString(); ltRPrice.Text = gModel.RealityPrice.ToString(); ltKucun.Text = gModel.Goods002.ToString(); Image0.ImageUrl = "../../Upload/" + gModel.Pic1; ltRemark.Text = gModel.Remarks; } } }
/// <summary> ///查询条件 /// </summary> /// <returns></returns> private string GetWhere() { string strStart = txtStart.Text.Trim(); string strEnd = txtEnd.Text.Trim(); string usercode = SafeHelper.GetSafeSqlandHtml(this.txtUserCode.Value.Trim()); string strWhere = "IsOpend = 2"; strWhere += " AND (RecommendID = " + LoginUser.UserID + " OR RecommendPath LIKE '%" + LoginUser.RecommendPath + "-')"; #region 会员编号姓名 strWhere += " AND UserCode LIKE '%" + usercode + "%'"; #endregion if (GetLanguage("LoginLable") == "en-us") { strStart = txtStartEn.Text.Trim(); strEnd = txtEndEn.Text.Trim(); } #region 开通时间 if (strStart != "" && strEnd == "" && PageValidate.IsDateTime(strStart)) { strWhere += string.Format(" AND Convert(nvarchar(10),OpenTime,120) >= '" + strStart + "'"); } else if (strStart == "" && strEnd != "" && PageValidate.IsDateTime(strStart)) { strWhere += string.Format(" AND Convert(nvarchar(10),OpenTime,120) <= '" + strEnd + "'"); } else if (strStart != "" && strEnd != "" && PageValidate.IsDateTime(strStart) && PageValidate.IsDateTime(strEnd)) { strWhere += string.Format(" AND Convert(nvarchar(10),OpenTime,120) BETWEEN '" + strStart + "' AND '" + strEnd + "'"); } #endregion return(strWhere); }
//验证用户 protected bool ValidateUser(string userName, string password) { string encrypt = SafeHelper.MD5TwoEncrypt(password); return(false); }
protected void btnSub_Click(object sender, EventArgs e) { lgk.Model.tb_recharge Model = new lgk.Model.tb_recharge(); lgk.Model.tb_user user = new lgk.Model.tb_user(); user = userBLL.GetModel(" usercode='" + SafeHelper.GetSafeSqlandHtml(this.txtUserCode.Text.Trim()) + "' "); string usercode = txtUserCode.Text.Trim(); if (string.IsNullOrEmpty(usercode)) { MessageBox.MyShow(this, "请填写要充值的会员账号!"); return; } if (user == null) { MessageBox.MyShow(this, "该会员账号不存在!"); return; } //if (user.IsOpend == 0) //{ // MessageBox.MyShow(this, "会员未开通!"); // return; //} Model.UserID = user.UserID; if (Convert.ToInt32(dropMoneyType.SelectedValue) == 0) { MessageBox.MyShow(this, "请选择账户类型!"); return; } Model.RechargeType = Convert.ToInt32(dropMoneyType.SelectedValue); if (Convert.ToInt32(dropRechargeStyle.SelectedValue) == 0) { MessageBox.MyShow(this, "请选择充值类型!"); return; } Model.RechargeStyle = Convert.ToInt32(dropRechargeStyle.SelectedValue); string tMoney = this.txtMoney.Text.Trim(); if (string.IsNullOrEmpty(tMoney)) { MessageBox.MyShow(this, "充值金额不能为空!"); return; } else if (Convert.ToDecimal(tMoney) <= 0) { MessageBox.MyShow(this, "金额需大于零!"); return; } decimal reMoney = Convert.ToDecimal(tMoney); //加入流水账表 lgk.Model.tb_journal jmodel = new lgk.Model.tb_journal(); jmodel.UserID = Convert.ToInt32(user.UserID); jmodel.JournalDate = DateTime.Now; jmodel.JournalType = Model.RechargeType; jmodel.Remark = "后台充值" + AccountTypeHelper.GetName((int)Model.RechargeType) + "(增加)"; if (Model.RechargeStyle == 1) { jmodel.OutAmount = 0; jmodel.JournalType = Model.RechargeType; jmodel.InAmount = reMoney; if (Model.RechargeType == 1)//注册分 { Model.YuAmount = user.Emoney + reMoney; jmodel.BalanceAmount = user.Emoney + reMoney; } if (Model.RechargeType == 2)//奖励分 { Model.YuAmount = user.BonusAccount + reMoney; jmodel.BalanceAmount = user.BonusAccount + reMoney; } if (Model.RechargeType == 3)//复利分 { Model.YuAmount = user.StockMoney + reMoney; jmodel.BalanceAmount = user.StockMoney + reMoney; } if (Model.RechargeType == 4)//激活分 { Model.YuAmount = user.StockAccount + reMoney; jmodel.BalanceAmount = user.StockAccount + reMoney; } if (Model.RechargeType == 5)//购物分 { Model.YuAmount = user.GLmoney + reMoney; jmodel.BalanceAmount = user.GLmoney + reMoney; } } if (Model.RechargeStyle == 2) { jmodel.InAmount = 0; jmodel.JournalType = Model.RechargeType; jmodel.OutAmount = reMoney; jmodel.Remark = "后台充值" + AccountTypeHelper.GetName((int)Model.RechargeType) + "(扣除)"; if (Model.RechargeType == 1) { if (reMoney > user.Emoney) { MessageBox.MyShow(this, AccountTypeHelper.GetName((int)Model.RechargeType) + "余额不足!"); return; } Model.YuAmount = user.Emoney - reMoney; jmodel.BalanceAmount = user.Emoney - reMoney; } if (Model.RechargeType == 2) { if (reMoney > user.BonusAccount) { MessageBox.MyShow(this, AccountTypeHelper.GetName((int)Model.RechargeType) + "余额不足!"); return; } Model.YuAmount = user.BonusAccount - reMoney; jmodel.BalanceAmount = user.BonusAccount - reMoney; } if (Model.RechargeType == 3) { if (reMoney > user.StockAccount) { MessageBox.MyShow(this, AccountTypeHelper.GetName((int)Model.RechargeType) + "余额不足!"); return; } Model.YuAmount = user.StockMoney - reMoney; jmodel.BalanceAmount = user.StockMoney - reMoney; } if (Model.RechargeType == 4) { if (reMoney > user.StockMoney) { MessageBox.MyShow(this, AccountTypeHelper.GetName((int)Model.RechargeType) + "余额不足!"); return; } Model.YuAmount = user.StockAccount - reMoney; jmodel.BalanceAmount = user.StockAccount - reMoney; } if (Model.RechargeType == 5) { if (reMoney > user.GLmoney) { MessageBox.MyShow(this, AccountTypeHelper.GetName((int)Model.RechargeType) + "余额不足!"); return; } Model.YuAmount = user.GLmoney - reMoney; jmodel.BalanceAmount = user.GLmoney - reMoney; } } Model.RechargeableMoney = reMoney; Model.RechargeDate = DateTime.Now; Model.Flag = 1; if (rechargeBLL.Add(Model) > 0 && journalBLL.Add(jmodel) > 0) { string fieldName = ""; if (Model.RechargeType == 1) { fieldName = "Emoney"; } else if (Model.RechargeType == 2) { fieldName = "BonusAccount"; } else if (Model.RechargeType == 3) { fieldName = "StockMoney"; } else if (Model.RechargeType == 4) { fieldName = "StockAccount"; } else if (Model.RechargeType == 5) { fieldName = "GLmoney"; } if (Model.RechargeStyle == 1) { UpdateAccount(fieldName, Convert.ToInt32(Model.UserID), reMoney, 1); UpdateSystemAccount("MoneyAccount", reMoney, 1);//公司账户增加 } else { UpdateAccount(fieldName, Convert.ToInt32(Model.UserID), reMoney, 0); UpdateSystemAccount("MoneyAccount", reMoney, 0);//公司账户减少 } ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('操作成功!');window.location.href='AddMoney.aspx';", true); } else { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('充值失败!');", true); } }