protected void btnSava_Click(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { int vipId = Convert.ToInt32(Request.QueryString["id"]); Model.AgentInfo ag = new BLL.AgentInfo().GetModel(txtAgentAccount.Text.Trim()); if (ag == null) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('亲,转移的代理不存在,请重新输入帐号')</script>"); } else { Model.GameUserInfo gu = new Model.GameUserInfo(); gu.GUUserID = vipId; gu.GUParentUserID = ag.AgentID; bool result = new BLL.GameUserInfo().VIPShift(gu); if (result) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('会员转移成功')</script>"); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('会员转移失败')</script>"); } } } } catch (Exception) { throw; } }
protected void btnSava_Click(object sender, EventArgs e) { try { Model.GameUserInfo guser = new Model.GameUserInfo(); guser.GUAccount = txtGUAccount.Text.Trim(); guser.GUPasswd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtGUPasswd.Text.Trim(), "MD5");; guser.GUEmail = txtGUEmail.Text.Trim(); guser.GUName = txtGUName.Text.Trim(); guser.GUTel = txtGUTel.Text.Trim(); guser.GUExtend_Sex = Convert.ToInt32(dropsex.SelectedValue); guser.GUExtend_Signature = txtGUExtend_Signature.Text.Trim(); guser.GUExtend_Birthday = GetConversion(txtGUExtend_Birthday.Text.Trim()); guser.GUExtend_RealName = txtGUExtend_RealName.Text; guser.GUExtend_Address = txtGUExtend_Address.Text; guser.GUExtend_IDCardNo = txtGUExtend_IDCardNo.Text; guser.GURegisterTime = GetConversion(DateTime.Now.ToString()); if (Session["manager"] != null) { Model.AgentInfo agent = new BLL.AgentInfo().GetModel(txtAgentAccount.Text.Trim()); if (agent == null) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('代理不存在,请重新输入')</script>"); return; } else { guser.GUParentUserID = agent.AgentID; } } else if (Session["Agent"] != null) { guser.GUParentUserID = ((Model.AgentInfo)Session["Agent"]).AgentID; } int result = new BLL.GameUserInfo().Add(guser); if (result > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('保存成功')</script>"); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('保存失败')</script>"); } } catch (Exception) { throw; } }
protected void btnSava_Click(object sender, EventArgs e) { try { int vipId = Convert.ToInt32(Request.QueryString["id"]); Model.GameUserInfo gu = new Model.GameUserInfo(); gu.GUUserID = vipId; gu.GUAccount = txtGUAccount.Text.Trim(); gu.GUName = txtGUName.Text.Trim(); gu.GUEmail = txtGUEmail.Text.Trim(); gu.GUTel = txtGUTel.Text.Trim(); gu.GUExtend_RealName = txtGUExtend_RealName.Text.Trim(); gu.GUExtend_IDCardNo = txtGUExtend_IDCardNo.Text.Trim(); gu.GUExtend_Address = txtGUExtend_Address.Text.Trim(); gu.GUExtend_Signature = txtGUExtend_Signature.Text; gu.GUExtend_Sex = Convert.ToInt32(dropsex.SelectedValue); gu.GUExtend_Address = txtGUExtend_Address.Text.Trim(); gu.GUExtend_Birthday = GetConversion(txtGUExtend_Birthday.Text); gu.GUParentUserID = (new BLL.AgentInfo().GetModel(txtAgentAccount.Text.Trim()).AgentID); if (txtGUPasswd.Text.Trim() != "") { gu.GUPasswd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtGUPasswd.Text.Trim(), "MD5"); } else { Model.GameUserInfo guser = new BLL.GameUserInfo().GetModel(vipId); gu.GUPasswd = guser.GUPasswd; } bool result = new BLL.GameUserInfo().UpdateVIP(gu); if (result) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('保存成功')</script>"); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('保存失败')</script>"); } } catch (Exception) { throw; } }