public void DaoJuZS() { string userId = UiCommon.UserLoginInfo.UserID; string userName = UiCommon.UserLoginInfo.UserName; string propId = Common.SqlEncode(Common.GetStringOfUrl("id")); string targetName = Common.GetStringOfUrl("targetname"); int count = Common.GetIntOfUrl("count"); BLL.Member member = new BLL.Member(); if (userName.Trim() == targetName.Trim()) { //1.如果被赠送用户是自己,不允许赠送 Response.Write("myself"); } else if (!member.ExistName(Common.SqlEncode(targetName))) { //2.被赠送的用户不存在 Response.Write("nouser"); } else if (count > member.GetDaoJuCount(userId, propId)) { //3.赠送人道具库中的道具数量不足或没有 Response.Write("nodaoju"); } else { //4.赠送 int iRows = member.ZengsongDaoJu(userId, member.GetUserID(targetName), propId, count); if (iRows > 0) { Response.Write("zsdjcg"); } else { Response.Write("zsdjsb"); } } }
protected void CreateUserClick(object sender, EventArgs e) { string username = string.Empty, nickname = string.Empty, pwd = string.Empty, idcard = string.Empty, realname = string.Empty; username = CommonManager.Web.RequestForm("u", ""); BLL.Member member = new BLL.Member(); if (member.ExistName(username)) { this.ErrorLabel.Text = "该用户名已经存在!"; return; } nickname = Server.HtmlDecode(CommonManager.Web.RequestForm("n", "").Replace(",", "''")); if (member.ExistNick(nickname)) { this.ErrorLabel.Text = "该昵称已经存在!"; return; } pwd = CommonManager.Web.RequestForm("pwd", ""); idcard = CommonManager.Web.RequestForm("idcard", ""); realname = CommonManager.Web.RequestForm("realname", ""); int dbLogoId = member.SetLogoID(1, 1); int userId = member.Add_UserInfo(username, nickname, string.Empty, 1, dbLogoId, pwd, pwd, idcard, string.Empty, string.Empty, Utility.Common.RequestIP, string.Empty, realname); if (userId > 0) { this.ErrorLabel.ForeColor = System.Drawing.Color.Green; this.ErrorLabel.Text = "用户创建成功!"; } else { this.ErrorLabel.Text = "抱歉,创建失败,可能是服务器繁忙,请稍后再试!!"; } }
protected void CreateUserClick(object sender, EventArgs e) { string username = string.Empty, nickname = string.Empty, pwd = string.Empty,idcard=string.Empty,realname=string.Empty; username = CommonManager.Web.RequestForm("u", ""); BLL.Member member = new BLL.Member(); if (member.ExistName(username)) { this.ErrorLabel.Text = "该用户名已经存在!"; return; } nickname =Server.HtmlDecode(CommonManager.Web.RequestForm("n", "").Replace(",","''")); if (member.ExistNick(nickname)) { this.ErrorLabel.Text = "该昵称已经存在!"; return; } pwd = CommonManager.Web.RequestForm("pwd", ""); idcard = CommonManager.Web.RequestForm("idcard", ""); realname = CommonManager.Web.RequestForm("realname", ""); int dbLogoId = member.SetLogoID(1, 1); int userId = member.Add_UserInfo(username, nickname, string.Empty, 1, dbLogoId, pwd, pwd, idcard, string.Empty, string.Empty, Utility.Common.RequestIP, string.Empty, realname); if( userId > 0 ) { this.ErrorLabel.ForeColor=System.Drawing.Color.Green; this.ErrorLabel.Text = "用户创建成功!"; } else { this.ErrorLabel.Text = "抱歉,创建失败,可能是服务器繁忙,请稍后再试!!"; } }