private void save() { try { string uname = txbuname.Text.Trim(); string password = txbpassword.Text.Trim(); memberInfo model = new memberInfo(); long id = 0; model.uid = int.Parse(hfuid.Value); id = model.uid; if (id <= 0) { if (uname.Trim().Length < 3) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), DateTime.Now.ToString(), "alert('帐号必须为3位以上');", true); return; } if (password.Trim().Length < 6) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), DateTime.Now.ToString(), "alert('密码必须为6位以上');", true); return; } } model.email = txbemail.Text; model.mobile = txbmobile.Text; model.tel = txbtel.Text; model.uname = txbuname.Text; model.password = txbpassword.Text; model.vip = 0; model.utype = utype; model.addtime = DateTime.Now; model.displayname = ""; model.islock = chkislock.Checked; long result = 0; string resultmsg = ""; if (id > 0) { result = BLL.memberBLL.update(model, ref resultmsg); } else { result = BLL.memberBLL.Add(model, ref resultmsg); } if (result > 0) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), DateTime.Now.ToString(), "alert('保存成功');location.href='view.aspx';", true); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), DateTime.Now.ToString(), "alert('保存失败" + resultmsg.Replace("'", "").Replace("\r", "").Replace("\n", "") + "');", true); } } catch (Exception exc) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), DateTime.Now.ToString(), "alert('提交失败" + exc.Message.Replace("'", "").Replace("\r", "").Replace("\n", "") + "');", true); } }
public void getmemberinfo(long uid) { if (uid > 0) { memberinfo = BLL.memberBLL.GetModel(uid); if (memberinfo != null && memberinfo.uid == uid) { uname = memberinfo != null ? memberinfo.uname : ""; utype = memberinfo != null ? memberinfo.utype : 0; mobile = memberinfo != null && memberinfo.mobile != null ? memberinfo.mobile : ""; } } }
protected void bindmember() { //Common.LogUtil.WriteLog("", "个人中心_", "uid=" + uid + " openid=" + openid); if (uid <= 0) { return; } memberInfo info = BLL.memberBLL.GetModel(uid); if (info == null || !info.uid.Equals(uid)) { return; } //Common.LogUtil.WriteLog("", "个人中心_", "displayname=" + info.displayname); uname = info.uname; address = info.address; displayname = info.displayname; }
public string get_memberinfo(string uid) { try { if (uid.Trim().Length <= 0) { return("{}"); } string where = "uid='" + uid + "'"; memberInfo info = BLL.memberBLL.GetModel(uid); //Dictionary<string, object> di = new Dictionary<string, object>(); //di.Add("info", info); JavaScriptSerializer jss = new JavaScriptSerializer(); string json = jss.Serialize(info); return(json); } catch { } return("{}"); }
/// <summary> /// /// </summary> /// <param name="field"></param> /// <returns></returns> internal static memberInfo GetSerialize(fieldIndex field) { memberInfo member = new memberInfo(field); Type type = field.Member.FieldType; if (type.IsEnum) cSharp.dataSerialize.FixedSizes.TryGetValue(type.GetEnumUnderlyingType(), out member.SerializeFixedSize); else if (type.IsValueType) { Type nullType = type.nullableType(); if (nullType == null) { cSharp.dataSerialize.FixedSizes.TryGetValue(type, out member.SerializeFixedSize); if (type == typeof(bool)) member.NullMapSize = 1; } else { member.NullMapSize = type == typeof(bool?) ? (byte)2 : (byte)1; cSharp.dataSerialize.FixedSizes.TryGetValue(nullType, out member.SerializeFixedSize); } } else member.NullMapSize = 1; return member; }
private void bind() { if (id > 0) { hfuid.Value = id.ToString(); memberInfo info = BLL.memberBLL.GetModel(id); if (info == null || info.uid != id) { Response.Write("<script>alert('无效的id');history.go(-1);</script>"); return; } title = "修改-" + info.uname; txbemail.Text = info.email; txbmobile.Text = info.mobile; txbtel.Text = info.tel; lbbalance.Text = info.balance.ToString(); txbuname.Text = info.uname; txbpassword.Text = info.password; lbaddtime.Text = info.addtime.ToString(); chkislock.Checked = info.islock; } }
/// <summary> /// /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <returns></returns> internal static int SerializeFixedSizeSort(memberInfo left, memberInfo right) { return (int)((uint)right.SerializeFixedSize & (0U - (uint)right.SerializeFixedSize)) - (int)((uint)left.SerializeFixedSize & (0U - (uint)left.SerializeFixedSize)); }
/// <summary> /// 支付结果 /// </summary> /// <param name="orderno"></param> /// <param name="payment">支付方式1微信支付2支付宝</param> /// <param name="status">0为未付 -1作废 1已付 -2支付失败</param> /// <param name="transaction_id"></param> /// <param name="pay_money"></param> /// <param name="resultMsg"></param> /// <returns></returns> public static int order_payresult(string orderid, int payment, int status, string transaction_id, decimal pay_money, ref string resultMsg) { lock (asyncLock) { try { if (orderid == null || orderid.Trim().Length == 0) { resultMsg = "订单编号错误orderid=" + orderid; return(-1); } member_join_orderInfo info = GetModel(orderid); if (info == null || !info.OrderId.Equals(orderid)) { resultMsg = "不存在对应的订单"; return(-1); } if (info.orderstatus != 0 && info.orderstatus != -2) { resultMsg = "当前订单" + orderid + "已处理,不能重复处理"; return(-1); } lock (asyncLock) { bool isExce = false; string Exce_remark = ""; if (status == 1) { Exce_remark = "充值成功"; } if (info.Amount != pay_money) { isExce = true; Exce_remark = "订单金额(" + pay_money + ")和数据库订单金额(" + info.Amount + ")不相同"; } int vip = (int)BLL.member.enum_member_vip.普通会员; if (status == (int)Common.enum_orderstatus.payed) { vip = (int)BLL.member.enum_member_vip.付费会员; } int result = new member_join_orderDAL().order_payresult(info.OrderId, payment, status, info.Amount, transaction_id, isExce, Exce_remark, vip, ref resultMsg); //Common.LogUtil.WriteLog("", LOG_TAG, "OrderId=" + info.OrderId + " status=" + status + " result=" + result + " resultMsg=" + resultMsg); if (result > 0 && status == 1) { if (info.Amount != pay_money) { resultMsg = "支付成功后返回的订单金额(" + pay_money + ")和数据库订单金额(" + info.Amount + ")不相同"; return(result); } string msg = ""; string remark = "会员订单(" + orderid + ")红包支付返回提成"; try { memberInfo memberinfo = memberBLL.GetModel(info.recharge_uid); if (memberinfo != null && memberinfo.uid == info.recharge_uid) { remark = "会员(" + memberinfo.uname + " " + memberinfo.displayname + ")订单(" + orderid + ")红包支付返回提成"; } } catch { } int sell_cash_result = memberBLL.give_cash_to_parent(info.recharge_uid, info.Amount, remark, ref msg); } return(result); } } catch (Exception exc) { resultMsg = exc.Message; Common.LogUtil.WriteLog("", LOG_TAG, exc.Message); } return(-1); } }
/// <summary> /// 获取SQL成员信息 /// </summary> /// <param name="member">成员信息</param> /// <returns>SQL成员信息</returns> internal static sqlMember Get(memberInfo member) { sqlMember value = member.Member.customAttribute<sqlMember>(true); if (value == null || value.SqlType == null) { if (member.MemberType.Type.IsEnum) { if (value == null) value = new sqlMember(); value.SqlType = System.Enum.GetUnderlyingType(member.MemberType.Type); } else { sqlMember sqlMember = member.MemberType.Type.customAttribute<sqlMember>(false, false); if (sqlMember != null && sqlMember.SqlType != null) { if (value == null) value = new sqlMember(); value.SqlType = sqlMember.SqlType; } } } return value ?? defaultSqlMember; }