protected void BtnConfirmMoible_Click(object sender, EventArgs e) { string name = Request.Cookies["RePwdName"].Value.ToString(); try { MemberInfoDAL obj = new MemberInfoDAL(); string phone = obj.GetMobileByName(Request.Cookies["RePwdName"].Value.ToString()); if (phone == this.TxtMobile.Text.Trim().ToString()) { string ProofPwd = obj.RndNum(6); //发送验证码 Tz888.BLL.SendNotice mob = new Tz888.BLL.SendNotice(); if (mob.SendMobileMsg(this.TxtMobile.Text.Trim().ToString(), ProofPwd)) { Session["Proofpwd"] = ProofPwd; Response.Redirect("succeedByMobile.aspx"); } else { Response.Write("<script>alert('服务器发送验证码失败,请重试!');</script>"); } } else { this.LblMessage.Text = "您输入的手机号码不是注册时的手机号!"; } } catch { Response.Write("<script>alert('发送验证码失败,请重试!');</script>"); } }
protected void BtnConfirm_Click(object sender, EventArgs e) { string pwd = ""; string name = Request.Cookies["RePwdName"].Value.ToString(); MemberInfoDAL obj = new MemberInfoDAL(); string answer = obj.GetAnswerByEmail(Request.Cookies["RePwdName"].Value.ToString()); if (answer == this.TxtAnswer.Text.ToString()) { try { string mail = GetEmailByLoginName(); //发送密码设置页 RegisterMail mailB = new RegisterMail(); string url = mailB.GetMailResetTemplateUrl(); string domain = "http://" + Request.ServerVariables["SERVER_NAME"].ToString(); string validurl = domain + Request.RawUrl.Replace("RetrieveStep6.aspx", "RetrieveStep3.aspx"); mailB.SendResetMail(Server.MapPath(url), name, pwd, mail, validurl, domain); Response.Redirect("succeedByqu.aspx?Email=" + mail + ""); } catch (Exception ex) { Response.Write("<script>alert('请重试!" + ex.Message + "'); </script>"); } } else { this.LblMessage.Text = "回答密码保护问题错误!"; } }
protected void Page_Load(object sender, EventArgs e) { //获取标准币种 bzCurrency = CommonDataBLL.GetStandard(); // huilv = (AjaxClass.GetCurrency(Convert.ToInt32(bzCurrency), Convert.ToInt32(Session["Default_Currency"].ToString()))); Permissions.MemRedirect(Page, Permissions.redirUrl); AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass)); //判断会员账户是否被冻结 if (MemberInfoDAL.CheckState(Session["Member"].ToString())) { Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('您的账户被冻结,不能使用电子转账');window.location.href='First.aspx';</script>"); return; } if (!IsPostBack) { try { bind(); double Cash = 0; //石斛积分账户 double Declarations = 0; //报单账户 ECRemitDetailBLL.GetCashDeclarations(Session["Member"].ToString(), out Cash, out Declarations); shky.Text = "FTC可用:" + Convert.ToString(Cash); // bdky.Text = "注册积分可用:"+Convert.ToString(Declarations); } catch { Response.Redirect("../PassWordManage/CheckAdv.aspx?type=member&url=MoneyManage"); } lbUsername.Text = Encryption.Encryption.GetDecipherName(DAL.DBHelper.ExecuteScalar("select isnull(Name,'') as Name from memberinfo where number='" + Session["Member"].ToString() + "'").ToString()); } //translation(); }
protected void txtMemBh_TextChanged(object sender, EventArgs e) { if (txtMemBh.Text == "") { ScriptHelper.SetAlert(Page, GetTran("000723", "会员编号不能为空") + "!"); return; } if (!MemberInfoDAL.IsMemberExist(txtMemBh.Text)) { ScriptHelper.SetAlert(Page, GetTran("000725", "会员编号不存在") + "!"); txtMemBh.Text = ""; return; } else { DataTable dt = DAL.DBHelper.ExecuteDataTable("select name,postalcode,mobiletele,cpccode,address,storeid from memberinfo where number='" + txtMemBh.Text + "'"); this.txtName.Text = Encryption.Encryption.GetDecipherName(dt.Rows[0]["Name"].ToString()); this.labName.Text = Encryption.Encryption.GetDecipherName(dt.Rows[0]["Name"].ToString()); txtName.Visible = false; if (dt.Rows[0]["postalcode"].ToString() != "") { this.txtPostCode.Text = dt.Rows[0]["postalcode"].ToString(); this.labPostCode.Text = dt.Rows[0]["postalcode"].ToString(); } this.Txtyddh.Text = dt.Rows[0]["mobiletele"].ToString(); this.labyddh.Text = dt.Rows[0]["mobiletele"].ToString(); Txtyddh.Visible = false; BindMemberAdd(txtMemBh.Text); } }
/// <summary> /// 为会员分派奖金 /// </summary> /// <param name="memberphone"></param> /// <param name="money"></param> /// <returns></returns> public string FenPaiMoney(string memberphone, decimal money) { string result = "0"; MemberInfoModel member = MemberInfoDAL.GetMember(memberphone); if (member == null) { return("0无此会员"); } using (TransactionScope scope = new TransactionScope()) { int rowcount = MemberCapitalDetailDAL.UpdateMemberDynamicFunds(member.ID, money, member.TruethName, member.MobileNum); if (rowcount < 1) { return("0操作失败"); } AmountChangeLogModel logmodel = new AmountChangeLogModel(); logmodel.MemberID = member.ID; logmodel.MemberName = member.TruethName; logmodel.MemberPhone = member.MobileNum; logmodel.OrderCode = ""; logmodel.OrderID = 0; logmodel.ProduceMoney = money; logmodel.Remark = "会员:" + member.MobileNum + " 得到系统派发的奖金"; logmodel.Type = 3; rowcount = OperateLogDAL.AddAmountChangeLog(logmodel); if (rowcount < 1) { return("0操作失败"); } scope.Complete(); result = "1"; } return(result); }
public void LoadDataAAA() { int tp = 0; if (Request.QueryString["tp"] != null) { try { tp = Convert.ToInt32(Request.QueryString["tp"]); } catch { tp = 0; } } Session["cpage"] = tp; string number = Session["member"].ToString(); decimal todayprice = Common.GetnowPrice(); hidprice.Value = todayprice.ToString("0.0000"); mrjg.Text = todayprice.ToString("0.0000"); mcjg.Text = todayprice.ToString("0.0000"); lbltodayprice.Text = todayprice.ToString("0.0000"); MemberInfoModel mb = MemberInfoDAL.getMemberInfo(number); decimal de = Convert.ToDecimal(DBHelper.ExecuteScalar("select para15 from config where ExpectNum=" + CommonDataBLL.getMaxqishu() + " ")); lblzzlv.Text = (de * 100).ToString("0.00") + "%"; decimal ca = 0; decimal usdt = 0; DataTable dt = DBHelper.ExecuteDataTable("select jackpot-out-membership as usdt ,pointAin-pointAout-pointAfz as ca from memberinfo where number='" + number + "'"); if (dt != null && dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; ca = Convert.ToDecimal(dr["ca"]); usdt = Convert.ToDecimal(dr["usdt"]); } decimal sxfbl = Common.GetSxfWyjblv(0); decimal wyjbl = Common.GetSxfWyjblv(1); //decimal wyjjb = blace*wyjbl; //违约金石斛积分数量 //decimal sxfjb =sxfbl*blace ; //手续费石斛积分数量 hidblance.Value = ca.ToString("0.0000"); ///卖出数量余额 sellsz.Text = "0"; // lblmaxsell.Text = (blace / (1 + sxfbl + wyjbl)).ToString("0.00"); mairu = Convert.ToInt32(usdt / todayprice).ToString(); qbye.Text = mairu; hidusdtblc.Value = usdt.ToString("0.0000"); //MobileTele.Value = mb.MobileTele; }
//通过用户名获取邮箱 private string GetEmailByLoginName() { string strEmail = ""; MemberInfoDAL obj = new MemberInfoDAL(); strEmail = obj.GetEmail(Request.Cookies["RePwdName"].Value.ToString()); return(strEmail); }
private string GetLoginNameByEmail() { string strLoginName = ""; string strEmail = txtEmail.Text.ToString().Trim(); MemberInfoDAL obj = new MemberInfoDAL(); strLoginName = obj.GetLoginNameByEmail(strEmail); return(strLoginName); }
public static bool CheckMemberInfoByNumber(string number) { // MemberInfoDAL dao = new MemberInfoDAL(); MemberInfoModel member = MemberInfoDAL.getMemberInfo(number); if (member != null) { return(true); } else { return(false); } }
/// <summary> /// 为会员分派动态奖金 /// </summary> /// <param name="memberphone"></param> /// <param name="money"></param> /// <returns></returns> public string FenPaiMoneyToDynamic(int memberid, decimal money) { string result = "0"; MemberInfoModel member = MemberInfoDAL.GetMember(memberid); if (member == null) { return("0无此会员"); } using (TransactionScope scope = new TransactionScope()) { int rowcount = MemberCapitalDetailDAL.UpdateMemberDynamicFunds(member.ID, money, member.TruethName, member.MobileNum); if (rowcount < 1) { return("0操作失败"); } AmountChangeLogModel logmodel = new AmountChangeLogModel(); logmodel.MemberID = member.ID; logmodel.MemberName = member.TruethName; logmodel.MemberPhone = member.MobileNum; logmodel.OrderCode = ""; logmodel.OrderID = 0; logmodel.ProduceMoney = money; logmodel.Remark = "会员:" + member.MobileNum + " 得到系统派发的奖金"; logmodel.Type = 3; rowcount = OperateLogDAL.AddAmountChangeLog(logmodel); if (rowcount < 1) { return("0操作失败"); } try { UserBehaviorLogModel log = new UserBehaviorLogModel(); log.AOrderCode = ""; log.BehaviorSource = 2; log.BehaviorType = 9; log.HOrderCode = ""; log.MemberID = member.ID; log.MemberName = member.TruethName; log.MemberPhone = member.MobileNum; log.ProcAmount = money; log.Remark = "会员:" + member.MobileNum + " 获得系统奖励动态资金" + money + "元"; rowcount = UserBehaviorLogDAL.AddUserBehaviorLog(log); } catch { } scope.Complete(); result = "1"; } return(result); }
protected void BtnConfirmMoible_Click(object sender, EventArgs e) { string name = Request.Cookies["RePwdName"].Value.ToString(); MemberInfoDAL obj = new MemberInfoDAL(); if (Session["Proofpwd"].ToString() == this.TxtProof.Text.Trim().ToString()) { Response.Redirect("RepeatSetPassword.aspx"); } else { this.LblMessage.Text = "验证码错误,请重试!"; } }
/// <summary> /// 惩罚会员静态金额 /// </summary> /// <param name="memberphone"></param> /// <param name="money"></param> /// <returns></returns> public string punishmentStaticMoney(int memberid, decimal money, string reason) { string result = "0"; MemberInfoModel member = MemberInfoDAL.GetMember(memberid); if (member == null) { return("0无此会员"); } using (TransactionScope scope = new TransactionScope()) { int rowcount = MemberCapitalDetailDAL.UpdateStaticPunishMoney(member.ID, money, member.TruethName, member.MobileNum); if (rowcount < 1) { return("0操作失败"); } AmountChangeLogModel logmodel = new AmountChangeLogModel(); logmodel.MemberID = member.ID; logmodel.MemberName = member.TruethName; logmodel.MemberPhone = member.MobileNum; logmodel.OrderCode = ""; logmodel.OrderID = 0; logmodel.ProduceMoney = (0 - money); logmodel.Remark = "会员:" + member.MobileNum + " 被平台惩罚:" + money.ToString() + " 元,原因:" + reason; logmodel.Type = 3; rowcount = OperateLogDAL.AddAmountChangeLog(logmodel); if (rowcount < 1) { return("0操作失败"); } try { UserBehaviorLogModel log = new UserBehaviorLogModel(); log.AOrderCode = ""; log.BehaviorSource = 2; log.BehaviorType = 10; log.HOrderCode = ""; log.MemberID = member.ID; log.MemberName = member.TruethName; log.MemberPhone = member.MobileNum; log.ProcAmount = money; log.Remark = "会员:" + member.MobileNum + " 被惩罚静态资金" + money + "元"; rowcount = UserBehaviorLogDAL.AddUserBehaviorLog(log); } catch { } scope.Complete(); result = "1"; } return(result); }
protected void Page_Load(object sender, EventArgs e) { Permissions.MemRedirect(Page, Permissions.redirUrl); //获取标准币种 AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass)); bzCurrency = CommonDataBLL.GetStandard(); huilv = 0; //判断会员账户是否被冻结 if (MemberInfoDAL.CheckState(Session["Member"].ToString())) { Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('您的账户被冻结,不能使用交易系统');setTimeout(function(){ window.location.href='First.aspx'},3000);</script>"); return; } if (!IsPostBack) { DateTime dtnow = DateTime.Now; Session["smscode"] = null; //if (Common.GetISCanCharge()==0) { // ClientScript.RegisterStartupScript(this.GetType(), "", "<script> window.location.href='first.aspx'; </script>"); return; //} string number = Session["member"].ToString(); //object obj = DAL.DBHelper.ExecuteScalar("select papernumber from memberinfo where number='" + number + "'"); //if (obj == DBNull.Value || obj == null || obj.ToString() == "") { // ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('您还未进行实名制认证 ,请先去实名认证!');window.location.href='PhoneSettings/CheckPassword.aspx?url=RealName&&type=name'; </script>"); return; //} SqlDataReader sdr = DAL.DBHelper.ExecuteReader("Select Top 1 * From jykz ORDER BY ID"); while (sdr.Read()) { mrmin = sdr["mrMinjf"].ToString().Trim(); mrmax = sdr["mrMaxjf"].ToString(); mcmin = sdr["mcMinjf"].ToString(); mcmax = sdr["mcMaxjf"].ToString(); } sdr.Close(); sdr.Dispose(); zuida = DBHelper.ExecuteScalar("select pointAin-pointAout from memberinfo where number='" + number + "'").ToString(); if (Session["Default_Currency"] == null) { Session["Default_Currency"] = bzCurrency; } LoadDataAAA(); setStoreInfo(); search_rsj(); Translations(); } }
public void BindOldOrder(string orderid) { MemberOrderModel model = MemberOrderBLL.GetMemberOrder(orderid); Session["LUOrder"] = model.Number + "," + model.OrderType; Session["OrderType"] = model.OrderType; MemberInfoModel infomodel = MemberInfoDAL.getMemberInfo(model.Number); infomodel.StoreID = model.StoreId; Session["fxMemberModel"] = infomodel; Session["EditOrderID"] = orderid; DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + model.Number + "' and mType=" + Session["UserType"].ToString()); DBHelper.ExecuteNonQuery("insert into MemShopCart select productid,quantity,number," + Session["UserType"].ToString() + ",getutcdate()," + model.OrderType + " from MemberDetails where orderid='" + orderid + "'"); }
/// <summary> /// 禁止登陆 /// </summary> /// <returns></returns> public static bool isDenyLogin() { bool DenyLogin = false;//禁止登陆 try { DateTime MinDateTime = Convert.ToDateTime(MemberInfoDAL.GetMaxRegisterDate()); if (DateTime.Now < MinDateTime || DateTime.Now > MaxDateTime) { DenyLogin = true; } } catch { } return(DenyLogin); }
/// <summary> /// 获取登录时间 /// </summary> /// <param name="mid"> 管理员编号 </param> /// <returns>返回时间</returns> public static DateTime GetLoginTime(string mid, int type) { if (type == 1) { return(ManageDAL.GetLoginTime(mid)); } else if (type == 2) { return(StoreInfoDAL.GetLastLoginTime(mid)); } else if (type == 3) { return(MemberInfoDAL.GetLastLoginTime(mid)); } else { return(DateTime.Now); } }
public AdminIndexModels GetDefaultData() { //decimal staticnum = MemberCapitalDetailDAL.GetTotalAmontForPlant(out dynamicnum); string datastart = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00"; string dataend = DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59"; AdminIndexModels model = new AdminIndexModels(); model.ActiveCodeCount = ActiveCodeDAL.GetTotalCount(1); //全部激活码数量 model.ActiveMemberCount = MemberInfoDAL.GetTotalMemberCount(2); model.PaidanCodeCount = ActiveCodeDAL.GetTotalCount(2); //全部排单币数量 model.TotalAcceptAmont = AcceptHelpOrderDAL.GetTotalAcceptMoney(); model.TotalHelpAmont = HelpeOrderDAL.GetTotalHelpMoney(); model.TotalMemberCount = MemberInfoDAL.GetTotalMemberCount(1); model.TodayAcceptMoney = AcceptHelpOrderDAL.GetTodayAcceptMoney(datastart, dataend); model.TodayHelpMoney = HelpeOrderDAL.GetTodayHelpMoney(datastart, dataend); model.TodayMatchedMoney = MatchOrderDAL.GetTotalMatchMoneyByDay(datastart, dataend); model.TotalMatchMoney = MatchOrderDAL.GetTotalMatchMoney(); return(model); }
protected void BtnSendmail_Click(object sender, EventArgs e) { //判断用户名与使用邮箱是否匹配 string mail = this.txtEmail.Text.Trim().ToString(); string name = Request.Cookies["RePwdName"].Value.ToString(); string strmail = GetEmailByLoginName(); string pwd = ""; //try //{ if (strmail.Trim().Length > 0) { if (strmail == mail) { MemberInfoDAL obj = new MemberInfoDAL(); //try //{ //发送密码设置页 RegisterMail mailB = new RegisterMail(); string url = mailB.GetMailResetTemplateUrl(); string domain = "http://" + Request.ServerVariables["SERVER_NAME"].ToString(); string validurl = domain + Request.RawUrl.Replace("RetrieveStep2.aspx", "RetrieveStep3.aspx"); mailB.SendResetMail(Server.MapPath(url), name, pwd, mail, validurl, domain); Response.Redirect("succeedByemail.aspx?Email=" + mail + ""); //} //catch (Exception ex) //{ // Response.Write("<script>alert('请重试!" + ex.Message + "'); </script>"); //} } else { Response.Redirect("RetrieveStep4.aspx"); } } //} //catch //{ //} }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { if (Request.Cookies["RePwdName"] == null) { Response.Write("<script>alert('页面已过期!');location.href='RetrieveStep1.aspx';</script>"); } } catch { Response.Write("<script>alert('页面已过期!');location.href='RetrieveStep1.aspx';</script>"); } MemberInfoDAL obj = new MemberInfoDAL(); this.LblQuestion.Text = obj.GetQuestionByEmail(Request.Cookies["RePwdName"].Value.ToString()); } }
public void BindDate() { if (Request.QueryString["orderid"] != null) { string orderid = Request.QueryString["orderid"]; MemberOrderModel mo = MemberOrderDAL.GetMemberOrder(orderid); MemberInfoModel mi = MemberInfoDAL.getMemberInfo(mo.Number); lblxjnumber.Text = mo.Number; lblname.Text = mi.PetName; lblphonenum.Text = mi.MobileTele; //txtplacement.Text = mi.Placement; hiddirect.Value = mi.Direct; txtDirect.Text = mi.Direct; hidorderid.Value = orderid; decimal nowpc = Common.GetnowPrice(); decimal jf = mo.TotalMoney / nowpc * 0.8m; lblkcjb.Text = jf.ToString("0.0000"); decimal bdb = mo.TotalMoney * 0.2m; lblttmoney.Text = bdb.ToString("0.00"); } }
private void BindCardinfo() { string number = Session["Member"].ToString(); this.ddlscbank.DataSource = new AddOrderBLL().GetBank(1, "中文"); this.ddlscbank.DataTextField = "BankName"; this.ddlscbank.DataValueField = "BankCode"; this.ddlscbank.DataBind(); MemberInfoModel md = MemberInfoDAL.getMemberInfo(number); if (md != null) { lblname.Text = md.Name; txtbankcard.Text = md.BankCard; txtbankbanchname.Text = md.Bankbranchname; if (md.BankCode != "") { ddlscbank.SelectedValue = md.BankCode; } } }
protected void BtnConfirmMoible_Click(object sender, EventArgs e) { MemberInfoDAL obj = new MemberInfoDAL(); try { string phone = obj.GetMobileByName(Request.Cookies["RePwdName"].Value.ToString()); if (phone.Length == 11 && phone.IndexOf("-", 0) == -1) { if (phone == this.TxtMobile.Text.Trim().ToString()) { string ProofPwd = obj.RndNum(6); //发送验证码 Tz888.BLL.SendNotice mob = new Tz888.BLL.SendNotice(); if (mob.SendMobileMsg(this.TxtMobile.Text.Trim().ToString(), ProofPwd)) { Session["Proofpwd"] = ProofPwd; Response.Redirect("succeedByMobile.aspx"); } else { Response.Write("<script>alert('服务器发送验证码失败,请重试!');</script>"); } } else { Response.Redirect("RetrieveStep9.aspx"); } } else { Response.Redirect("Errortelephone.aspx"); } } catch { Response.Write("<script>alert('发送验证码失败,请重试!');</script>"); } }
/// <summary> /// 修改会员基本信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool Updmemberbasic(MemberInfoModel info) { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberinfo", "number");//申明日志对象 using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { if (!MemberInfoDAL.Updmemberbasic(tran, info)) { tran.Rollback(); return(false); } //添加日志 cl_h_info.AddRecordtran(tran, info.Number); if (System.Web.HttpContext.Current.Session["Company"] != null) { cl_h_info.ModifiedIntoLogstran(tran, CommonClass.ChangeCategory.Order, info.Number, BLL.CommonClass.ENUM_USERTYPE.Company); } else if (System.Web.HttpContext.Current.Session["Store"] != null) { cl_h_info.ModifiedIntoLogstran(tran, CommonClass.ChangeCategory.Order, info.Number, BLL.CommonClass.ENUM_USERTYPE.Store); } tran.Commit(); return(true); } catch { tran.Rollback(); return(false); } finally { conn.Close(); } } }
protected void Page_Load(object sender, EventArgs e) { Permissions.MemRedirect(Page, Permissions.redirUrl); //Response.Cache.SetExpires(DateTime.Now); type = Request.QueryString["type"] == "" ? "" : Request.QueryString["type"]; url = Request.QueryString["url"] == "" ? "" : Request.QueryString["url"]; if (!IsPostBack) { Session["smscode"] = null; try { if (url != null && url != "") { if (Session["member"] == null) { Response.Redirect("../index.aspx"); } } else { if (Session["member"] == null) { Response.Redirect("../index.aspx"); } } string number = Session["member"].ToString(); MemberInfoModel mb = MemberInfoDAL.getMemberInfo(number); MobileTele.Value = mb.MobileTele; } catch (Exception ex) { if (Session["member"] == null) { Response.Redirect("../index.aspx"); } } } }
/// <summary> /// 根据Number获得单个会员的信息 /// </summary> /// <param name="Number">会员编号</param> /// <returns></returns> public MemberInfoModel getMemberInfo(string Number) { return(MemberInfoDAL.getMemberInfo(Number)); }
/// <summary> /// 修改验证码发送结果 /// </summary> /// <param name="code"></param> /// <returns></returns> public int UpdateVerification(string sendid, int id) { return(MemberInfoDAL.UpdateVerification(sendid, id)); }
/// <summary> /// 按照ID查询验证码内容 /// </summary> /// <param name="code"></param> /// <returns></returns> public string SelectVerification(int id) { return(MemberInfoDAL.SelectVerification(id)); }
protected void Page_Load(object sender, EventArgs e) { Permissions.ThreeRedirect(Page, "../Member/" + Permissions.redirUrl); luo.SetVlaue(); AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxMemShopCart)); AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass)); bzCurrency = CommonDataBLL.GetStandard(); hcname.Value = cname.Value; if (!IsPostBack) { // string str = Session["languageCode"].ToString(); //if (str == "L002") //{ // countrycode = 1; //} type = Request["type"].ToString(); if (Request["type"] == null) { Session["mbreginfo"] = null; Session["EditOrderID"] = null; Session["fxMemberModel"] = null; } ///公司系统、店铺系统进入,会员系统的头部、尾部控件隐藏 if (Session["UserType"] != null && Session["UserType"].ToString() != "3") // 公司/店铺 系统 { if (Session["UserType"].ToString() == "2") { // top.Visible = false; // bottom.Visible = false; // STop1.Visible = true; // SLeft1.Visible = true; } else { //top.Visible = false; // bottom.Visible = false; //STop1.Visible = false; // SLeft1.Visible = false; } Session["OrderType"] = luo.OrderType; Session["LUOrder"] = luo.MemBh + "," + luo.OrderType; } else { //top.Visible = true; //bottom.Visible = true; // STop1.Visible = false; //SLeft1.Visible = false; //注册 if (HttpContext.Current.Request["type"] != null && HttpContext.Current.Request["type"].ToString() == "reg") { if (Session["Member"] != null) //会员注册 { Session["OrderType"] = 21; Session["LUOrder"] = GetMemBh() + ",21"; } } //复消 else if (HttpContext.Current.Request["type"] != null && HttpContext.Current.Request["type"].ToString() == "new") { if (HttpContext.Current.Session["Store"] != null) { Session["OrderType"] = 12; Session["LUOrder"] = GetMemBh() + ",12"; } else if (HttpContext.Current.Session["Member"] != null) { Session["OrderType"] = 12; Session["LUOrder"] = GetMemBh() + ",12"; } } //升级 else if (HttpContext.Current.Request["type"] != null && HttpContext.Current.Request["type"].ToString() == "Sj") { if (HttpContext.Current.Session["Store"] != null) { Session["OrderType"] = 13; Session["LUOrder"] = GetMemBh() + ",13"; } else if (HttpContext.Current.Session["Member"] != null) { Session["OrderType"] = 23; Session["LUOrder"] = GetMemBh() + ",23"; } } //复消提货 else if (HttpContext.Current.Request["type"] != null && HttpContext.Current.Request["type"].ToString() == "Fxth") { if (HttpContext.Current.Session["Member"] != null) { Session["OrderType"] = 25; Session["LUOrder"] = GetMemBh() + ",25"; } }//消费购物 else if (HttpContext.Current.Request["type"] != null && HttpContext.Current.Request["type"].ToString() == "ShopingXF") { if (HttpContext.Current.Session["Member"] != null) { Session["OrderType"] = 22; Session["LUOrder"] = GetMemBh() + ",22"; Session["fxMemberModel"] = MemberInfoDAL.getMemberInfo(GetMemBh()); } } } //非注册,清楚注册session if (HttpContext.Current.Request["type"] != null && HttpContext.Current.Request["type"].ToString() != "reg") { Session.Remove("mbreginfo"); Session["fxMemberModel"] = MemberInfoDAL.getMemberInfo(GetMemBh()); } //BindDataFinal(); GetCount(); //Translations(); } }
/// <summary> /// 获取分公司姓名 /// </summary> /// <param name="memeberid">分公司编号</param> /// <returns></returns> //public static string GetBranchName(string memeberid) //{ // return MemberInfoDAL.GetBranchName(memeberid); //} /// <summary> /// 获取会员姓名 /// </summary> /// <param name="memeberid">会员编号</param> /// <returns></returns> public static string GetMemberName(string memeberid) { return(MemberInfoDAL.GetMemberName(memeberid)); }
/// <summary> /// 转账 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnE_Click(object sender, EventArgs e) { //设置特定值防止重复提交 hid_fangzhi.Value = "0"; //判断会员账户是否被冻结 if (MemberInfoDAL.CheckState(Session["Member"].ToString())) { Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('您的账户被冻结,不能使用电子转账');window.location.href='First.aspx';</script>"); return; } ECTransferDetailModel detailmodel = new ECTransferDetailModel(); try { //验证金额是否合法 double money = 0.0; if (!double.TryParse(this.txtEmoney.Text.Trim(), out money)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('金额必须是数字,请重新输入!');</script>"); return; } //验证是否输入金额 if (this.txtEmoney.Text.Length <= 0 || money <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转出金额必须大于0!');</script>"); return; } //验证输入金额是否是10的倍数 decimal mony = Convert.ToDecimal(this.txtEmoney.Text); if (mony % 10 != 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转出金额必须是10的倍数');</script>"); return; } double Cash = 0; //可用FTC账户 double Declarations = 0; //消费账户 ECRemitDetailBLL.GetCashDeclarations(Session["Member"].ToString(), out Cash, out Declarations); int level2 = 0; double djq = 0; string ssql = "select level2,fuxiaoin-fuxiaoout+fuxiaothin-fuxiaothout as djq from MemberInfoBalance" + CommonDataBLL.getMaxqishu() + " a ,MemberInfo b where a.number=b.Number and a.number='" + Session["Member"].ToString() + "'"; DataTable dts = DAL.DBHelper.ExecuteDataTable(ssql); if (dts.Rows.Count > 0) { level2 = Convert.ToInt16(dts.Rows[0]["Level2"].ToString()); djq = Convert.ToDouble(dts.Rows[0]["djq"].ToString()); } double jdjy = 0; if (level2 > 0) { if (Convert.ToDouble(Cash) + djq > 30000) { jdjy = (Convert.ToDouble(Cash) + djq) - 30000; if (jdjy > Convert.ToDouble(Cash)) { jdjy = Convert.ToDouble(Cash); } } else { jdjy = 0; } Cash = jdjy; } //验证转账金额最大值 if (RadioButtonList1.SelectedValue == "1" && money > Cash) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转出金额必须小于当前FTC可用账户最大可转金额!');</script>"); return; } else if (RadioButtonList1.SelectedValue == "3" && money > Declarations) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "转出金额必须小于当前消费账户最大可转金额!") + "');</script>"); return; } else if (RadioButtonList1.SelectedValue == "2") { double bd = 0; string sql = "select pointBIn-pointBOut as bd from MemberInfo where number='" + Session["Member"].ToString() + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { bd = Convert.ToDouble(shj.Rows[0][0].ToString()); if (money > bd) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "转出金额必须小于当前报单账户最大可转金额!") + "');</script>"); return; } } } else if (RadioButtonList1.SelectedValue == "4") { double bd = 0; double xj = 0; string sql = "select zzye-xuhao as bd,Jackpot-Out as xj from MemberInfo where number='" + Session["Member"].ToString() + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { bd = Convert.ToDouble(shj.Rows[0][0].ToString()); xj = Convert.ToDouble(shj.Rows[0][1].ToString()); if (money > bd) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "转出金额必须小于当前保险账户最大可转金额!") + "');</script>"); return; } if (xj > 10) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000000", "可用FTC使用完才可以操作保险账户转账!") + "');</script>"); return; } } } string number = ""; if (RadioButtonList1.SelectedValue == "1" || RadioButtonList1.SelectedValue == "4") { string sql = "select number from MemberInfo where MobileTele='" + txt_InNumber.Text + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { number = shj.Rows[0][0].ToString(); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('无此编号,请检查后再重新输入111!')</script>"); return; } string GetError1 = new AjaxClass().CheckNumberNetTui(number, lbEnum.Text.Trim()); string GetError2 = new AjaxClass().CheckNumberNetTui(lbEnum.Text.Trim(), number); if (RadioButtonList1.SelectedValue == "1" && ((GetError1 != null && GetError1 != "") && (GetError2 != null && GetError2 != ""))) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('可用FTC只能转给同一网络下的用户!');</script>", false); return; } if (RadioButtonList1.SelectedValue == "4" && ((GetError1 != null && GetError1 != "") && (GetError2 != null && GetError2 != ""))) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('可用FTC只能转给同一网络下的用户!');</script>", false); return; } //验证转入编号 if (number == "") { ScriptHelper.SetAlert(Page, "编号不能为空!"); return; } } else { number = Session["Member"].ToString(); } string lll = Request.Form["rad_Inzh"]; string llll = rad_Outzh.SelectedValue; //验证会员是否自己给自己转入现金账户 if (txt_InNumber.Text.Trim() == lbEnum.Text.Trim() && RadioButtonList1.SelectedValue == "1") { ScriptHelper.SetAlert(Page, "自己不能转入自己的FTC账户"); return; } //验证会员是否自己给自己转入消费账户 //if (txt_InNumber.Text.Trim() == lbEnum.Text.Trim() && RadioButtonList1.SelectedValue == "3") //{ // ScriptHelper.SetAlert(Page, GetTran("000000", "自己不能转入自己的消费积分账户")); // return; //} //验证会员转入账户是否服务机构订货款和转入编号是否服务机构编号 //if (Request.Form["rad_Inzh"] == "2" && (int)DAL.DBHelper.ExecuteScalar("select count(0) as count from storeinfo where storeid= '" + txt_InNumber.Text.Trim() + "'") <= 0) //{ // ScriptHelper.SetAlert(Page, GetTran("007696", "转入服务机构订货款,转入编号必须是服务机构编号")); // return; //} //else if (Request.Form["rad_Inzh"] != "2" && (int)DAL.DBHelper.ExecuteScalar("select count(0) as count from memberinfo where number= '" + txt_InNumber.Text.Trim() + "'") <= 0) //{ // ScriptHelper.SetAlert(Page, GetTran("007697", "转入编号不正确,请重新填写!")); // return; //} //验证备注do if (this.txtEnote.Text.Length > 500) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('您输入的字符超出最大范围!');</script>"); return; } //验证密码 非空 //if (this.txtEpwd.Text.Trim() == "") //{ // ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("006662", "请输入二级密码!") + "');</script>"); // return; //} ////验证电子账户密码是否正确 //string word = Encryption.Encryption.GetEncryptionPwd(this.txtEpwd.Text.Trim(), this.lbEnum.Text.Trim()); //int blean = ECRemitDetailBLL.ValidatePwd(Session["Member"].ToString(), word); //if (blean == 1) //{ // System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("001554", "电子账户密码不正确!") + "');", true); // return; //} //else if (blean == 2) //{ // System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("007162", "对不起,您连续5次输入密码错,请2小时候在登录!") + "');", true); // return; //} //是否收到款项 if (!cboyishd.Checked) { ScriptHelper.SetAlert(Page, "请先确认是否收到该会员支付的上数金额!"); return; } detailmodel.OutNumber = Session["Member"].ToString(); detailmodel.OutMoney = double.Parse(this.txtEmoney.Text.Trim()); detailmodel.ExpectNum = CommonDataBLL.getMaxqishu(); detailmodel.OperateIP = CommonDataBLL.OperateIP; // 获取ip detailmodel.OperateNumber = Session["Member"].ToString(); // 获取当前会员编号 detailmodel.Remark = this.txtEnote.Text.Trim(); if (RadioButtonList1.SelectedValue == "1") { detailmodel.InNumber = number; detailmodel.outAccountType = OutAccountType.MemberCash; detailmodel.inAccountType = InAccountType.MemberCash; } if (RadioButtonList1.SelectedValue == "2") { detailmodel.InNumber = number; detailmodel.outAccountType = OutAccountType.MemberBD; detailmodel.inAccountType = InAccountType.MemberCash; } if (RadioButtonList1.SelectedValue == "3") { detailmodel.InNumber = number; detailmodel.outAccountType = OutAccountType.MemberCons; detailmodel.inAccountType = InAccountType.MemberCash; } if (RadioButtonList1.SelectedValue == "4") { detailmodel.InNumber = number; detailmodel.outAccountType = OutAccountType.MemberTypeFx; detailmodel.inAccountType = InAccountType.MemberTypeFx; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请输入正确的参数!');</script>"); } SqlTransaction tran = null; SqlConnection conn = DAL.DBHelper.SqlCon(); conn.Open(); tran = conn.BeginTransaction(); try { if (detailmodel.outAccountType == OutAccountType.MemberCash && detailmodel.inAccountType == InAccountType.MemberCash) { string number = ""; string sql = "select number from MemberInfo where MobileTele='" + txt_InNumber.Text + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { number = shj.Rows[0][0].ToString(); detailmodel.InNumber = number; } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('无此编号,请检查后再重新输入222!')</script>"); return; } //对会员现金账户转入会员现金账户 if (ECRemitDetailBLL.AddMoneyManageTran(detailmodel, 1, 2, tran) == 0) { //string mot = ""; //string sqll = "select MobileTele from MemberInfo where number='" + lbEnum.Text + "'"; //DataTable xsj = DBHelper.ExecuteDataTable(sqll); //if (xsj.Rows.Count > 0) //{ // mot = xsj.Rows[0][0].ToString(); //} int ret = D_AccountBLL.AddAccountWithdrawTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.MemberType, D_Sftype.BounsAccount, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountReduced, "会员可用FTC账户转入" + txt_InNumber.Text.Trim() + "~会员保险账户", tran); string st = "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark) SELECT number,GETutcDATE()," + detailmodel.OutMoney + ",zzye-xuhao,0,8,4,'会员可用钱包转出" + detailmodel.OutMoney + "到" + txt_InNumber.Text + "保险钱包。' from memberinfo where Number='" + detailmodel.InNumber + "'"; int ret1 = DBHelper.ExecuteNonQuery(tran, st); if (ret > 0 && ret1 > 0) { tran.Commit(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>"); } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>"); } } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败1111!');</script>"); } } if (detailmodel.outAccountType == OutAccountType.MemberBD && detailmodel.inAccountType == InAccountType.MemberCash) { //对会员现金账户转入会员消费账户 if (ECRemitDetailBLL.AddMoneyManageTran(detailmodel, 3, 2, tran) == 0) { //string mot = ""; //string sqll = "select MobileTele from MemberInfo where number='" + lbEnum.Text + "'"; //DataTable xsj = DBHelper.ExecuteDataTable(sqll); //if (xsj.Rows.Count > 0) //{ // mot = xsj.Rows[0][0].ToString(); //} int ret = D_AccountBLL.AddAccountWithdrawTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.MemberTypeBd, D_Sftype.baodanFTC, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountReduced, "会员报单账户转入" + detailmodel.InNumber + "~会员保险账户", tran); int ret1 = D_AccountBLL.AddAccountTran(detailmodel.InNumber, detailmodel.OutMoney, D_AccountSftype.zzye, D_Sftype.zzye, D_AccountKmtype.RechargeByTransfer, DirectionEnum.AccountsIncreased, lbEnum.Text + "会员报单账户为" + detailmodel.InNumber + "会员保险账户转入" + detailmodel.OutMoney, tran); if (ret > 0 && ret1 > 0) { tran.Commit(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>"); } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>"); } } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败1111!');</script>"); } } if (detailmodel.outAccountType == OutAccountType.MemberCons && detailmodel.inAccountType == InAccountType.MemberCash) { //对会员消费账户转入会员消费账户 if (ECRemitDetailBLL.AddMoneyManageTran(detailmodel, 0, 2, tran) == 0) { //string mot = ""; //string sqll = "select MobileTele from MemberInfo where number='" + lbEnum.Text + "'"; //DataTable xsj = DBHelper.ExecuteDataTable(sqll); //if (xsj.Rows.Count > 0) //{ // mot = xsj.Rows[0][0].ToString(); //} int ret = D_AccountBLL.AddAccountWithdrawTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.MemberCoshType, D_Sftype.EleAccount, D_AccountKmtype.AccountTransfer, DirectionEnum.AccountReduced, "会员消费账户转入" + txt_InNumber.Text.Trim() + "~会员可用FTC账户", tran); int ret1 = D_AccountBLL.AddAccountTran(Session["Member"].ToString(), detailmodel.OutMoney, D_AccountSftype.zzye, D_Sftype.zzye, D_AccountKmtype.RechargeByTransfer, DirectionEnum.AccountsIncreased, lbEnum.Text + "会员消费账户为" + txt_InNumber.Text.Trim() + "会员可用FTC账户转入" + detailmodel.OutMoney, tran); if (ret > 0 && ret1 > 0) { tran.Commit(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>"); } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>"); } } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败1111!');</script>"); } } if (RadioButtonList1.SelectedValue == "4") { //对会员保险账户转入会员保险账户 string mot = ""; int ret = 0; int ret1 = 0; int ret2 = 0; int ret3 = 0; string sqll = "select number from MemberInfo where MobileTele='" + txt_InNumber.Text + "'"; DataTable xsj = DBHelper.ExecuteDataTable(sqll); if (xsj.Rows.Count > 0) { mot = xsj.Rows[0][0].ToString(); ret = DBHelper.ExecuteNonQuery(tran, "update memberinfo set xuhao+=" + detailmodel.OutMoney + " where number='" + Session["Member"].ToString() + "'"); ret1 = DBHelper.ExecuteNonQuery(tran, "update memberinfo set zzye+=" + detailmodel.OutMoney + " where number='" + mot + "'"); ret2 = DBHelper.ExecuteNonQuery(tran, "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark) SELECT number,GETutcDATE()," + detailmodel.OutMoney + ",zzye-xuhao,1,8,4,'会员保险钱包转出" + detailmodel.OutMoney + "到" + txt_InNumber.Text + "保险钱包。' from memberinfo where Number='" + Session["Member"].ToString() + "'"); ret3 = DBHelper.ExecuteNonQuery(tran, "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark) SELECT number,GETutcDATE()," + detailmodel.OutMoney + ",zzye-xuhao,0,8,4,'会员保险钱包转出" + detailmodel.OutMoney + "到" + txt_InNumber.Text + "保险钱包。' from memberinfo where Number='" + mot + "'"); } if (ret > 0 && ret1 > 0) { tran.Commit(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐成功!');$('#tourl').show();document.getElementById('tourl').href='AccountDetail.aspx?type=AccountXJ';</script>"); } else { tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败2222!');</script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败444!');</script>"); } this.txtEmoney.Text = string.Empty; this.txt_InNumber.Text = string.Empty; txtEnote.Text = string.Empty; } catch { //tran.Rollback(); conn.Close(); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('转帐失败!123');</script>"); } }