// 解封账号dst private OpRes startAcc(DestGmUser dst, GMUser user, ParamStartStopGmAcc p) { SqlUpdateGenerator gen = new SqlUpdateGenerator(); gen.addField("state", GmState.STATE_NORMAL, FieldType.TypeNumber); if (dst.m_accType == AccType.ACC_GENERAL_AGENCY || dst.m_accType == AccType.ACC_AGENCY || dst.m_accType == AccType.ACC_API) { string sql = gen.getResultSql(TableName.GM_ACCOUNT, string.Format(" createCode like '{0}%' ", dst.m_createCode)); int count = user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); // 解封账号之下的玩家 gen.reset(); gen.addField("enable", 1, FieldType.TypeNumber); sql = gen.getResultSql(TableName.PLAYER_ACCOUNT_XIANXIA, string.Format(" createCode like '{0}%' ", dst.m_createCode)); user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); } else { string sql = gen.getResultSql(TableName.GM_ACCOUNT, string.Format(" acc= '{0}' ", p.m_acc)); int count = user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); } }
public override OpRes doQuery(object param, GMUser user) { m_result.Clear(); ParamRealTimeOrder p = (ParamRealTimeOrder)param; string cond = ""; OpRes res = getQueryCond(p, user, ref cond); if (res != OpRes.opres_success) { return(res); } string cmd = string.Format(SQL_QUERY_REAL_TIME_ORDER, TableName.PLAYER_ORDER_COMPLETE, cond, (p.m_curPage - 1) * p.m_countEachPage, p.m_countEachPage); // 查看满足条件的记当个数 user.totalRecord = user.sqlDb.getRecordCountNoWhere(TableName.PLAYER_ORDER_COMPLETE, cond, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); List <Dictionary <string, object> > dataList = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (dataList == null) { return(OpRes.op_res_failed); } for (int i = 0; i < dataList.Count; i++) { OrderInfoItem info = new OrderInfoItem(); m_result.Add(info); Dictionary <string, object> data = dataList[i]; info.m_orderId = Convert.ToString(data["orderId"]); info.m_apiOrderId = Convert.ToString(data["apiOrderId"]); info.m_genTime = Convert.ToDateTime(data["genTime"]); info.m_finishTime = Convert.ToDateTime(data["finishTime"]); info.m_gmAcc = Convert.ToString(data["gmAcc"]); info.m_playerAcc = Convert.ToString(data["playerAcc"]); info.m_orderType = Convert.ToInt32(data["orderType"]); info.m_money = Convert.ToInt64(data["money"]); info.m_orderState = Convert.ToInt32(data["orderState"]); info.m_failReason = Convert.ToInt32(data["failReason"]); } return(OpRes.opres_success); }
public override OpRes doQuery(object param, GMUser user) { ParamPlayerOrderQuery p = (ParamPlayerOrderQuery)param; m_result.Clear(); string cmd = genOrderSqlCmd(p, user); List <Dictionary <string, object> > dataList = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (dataList == null) { return(OpRes.op_res_failed); } for (int i = 0; i < dataList.Count; i++) { ResultPlayerOrderItem info = new ResultPlayerOrderItem(); m_result.Add(info); Dictionary <string, object> data = dataList[i]; info.m_orderId = Convert.ToString(data["orderId"]); info.m_orderTime = Convert.ToDateTime(data["orderTime"]).ToString(ConstDef.DATE_TIME24); info.m_playerAcc = Convert.ToString(data["playerAcc"]); info.m_playerOwner = Convert.ToString(data["playerOwner"]); info.m_playerOwnerCreator = Convert.ToString(data["playerOwnerCreator"]); info.m_orderState = Convert.ToInt32(data["orderState"]); info.m_orderMoney = Convert.ToInt32(data["orderMoney"]); info.m_orderType = Convert.ToInt32(data["orderType"]); } return(OpRes.opres_success); }
private void scoreLog(string tableName, ParamScore p, long score, GMUser user) { long remainMoney = ItemHelp.getRemainMoney(p.m_toAcc, p.isToPlayer(), user); // 操作账号余额 long opSrcRemainMoney = ItemHelp.getRemainMoney(user.m_user, false, user); /*string cmd = string.Format(SqlStrCMD.SQL_CMD_PLAYER_SCORE, * tableName, * DateTime.Now.ToString(ConstDef.DATE_TIME24), * user.m_user, * p.m_toAcc, * p.m_op, * score, * user.m_moneyType, * user.m_depth, * user.m_createCode, * p.isToPlayer() ? AccType.ACC_PLAYER : 0, * remainMoney); * * user.sqlDb.executeOp(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); */ // 生成上下分记录 OrderInfo oinfo = OrderGenerator.genOfflineSuccessOrder(user.m_user, p.m_toAcc, score, p.m_op, p.isToPlayer() ? AccType.ACC_PLAYER : 0, remainMoney, p.m_orderFrom); // 生成上下分记录 string cmd = OrderGenerator.genSqlForLogScore(oinfo, user.m_createCode, opSrcRemainMoney); user.sqlDb.executeOp(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); }
public DestGmUser(string acc, GMUser user) { if (acc == user.m_user) { m_isSelf = true; return; } string sqlCmd = string.Format(SQL_QUERY, TableName.GM_ACCOUNT, acc); Dictionary <string, object> r = user.sqlDb.queryOne(sqlCmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (r != null) { do { string dbAcc = Convert.ToString(r["acc"]); if (dbAcc != acc) { m_isExists = false; break; } m_createCode = Convert.ToString(r["createCode"]); m_accType = Convert.ToInt32(r["accType"]); m_state = Convert.ToInt32(r["state"]); m_money = Convert.ToInt64(r["money"]); m_owner = Convert.ToString(r["owner"]); m_isExists = true; } while (false); } }
public OpRes dispatch(ParamModifyGmRight p, GMUser user) { DestGmUser dst = new DestGmUser(p.m_acc, user); if (!dst.m_isExists) { return(OpRes.op_res_no_right); } bool res = DyOpModifyGmRight.canDispatchRight(user, dst.m_accType, () => { return(dst.m_owner == user.m_user); }); if (!res) { return(OpRes.op_res_no_right); } SqlUpdateGenerator gen = new SqlUpdateGenerator(); gen.addField("gmRight", p.m_right, FieldType.TypeString); string sql = gen.getResultSql(TableName.GM_ACCOUNT, string.Format("acc='{0}'", p.m_acc)); int count = user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); }
private OpRes statDirectlyPlayer(MemberInfo minfo, string time, GMUser user) { string cmd = ""; ParamMemberInfo p = new ParamMemberInfo(); p.m_acc = minfo.m_acc; p.m_time = time; OpRes res = m_generator.genSearchSql(p, user, ref cmd); if (res != OpRes.opres_success) { return(res); } Dictionary <string, object> data = user.sqlDb.queryOne(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); StatResultWinLoseItem sitem = m_result.addItem(data, minfo.m_acc, AccType.ACC_PLAYER); if (sitem != null) { sitem.m_agentRatio = minfo.m_agentRatio; sitem.m_washRatio = minfo.m_washRatio; } return(OpRes.opres_success); }
private OpRes statOnePlayer(GMUser user, ParamWinLose param) { string cmd = ""; ParamMemberInfo p = new ParamMemberInfo(); p.m_acc = param.m_playerAcc; p.m_time = param.m_time; p.setPlayerWinLoseList(); OpRes res = m_generator.genSearchSql(p, user, ref cmd); if (res != OpRes.opres_success) { return(res); } List <Dictionary <string, object> > dataList = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (dataList != null) { foreach (var data in dataList) { m_result.addItem(data, p.m_acc, AccType.ACC_PLAYER); } } // StatResultWinLoseItem sitem = m_result.addItem(data, p.m_acc, AccType.ACC_PLAYER); // if (sitem != null) // { // sitem.m_agentRatio = minfo.m_agentRatio; // sitem.m_washRatio = minfo.m_washRatio; // } return(OpRes.opres_success); }
public override OpRes doQuery(object param, GMUser user) { m_result.Clear(); ParamGmAccountCascade p = (ParamGmAccountCascade)param; string cmd = string.Format("select acc from {0} where accType={1} and owner='{2}'", TableName.GM_ACCOUNT, p.m_searchAccType, p.m_owner); List <Dictionary <string, object> > dataList = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (dataList == null) { return(OpRes.op_res_failed); } for (int i = 0; i < dataList.Count; i++) { MemberInfo info = new MemberInfo(); m_result.Add(info); info.m_acc = Convert.ToString(dataList[i]["acc"]); } return(OpRes.opres_success); }
// OpRes agree(ResultAPIItem item, GMUser user) // { // return createAPI(user, item); // } OpRes refuse(ResultAPIItem item, GMUser user) { string cmd = string.Format(SQL_REFUSE, TableName.API_APPROVE, item.m_apiAcc); user.sqlDb.executeOp(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(OpRes.opres_success); }
private OpRes statBySeller(string creator, string time, GMUser user) { string cond = ""; ParamMemberInfo p = new ParamMemberInfo(); p.m_creator = creator; p.m_time = time; p.m_searchDepth = 0; OpRes res = m_generator.genSearchSql(p, user, ref cond); if (res != OpRes.opres_success) { return(res); } string cmd = ""; // 售货亭对下级管理员的存款及提款 cmd = string.Format(SqlStrCMD.SQL_STAT_STEP, //TableName.PLAYER_SCORE, cond); List <Dictionary <string, object> > dataList = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); doStatTypeDay(dataList, creator, time); return(OpRes.opres_success); }
// 返回账号acc的余额 public static long getRemainMoney(string acc, bool isPlayer, GMUser user) { string sql = ""; SqlSelectGenerator gen = new SqlSelectGenerator(); gen.addField("money"); if (isPlayer) { sql = gen.getResultSql(TableName.PLAYER_ACCOUNT_XIANXIA, string.Format("acc='{0}'", acc)); } else { sql = gen.getResultSql(TableName.GM_ACCOUNT, string.Format("acc='{0}'", acc)); } Dictionary <string, object> data = user.sqlDb.queryOne(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (data == null) { return(0); } return(Convert.ToInt64(data["money"])); }
private OpRes updateWashRatio(ParamModifyGmProperty p, DestGmUser dst, GMUser user) { if (dst.m_owner != user.m_user) { return(OpRes.op_res_no_right); } ParamCreateGmAccount param = new ParamCreateGmAccount(); param.m_washRatio = p.m_param; double washRatio = 0; if (!ItemHelp.isValidWashRatio(param, user, ref washRatio)) { return(OpRes.op_res_param_not_valid); } SqlUpdateGenerator gen = new SqlUpdateGenerator(); gen.addField("washRatio", washRatio, FieldType.TypeNumber); string sql = gen.getResultSql(TableName.GM_ACCOUNT, string.Format(" acc='{0}' ", p.m_acc)); int count = user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); }
public Player(string acc, GMUser user) { string sqlCmd = string.Format(SQL_QUERY, TableName.PLAYER_ACCOUNT_XIANXIA, acc); Dictionary <string, object> r = user.sqlDb.queryOne(sqlCmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); init(acc, r); }
OpRes removeWait(ResultPlayerOrderItem item, GMUser user) { string cmd = string.Format(SQL_CANCEL, TableName.PLAYER_ORDER_WAIT, item.m_orderId, item.m_playerAcc); int count = user.sqlDb.executeOp(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); }
// 开始统计 public override OpRes doStat(object param, GMUser user) { ParamStatPlayer p = (ParamStatPlayer)param; DateTime mint = DateTime.Now, maxt = mint; bool res = Tool.splitTimeStr(p.m_time, ref mint, ref maxt); if (!res) { return(OpRes.op_res_time_format_error); } m_result.reset(); string cmd = ""; statData fun = null; switch (p.m_statType) { case (int)StatSellerType.stat_seller_type_day: { // 售货亭对下级管理员的存款及提款 cmd = string.Format(CMD_STAT_PLAYER, "%Y-%m-%d", TableName.PLAYER_GAME_SCORE, TableName.PLAYER_ACCOUNT_XIANXIA, mint, maxt, p.m_moneyType); fun = doStatTypeDay; } break; case (int)StatSellerType.stat_seller_type_month: { cmd = string.Format(CMD_STAT_PLAYER, "%Y-%m", TableName.PLAYER_GAME_SCORE, TableName.PLAYER_ACCOUNT_XIANXIA, mint, maxt, p.m_moneyType); fun = doStatTypeDay; } break; } List <Dictionary <string, object> > dataList = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (fun != null) { fun(dataList); } return(OpRes.opres_success); }
private OpRes delGmAcc(ParamDelAcc p, GMUser user) { DestGmUser dst = new DestGmUser(p.m_acc, user); if (dst.m_isSelf) { return(OpRes.op_res_no_right); } if (!dst.m_isExists) { return(OpRes.op_res_no_right); } if (!dst.isDerivedFrom(user)) { return(OpRes.op_res_no_right); } int childCount = (int)user.sqlDb.getRecordCount(TableName.GM_ACCOUNT, string.Format("owner='{0}' ", dst.m_owner), 0, MySqlDbName.DB_XIANXIA); SqlUpdateGenerator up = new SqlUpdateGenerator(); up.addField("childNodeNumber", childCount, FieldType.TypeNumber); string sql = up.getResultSql(TableName.GM_ACCOUNT, string.Format("acc='{0}' and childNodeNumber=0 ", dst.m_owner)); int count = user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (count >= 0) { SqlDeleteGenerator gen = new SqlDeleteGenerator(); string cmd1 = gen.getResultSql(TableName.GM_ACCOUNT, string.Format(" createCode like '{0}%' ", dst.m_createCode)); user.sqlDb.executeOp(cmd1, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); string cmd2 = gen.getResultSql(TableName.PLAYER_ACCOUNT_XIANXIA, string.Format(" createCode like '{0}%' ", dst.m_createCode)); count = user.sqlDb.executeOp(cmd2, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count >= 0 ? OpRes.opres_success : OpRes.op_res_db_failed); } return(OpRes.op_res_db_failed); }
OpRes autoForwardOrder(ParamPlayerOrder p, GMUser user) { SqlUpdateGenerator gen = new SqlUpdateGenerator(); gen.addField("forwardOrder", p.m_isAutoForward, FieldType.TypeNumber); string cond = string.Format(" acc = '{0}' ", user.m_user); string sqlCmd = gen.getResultSql(TableName.GM_ACCOUNT, cond); int count = user.sqlDb.executeOp(sqlCmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); }
public static string getCreateCode(string acc, GMUser user) { string createCode = "sss"; string execCmd = string.Format("select createCode from {0} where acc='{1}' and createCode like '{2}%' ", TableName.GM_ACCOUNT, acc, user.m_createCode); Dictionary <string, object> ret = user.sqlDb.queryOne(execCmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (ret != null && ret.ContainsKey("createCode")) { createCode = Convert.ToString(ret["createCode"]); } return(createCode); }
// 删除操作日志 private OpRes delGmOpLog(ParamDelAcc p, GMUser user) { if (!user.isAdmin()) { return(OpRes.op_res_no_right); } SqlDeleteGenerator gen = new SqlDeleteGenerator(); string cmd = gen.getResultSql(TableName.OPLOG, "1=1"); int count = user.sqlDb.executeOp(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count >= 0 ? OpRes.opres_success : OpRes.op_res_db_failed); }
// 开始统计 public override OpRes doStat(object param, GMUser user) { ParamStatSeller p = (ParamStatSeller)param; string cond = ""; OpRes res = m_generator.genSearchSql(p, user, ref cond); if (res != OpRes.opres_success) { return(res); } m_result.reset(); string cmd = ""; statData fun = null; switch (p.m_statType) { case (int)StatSellerType.stat_seller_type_day: { // 售货亭对下级管理员的存款及提款 // cmd = string.Format(SqlStrCMD.STR_FTM1, "%Y-%m-%d", // TableName.PLAYER_SCORE, // cond); fun = doStatTypeDay; } break; case (int)StatSellerType.stat_seller_type_month: { // 售货亭对下级管理员的存款及提款 // cmd = string.Format(SqlStrCMD.STR_FTM1, "%Y-%m", // TableName.PLAYER_SCORE, // cond); fun = doStatTypeDay; } break; } List <Dictionary <string, object> > dataList = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (fun != null) { fun(dataList); } return(OpRes.opres_success); }
public override OpRes doDyop(object param, GMUser user) { ParamModifyGmProperty p = (ParamModifyGmProperty)param; DestGmUser dst = new DestGmUser(p.m_acc, user); if (!dst.m_isExists) { return(OpRes.op_res_no_right); } OpRes res = OpRes.op_res_failed; int count = 0; switch (p.m_whichProperty) { case ParamModifyGmProperty.MODIFY_ALIASNAME: { if (!dst.isDerivedFrom(user)) { return(OpRes.op_res_no_right); } SqlUpdateGenerator gen = new SqlUpdateGenerator(); gen.addField("aliasName", p.m_param, FieldType.TypeString); string sql = gen.getResultSql(TableName.GM_ACCOUNT, string.Format(" acc='{0}' ", p.m_acc)); count = user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); res = count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed; } break; case ParamModifyGmProperty.MODIFY_AGENT_RATION: { res = updateAgentRatio(p, dst, user); } break; case ParamModifyGmProperty.MODIFY_WASH_RATION: { res = updateWashRatio(p, dst, user); } break; case ParamModifyGmProperty.MODIFY_ACC_STATE: { res = modifyAccState(p, user); } break; } return(res); }
// 函数自拼接所需要的参数 public void addLog(int opType, OpParam opParam, GMUser user, string comment = "") { SqlInsertGenerator gen = new SqlInsertGenerator(); gen.addField("opAcc", user.m_user, FieldType.TypeString); gen.addField("opAccIP", user.m_ip, FieldType.TypeString); gen.addField("opType", opType, FieldType.TypeNumber); gen.addField("opTime", DateTime.Now.ToString(ConstDef.DATE_TIME24), FieldType.TypeString); gen.addField("opParam", opParam.getString(), FieldType.TypeString); gen.addField("opComment", comment, FieldType.TypeString); string sql = gen.getResultSql(TableName.OPLOG); user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); }
private OpRes addScoreDirect(string acc, long score, GMUser user) { if (score < 0) { return(OpRes.op_res_failed); } string cmd = string.Format(SqlStrCMD.SQL_ADD_SCORE_TO_MGR_DIRECT, TableName.GM_ACCOUNT, score, acc); int count = user.sqlDb.executeOp(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); }
void addFinish(ResultPlayerOrderItem item, GMUser user, int orderState) { SqlInsertGenerator gen = new SqlInsertGenerator(); gen.addField("orderId", item.m_orderId, FieldType.TypeString); gen.addField("orderTime", item.m_orderTime, FieldType.TypeString); gen.addField("playerAcc", item.m_playerAcc, FieldType.TypeString); gen.addField("playerOwner", item.m_playerOwner, FieldType.TypeString); gen.addField("curOpAcc", user.m_user, FieldType.TypeString); gen.addField("orderState", orderState, FieldType.TypeNumber); gen.addField("playerOwnerCreator", item.m_playerOwnerCreator, FieldType.TypeString); gen.addField("orderMoney", item.m_orderMoney, FieldType.TypeNumber); gen.addField("orderType", item.m_orderType, FieldType.TypeNumber); string sqlCmd = gen.getResultSql(TableName.PLAYER_ORDER_FINISH); int count = user.sqlDb.executeOp(sqlCmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); }
// 修改玩家别名 public OpRes modifyPlayerAliasName(string acc, string newName, GMUser user) { if (!canOpPlayer(acc, user)) { return(OpRes.op_res_no_right); } SqlUpdateGenerator gen = new SqlUpdateGenerator(); gen.addField("aliasName", newName, FieldType.TypeString); string cmd = gen.getResultSql(TableName.PLAYER_ACCOUNT_XIANXIA, string.Format("acc='{0}'", acc)); int count = user.sqlDb.executeOp(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); }
private OpRes addScore(string acc, long score, GMUser user) { OpRes res = canDoScoreToGM(acc, score, true, user); if (res != OpRes.opres_success) { return(res); } string cmd = string.Format(SqlStrCMD.SQL_ADD_SCORE_TO_MGR, TableName.GM_ACCOUNT, score, acc); int count = user.sqlDb.executeOp(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); }
bool updateChildNodeNumber(GMUser user, CreateInfo info) { GMUser dstUser = AccountSys.getInstance().getUser(info.m_acc); if (dstUser != null) { dstUser.m_childCount++; } info.m_childCount++; SqlUpdateGenerator gen = new SqlUpdateGenerator(); gen.addField("childNodeNumber", info.m_childCount, FieldType.TypeNumber); string sqlCmd = gen.getResultSql(TableName.GM_ACCOUNT, string.Format(" acc='{0}' ", info.m_acc)); int count = user.sqlDb.executeOp(sqlCmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0); }
public override OpRes doDyop(object param, GMUser user) { if (!user.isAPIAcc()) { return(OpRes.op_res_no_right); } string gameCloseList = (string)param; string gameList = ItemHelp.getReverseGameList(gameCloseList); SqlUpdateGenerator gen = new SqlUpdateGenerator(); gen.addField("gameClose", gameList, FieldType.TypeString); string sql = gen.getResultSql(TableName.GM_ACCOUNT, string.Format("acc='{0}'", user.m_user)); int count = user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); return(count > 0 ? OpRes.opres_success : OpRes.op_res_db_failed); }
protected void onModifyHome(object sender, EventArgs e) { GMUser user = (GMUser)Session["user"]; SqlUpdateGenerator gen = new SqlUpdateGenerator(); gen.addField("home", m_home.Text, FieldType.TypeString); string sql = gen.getResultSql(TableName.GM_ACCOUNT, string.Format(" acc='{0}' ", m_acc.Text)); int count = user.sqlDb.executeOp(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (count > 0) { m_res.InnerText = OpResMgr.getInstance().getResultString(OpRes.opres_success); } else { m_res.InnerText = OpResMgr.getInstance().getResultString(OpRes.op_res_db_failed); } }