public string Save(HttpRequest req) { string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { Base_Users user = new Base_Users(); user.UserID = Convert.ToInt32(req["AdminID"] ?? "0"); user.Username = GameRequest.GetFormString("UserName"); user.canHasSubAgent = Convert.ToByte(req.Form["canHasSub"]); user.AgentLevelLimit = Convert.ToInt32(req.Form["AgentLevelLimit"]); user.RoleID = Convert.ToInt32(req.Form["RoleID"]); user.GradeID = Convert.ToInt32(req.Form["GradeID"]); user.Nullity = byte.Parse(GameRequest.GetFormString("AgentStatus")); user.Percentage = GameRequest.GetFormInt("Revenue", 0); Message msg = aidePlatformManagerFacade.ModifyUserInfo(user); if (msg.Success) { LogHelper2.SaveSuccessLog("修改[" + req.Form["UserName"] + "]", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("保存成功")); } else { LogHelper2.SaveErrLog("修改[" + req.Form["UserName"] + "]", msg.Content, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(msg.Content)); } } catch (Exception ex) { LogHelper2.SaveErrLog("修改[" + req.Form["UserName"] + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(ex.Message)); } }
public override string Delete(HttpRequest req) { if (!IsAuthUserOperationPermission()) { return(JsonResultHelper.GetErrorJson("对不起,您没有操作权限!")); } string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); string json = ""; string ids = req["ids"]; try { string msg = aidePlatformManagerFacade.DeleteRoleEx(ids); if (msg == "success") { json = JsonResultHelper.GetSuccessJson("成功删除!"); LogHelper2.SaveSuccessLog("删除[" + ids + "]", userExt.UserID, (int)LogOperationEnum.DeleteRole, GameRequest.GetUserIP(), module); } else { json = JsonResultHelper.GetErrorJson(msg + " 已存在关联用户,不能删除!"); LogHelper2.SaveErrLog("删除[" + ids + "]", msg, userExt.UserID, (int)LogOperationEnum.AddGamer, GameRequest.GetUserIP(), module); } } catch (Exception ex) { LogHelper2.SaveErrLog("删除[" + ids + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.DeleteRole, GameRequest.GetUserIP(), module); json = JsonResultHelper.GetErrorJson(ex.Message); } return(json); }
public string UpdateSpreaderID(HttpRequest req) { string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { int UserID = Convert.ToInt32(req["UserID"]); string oldCode = req["oldSpreaderID"]; string newCode = req["SpreaderID"]; int r = aidePlatformManagerFacade.UpdateSpreaderID(UserID, oldCode, newCode); if (r == -1) { return(JsonResultHelper.GetErrorJson("邀请码不存在!")); } else if (r == -2) { return(JsonResultHelper.GetErrorJson("邀请码已被占用!")); } LogHelper2.SaveSuccessLog("修改[" + req["UserName"] + "]", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("保存成功")); } catch (Exception ex) { LogHelper2.SaveErrLog("修改[" + req["UserName"] + "]邀请码", ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(ex.Message)); } }
public override string New(HttpRequest req) { string json = ""; string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { Base_Users user = new Base_Users(); user.Username = req.Form["UserName"]; user.Password = Utility.MD5(req.Form["Password"]); bool oIsBand = (req.Form["IsBand"] == "on" ? true : false); byte IsBand = Convert.ToByte(oIsBand); user.BandIP = req.Form["BandIP"]; user.RoleID = Convert.ToInt32(string.IsNullOrEmpty(req.Form["RoleID"]) ? "0" : req.Form["RoleID"]); user.LastLoginIP = Utility.UserIP; string sNullity = req.Form["Nullity"]; user.Nullity = Convert.ToByte(sNullity == "on" ? 1 : 0); if (string.IsNullOrEmpty(user.Username)) { json = JsonResultHelper.GetSuccessJson("用户名不能为空"); } else { Base_Users getuser = aidePlatformManagerFacade.GetUserByAccounts(user.Username); if (getuser != null) { json = JsonResultHelper.GetSuccessJson("用户名已经存在!"); LogHelper2.SaveErrLog("新增账号[" + req.Form["UserName"] + "]", "保存失败!用户名已经存在!", userExt.UserID, (int)LogOperationEnum.AddAdmin, GameRequest.GetUserIP(), module); } else { int id = aidePlatformManagerFacade.AddUser(user); if (id == -1) { json = JsonResultHelper.GetSuccessJson("保存失败!"); } else { json = JsonResultHelper.GetSuccessJson("保存成功!"); } LogHelper2.SaveSuccessLog("新增账号[" + req.Form["UserName"] + "]", userExt.UserID, (int)LogOperationEnum.AddAdmin, GameRequest.GetUserIP(), module); } } } catch (Exception ex) { json = JsonResultHelper.GetErrorJson(ex.Message); LogHelper2.SaveErrLog("新增账号[" + req.Form["UserName"] + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.AddAdmin, GameRequest.GetUserIP(), module); } return(json); }
public override string New(HttpRequest req) { string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { string sword = req["SensitiveWord"]; aidePlatformManagerFacade.AddSensitiveWordSet(sword); LogHelper2.SaveSuccessLog("新增敏感词【" + sword + "】", userExt.UserID, (int)LogOperationEnum.EditSensitiveWord, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("保存成功!")); } catch (Exception ex) { return(JsonResultHelper.GetErrorJson("保存失败:" + ex.Message)); } }
public override string Delete(HttpRequest req) { string ids = req["ids"]; string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { aidePlatformManagerFacade.DeleteUser(ids); LogHelper2.SaveSuccessLog("删除[" + ids + "]", userExt.UserID, (int)LogOperationEnum.DeleteAdmin, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("删除成功!")); } catch (Exception ex) { LogHelper2.SaveErrLog("删除[" + ids + "]:", ex.Message, userExt.UserID, (int)LogOperationEnum.DeleteAdmin, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(ex.Message)); } }
public static string Logout() { string json = ""; AdminCookie.SesionUser userExt = AdminCookie.GetUserFromCookie(); try { aidePlatformManagerFacade.UserLogout(); LogHelper2.SaveSuccessLog("[" + userExt.Username + "]退出成功", userExt.UserID, (int)LogOperationEnum.Logout, GameRequest.GetUserIP(), "登录模块"); json = JsonResultHelper.GetSuccessJson("退出成功"); } catch (Exception ex) { LogHelper2.SaveErrLog("[" + userExt.Username + "]退出失败", "", userExt.UserID, (int)LogOperationEnum.Login, GameRequest.GetUserIP(), "登录模块"); json = JsonResultHelper.GetErrorJson(ex.Message); } return(json); }
private string ChangePassword(HttpRequest req) { string UserName = req["UserName"]; string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { int UserID = Convert.ToInt32(req["UserID"]); aidePlatformManagerFacade.ResetUserPassword(UserID, Utility.MD5("123456")); LogHelper2.SaveSuccessLog("重置[" + UserName + "]密码", userExt.UserID, (int)LogOperationEnum.ChangeAdminPassword, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("保存成功!")); } catch (Exception ex) { LogHelper2.SaveErrLog("重置[" + UserName + "]密码", ex.Message, userExt.UserID, (int)LogOperationEnum.ChangeAdminPassword, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson("保存失败:" + ex.Message)); } }
public override string New(HttpRequest req) { string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { string ids = req.Form["ids"]; int GiftGold = Convert.ToInt32(req.Form["GiftGold"] ?? "0"); string Reason = req.Form["Reason"]; string LoginIP = GameRequest.GetUserIP(); bool IsAgent = Convert.ToBoolean(req["IsAgent"] ?? "false"); Message msg = null; if (IsAgent) { msg = aideTreasureFacade.GrantTreasure_Agent(userExt.AgentID, ids, ids.Split(',').Length, GiftGold, userExt.AgentID, Reason, LoginIP); } else { msg = aideTreasureFacade.GrantTreasure(ids, GiftGold, userExt.UserID, Reason, LoginIP); } string json = ""; if (msg.Success) { json = JsonResultHelper.GetSuccessJson("操作成功"); LogHelper2.SaveSuccessLog("赠送[" + ids + "]金币", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); } else { if (msg.MessageID == -4) { msg.Content = "操作失败,可用金币不足!"; } json = JsonResultHelper.GetErrorJson(msg.Content); LogHelper2.SaveErrLog("赠送[" + ids + "]金币", msg.Content, userExt.UserID, (int)LogOperationEnum.AddGamer, GameRequest.GetUserIP(), module); } return(json); } catch (Exception ex) { LogHelper2.SaveSuccessLog(ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(ex.Message)); } }
private string SetNullity(HttpRequest req, int nullity) { string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); string ids = req["ids"]; try { Dictionary <string, object> kvs = new Dictionary <string, object>(); kvs.Add(Base_Users._Nullity, nullity); aidePlatformManagerFacade.UpdateUserBy("AND UserID IN (" + ids + ")", kvs); LogHelper2.SaveSuccessLog((nullity == 1 ? "冻结[" : "解冻") + ids + "]", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("修改成功")); } catch (Exception ex) { LogHelper2.SaveErrLog((nullity == 1 ? "冻结[" : "解冻") + ids + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(ex.Message)); } }
private string ChangeRole(HttpRequest req) { int UserID = Convert.ToInt32(req.Form["UserID"]); string RoleID = req.Form["RoleID"]; Dictionary <string, object> kvs = new Dictionary <string, object>(); kvs.Add(Base_Users._RoleID, RoleID); string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { aidePlatformManagerFacade.UpdateUserByID(UserID, kvs); LogHelper2.SaveSuccessLog("[" + req.Form["UserName"] + "]更换角色成[]", userExt.UserID, (int)LogOperationEnum.ChangeAdminRole, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("保存成功!")); } catch (Exception ex) { LogHelper2.SaveErrLog("[" + req.Form["UserName"] + "]更换角色成:", ex.Message, userExt.UserID, (int)LogOperationEnum.ChangeAdminRole, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson("保存失败!" + ex.Message)); } }
public string ChangeUserPassword(HttpRequest req) { string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { int UserID = Convert.ToInt32(req.Form["UserID"]); string oldpwd = req.Form["oldPwd"]; string newpwd = req.Form["newPwd"]; int i = aidePlatformManagerFacade.ModifyUserPassword(UserID, Utility.MD5(oldpwd), Utility.MD5(newpwd)); if (i == -1) { return(JsonResultHelper.GetErrorJson("原密码输入错误")); } return(JsonResultHelper.GetSuccessJson("修改成功!")); } catch (Exception ex) { LogHelper2.SaveErrLog("修改[" + req["UserName"] + "]密码", ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(ex.Message)); } }
public override string New(HttpRequest req) { string json = ""; string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { string subType = req["subType"]; string objson = JsonUrlEncode(req.Form.ToString()); switch (subType) { case "spreadoptionsset": DataTable dt0 = JsonToDataTable(objson, new List <string>() { "RoleID", "GradeID", "Rate", "ARate", "BRate", "CRate" }); aidePlatformManagerFacade.SaveSpreaderOptions(dt0); json = JsonResultHelper.GetSuccessJson("保存成功!"); LogHelper2.SaveSuccessLog("修改了分享返利比例", userExt.UserID, (int)LogOperationEnum.SpreadOption, GameRequest.GetUserIP(), module); break; case "agentrevenesset": DataTable dt1 = JsonToDataTable(objson, new List <string>() { "UserID", "Percentage" }); aidePlatformManagerFacade.SaveAgentRevenesSet(dt1); json = JsonResultHelper.GetSuccessJson("保存成功!"); LogHelper2.SaveSuccessLog("修改了代理返利比例", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); break; } } catch (Exception ex) { json = JsonResultHelper.GetErrorJson(ex.Message); LogHelper2.SaveErrLog("修改返利比例", ex.Message, userExt.UserID, (int)LogOperationEnum.AddRole, GameRequest.GetUserIP(), module); } return(json); }
public override string New(HttpRequest req) { if (!IsAuthUserOperationPermission()) { return(JsonResultHelper.GetErrorJson("对不起,您没有操作权限!")); } string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { Base_Roles Role = new Base_Roles(); Role.RoleName = req.Form["RoleName"]; Role.Description = req.Form["Description"]; //Role.Operator = req.Form["AgentLevel"]; Role.Operator = req.Form["Operator"]; string created = req.Form["Created"]; string modified = req.Form["Modified"]; Role.Created = DateTime.Parse(created); Role.Modified = DateTime.Parse(modified); Message msg = aidePlatformManagerFacade.InsertRole(Role); string json = ""; if (msg.Success) { json = JsonResultHelper.GetSuccessJson("保存成功!"); } else { json = JsonResultHelper.GetErrorJson(msg.Content); } LogHelper2.SaveSuccessLog("新增角色[" + req.Form["RoleName"] + "]", userExt.UserID, (int)LogOperationEnum.AddRole, GameRequest.GetUserIP(), module); return(json); } catch (Exception ex) { LogHelper2.SaveErrLog("新增角色[" + req.Form["RoleName"] + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.AddRole, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(ex.Message)); } }
private string SetNullity(HttpRequest req, byte Nullity) { Dictionary <string, object> kvs = new Dictionary <string, object>(); string ids = req["ids"]; StringBuilder conditionAppend = new StringBuilder(); conditionAppend.Append(" AND UserID IN (" + ids + ")"); kvs.Add(Base_Users._Nullity, Nullity); string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { aidePlatformManagerFacade.UpdateUserBy(conditionAppend.ToString(), kvs); LogHelper2.SaveSuccessLog("冻结账号[" + ids + "]", userExt.UserID, Convert.ToBoolean(Nullity) ? (int)LogOperationEnum.NullityAdmin : (int)LogOperationEnum.NoNullityAdmin, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("保存成功!")); } catch (Exception ex) { LogHelper2.SaveErrLog("冻结账号[" + ids + "]", ex.Message, userExt.UserID, Convert.ToBoolean(Nullity) ? (int)LogOperationEnum.NullityAdmin : (int)LogOperationEnum.NoNullityAdmin, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson("保存失败!" + ex.Message)); } }
// public static bool isDone = false; public static string Login(HttpRequest req) { string username = req.Form["username"].Trim(); string password = req.Form["password"];//CryptHelper.Descrypt(username, GameRequest.GetFormString("password")); try { if (!Validate.IsUserName(username)) { return(JsonResultHelper.GetErrorJson("用户名格式不正确!")); } else { Base_Users user = new Base_Users(); user.Username = username; user.Password = Utility.MD5(password); user.LastLoginIP = GameRequest.GetUserIP(); Message msg = aidePlatformManagerFacade.UserLogon(user); if (!msg.Success) { LogHelper2.SaveErrLog("用户名格式不正确", "", user.UserID, (int)LogOperationEnum.AddGamer, GameRequest.GetUserIP(), "登录模块"); return(JsonResultHelper.GetErrorJson(msg.Content)); } else { // isDone = false; LogHelper2.SaveSuccessLog("[" + username + "]成功登录", user.UserID, (int)LogOperationEnum.AddGamer, GameRequest.GetUserIP(), "登录模块"); return(JsonResultHelper.GetSuccessJson(msg.Content)); } } } catch (Exception ex) { return(JsonResultHelper.GetErrorJson(ex.Message)); } }
private string Save(HttpRequest req) { int UserID = Convert.ToInt32(req.Form["UserID"]); string Username = req.Form["UserName"]; bool oIsBand = (req.Form["IsBand"] == "on" ? true : false); byte IsBand = Convert.ToByte(oIsBand); string BandIP = req.Form["BandIP"]; string OrgUserName = req.Form["OrgUserName"]; int RoleID = Convert.ToInt32(string.IsNullOrEmpty(req.Form["RoleID"]) ? "0" : req.Form["RoleID"]); string LastLoginIP = Utility.UserIP; Dictionary <string, object> kvs = new Dictionary <string, object>(); kvs.Add(Base_Users._Username, Username); kvs.Add(Base_Users._IsBand, IsBand); kvs.Add(Base_Users._BandIP, BandIP); kvs.Add(Base_Users._RoleID, RoleID); string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); Base_Users getuser = aidePlatformManagerFacade.GetUserByAccountsAndUserId(UserID, Username); if (getuser != null) { return(JsonResultHelper.GetSuccessJson("用户名已经存在!")); } try { aidePlatformManagerFacade.UpdateUserByID(UserID, kvs); LogHelper2.SaveSuccessLog("修改[" + req.Form["UserName"] + "]", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("保存成功!")); } catch (Exception ex) { LogHelper2.SaveErrLog("修改[" + req.Form["UserName"] + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.ChangeAdminRole, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson("保存失败!" + ex.Message)); } }
public override string Edit(HttpRequest req) { if (!IsAuthUserOperationPermission()) { return(JsonResultHelper.GetErrorJson("对不起,您没有操作权限!")); } string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { Base_Roles Role = new Base_Roles(); Role.RoleName = req.Form["RoleName"]; Role.Description = req.Form["Description"]; Role.Operator = req.Form["AgentLevel"]; Role.Operator = req.Form["Operator"]; Role.RoleID = int.Parse(req.Form["RoleID"] == null ? "0" : req.Form["RoleID"]); string modified = req.Form["Modified"]; Role.Modified = DateTime.Now; Message msg = aidePlatformManagerFacade.UpdateRole(Role); if (msg.Success) { LogHelper2.SaveSuccessLog("修改角色[" + req.Form["RoleName"] + "]", userExt.UserID, (int)LogOperationEnum.EditRole, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetSuccessJson("保存成功!")); } else { LogHelper2.SaveErrLog("修改角色[" + req.Form["RoleName"] + "]", msg.Content, userExt.UserID, (int)LogOperationEnum.EditRole, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(msg.Content)); } } catch (Exception ex) { LogHelper2.SaveErrLog("修改角色[" + req.Form["RoleName"] + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.EditRole, GameRequest.GetUserIP(), module); return(JsonResultHelper.GetErrorJson(ex.Message)); } }
public override string New(HttpRequest req) { string json = ""; string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { AccountsInfo account = new AccountsInfo(); IndividualDatum datum = new IndividualDatum(); account.Accounts = GameRequest.GetFormString("UserName"); account.NickName = GameRequest.GetFormString("NickName"); account.LogonPass = Utility.MD5(GameRequest.GetFormString("Password")); account.InsurePass = Utility.MD5(GameRequest.GetFormString("cfPassword")); account.UnderWrite = TextFilter.FilterAll(GameRequest.GetFormString("underwrite")); account.Present = 0; account.LoveLiness = GameRequest.GetFormInt("txtlove", 0); account.Experience = GameRequest.GetFormInt("txtexpr", 0); account.Gender = Convert.ToByte(req.Form["rdosex"]); account.FaceID = (short)GameRequest.GetFormInt("org.faceId", 0); account.Nullity = Convert.ToByte(req.Form["ckbNullity"]); account.StunDown = Convert.ToByte(req.Form["ckbStunDown"]); account.MoorMachine = Convert.ToByte(req.Form["rdorobort"]); account.SpreaderID = userExt.AgentID; account.AgentID = userExt.AgentID; account.IsAndroid = Convert.ToByte(req.Form["chkIsAndroid"]); account.MasterOrder = Convert.ToByte(req.Form["rdoMasterOrder"]); account.Compellation = GameRequest.GetFormString("compellation"); //account.MemberOrder = Convert.ToByte(GameRequest.GetFormString("sendType")); //account.MemberOverDate = string.IsNullOrEmpty(GameRequest.GetFormString("OverMemberDate")) ? Convert.ToDateTime("1980-01-01") : Convert.ToDateTime(GameRequest.GetFormString("OverMemberDate")); //account.MemberSwitchDate = string.IsNullOrEmpty(GameRequest.GetFormString("OverMemberDate")) ? Convert.ToDateTime("1980-01-01") : Convert.ToDateTime(GameRequest.GetFormString("OverMemberDate")); account.RegisterIP = GameRequest.GetUserIP(); datum.QQ = GameRequest.GetFormString("qq"); datum.EMail = GameRequest.GetFormString("email"); datum.SeatPhone = GameRequest.GetFormString("seatphone"); datum.MobilePhone = GameRequest.GetFormString("mobilephone"); datum.PostalCode = GameRequest.GetFormString("postalcode"); datum.DwellingPlace = GameRequest.GetFormString("txtaddr"); datum.UserNote = GameRequest.GetFormString("txtnote"); Message msg = aideAccountsFacade.AddAccount(account, datum); if (msg.Success) { json = JsonResultHelper.GetSuccessJson("保存成功"); LogHelper2.SaveSuccessLog("新增玩家[" + req.Form["UserName"] + "]", userExt.UserID, (int)LogOperationEnum.AddGamer, GameRequest.GetUserIP(), module); } else { string strMessage = ""; int intMsgID = msg.MessageID; switch (intMsgID) { case -5: strMessage = "帐号已存在,请重新输入!"; break; case -4: strMessage = "昵称已存在,请重新输入!"; break; case -3: strMessage = "帐号已存在,请重新输入!"; break; case -2: strMessage = "参数有误!"; break; case -1: strMessage = "抱歉,未知服务器错误!"; break; case 1: strMessage = "用户添加成功,但未成功获取游戏 ID 号码!"; break; default: strMessage = "抱歉,未知服务器错误!"; break; } json = JsonResultHelper.GetErrorJson(strMessage); LogHelper2.SaveSuccessLog("新增玩家[" + req.Form["UserName"] + "]" + strMessage, userExt.UserID, (int)LogOperationEnum.AddGamer, GameRequest.GetUserIP(), module); } } catch (Exception ex) { json = JsonResultHelper.GetErrorJson(ex.Message); LogHelper2.SaveErrLog("新增玩家[" + req.Form["UserName"] + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.AddGamer, GameRequest.GetUserIP(), module); } return(json); }
public override string New(HttpRequest req) { string json = ""; string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0")); try { AccountsInfo account = new AccountsInfo(); IndividualDatum datum = new IndividualDatum(); Base_Users user = new Base_Users(); account.Accounts = GameRequest.GetFormString("UserName"); account.NickName = GameRequest.GetFormString("Nick"); account.LogonPass = Utility.MD5(GameRequest.GetFormString("Password")); account.InsurePass = account.LogonPass; account.UnderWrite = string.Empty; account.Present = 0; account.LoveLiness = 0; account.Experience = 0; account.Gender = Convert.ToByte(req.Form["Sex"]); account.FaceID = 0; account.Nullity = 0; account.StunDown = 0; account.MoorMachine = 0; account.IsAndroid = 0; account.UserRight = 0; account.MasterRight = 0; account.MasterOrder = 0; account.Compellation = GameRequest.GetFormString("compellation"); account.MemberOrder = 0; account.MemberOverDate = Convert.ToDateTime("1970-01-01"); account.MemberSwitchDate = Convert.ToDateTime("1970-01-01"); account.RegisterIP = GameRequest.GetUserIP(); string sIsAgent = req["IsAgent"]; bool IsAgent = Convert.ToBoolean(string.IsNullOrEmpty(sIsAgent) ? "false" : sIsAgent); if (!IsAgent) { account.AgentID = 0; } else { account.AgentID = userExt.AgentID; account.SpreaderID = userExt.AgentID; } datum.QQ = GameRequest.GetFormString("qq"); datum.EMail = GameRequest.GetFormString("email"); datum.SeatPhone = GameRequest.GetFormString("seatphone"); datum.MobilePhone = GameRequest.GetFormString("mobilephone"); datum.PostalCode = GameRequest.GetFormString("postalcode"); datum.DwellingPlace = GameRequest.GetFormString("txtaddr"); datum.UserNote = GameRequest.GetFormString("txtnote"); user.canHasSubAgent = Convert.ToByte(req["canHasSub"]); user.AgentLevelLimit = Convert.ToInt32(req["AgentLevelLimit"]); user.RoleID = Convert.ToInt32(req["RoleID"]); user.GradeID = Convert.ToInt32(req["GradeID"]); user.Percentage = Convert.ToInt32(req["Revenue"]); Message msg = new Message(); msg = aideAccountsFacade.AddSilver(userExt.UserID, 0, account, datum, user); if (msg.Success) { json = JsonResultHelper.GetSuccessJson("保存成功"); LogHelper2.SaveSuccessLog("新增代理[" + req.Form["UserName"] + "]", userExt.UserID, (int)LogOperationEnum.AddAgent, GameRequest.GetUserIP(), module); } else { string strMessage = ""; int intMsgID = msg.MessageID; switch (intMsgID) { case -5: strMessage = "帐号已存在,请重新输入!"; break; case -4: strMessage = "昵称已存在,请重新输入!"; break; case -3: strMessage = "帐号已存在,请重新输入!"; break; case -2: strMessage = "参数有误!"; break; case -1: strMessage = "抱歉,未知服务器错误!"; break; case 1: strMessage = "用户添加成功,但未成功获取游戏 ID 号码!"; break; default: strMessage = "抱歉,未知服务器错误!"; break; } json = JsonResultHelper.GetErrorJson(strMessage); LogHelper2.SaveErrLog("新增代理[" + req.Form["UserName"] + "]:", strMessage, userExt.UserID, (int)LogOperationEnum.AddAgent, GameRequest.GetUserIP(), module); } } catch (Exception ex) { json = JsonResultHelper.GetErrorJson(ex.Message); LogHelper2.SaveErrLog("新增代理[" + req.Form["UserName"] + "]:", ex.Message, userExt.UserID, (int)LogOperationEnum.AddAgent, GameRequest.GetUserIP(), module); } return(json); }