public bool EditLowerInfo(LowerInfo info) { string sql = String.Format(@"update UserInfo set Bonus={0} where UserID='{1}'", info.Bonus, info.UserID); if (SqlHelper.getInstance.ExcuteNonQuery(sql) > 0) return true; else return false; }
public bool AddLowerInfo(LowerInfo info) { string sql = "select * from UserInfo where UserID='" + info.UserID + "'"; if (SqlHelper.getInstance.ExcuteExist(sql)) return false; string[] sqls = new string[2]; string sql_1 = String.Format(@"insert into UserInfo(UserID,UserPwd,ParentUID,RegTime,IsOnline,IsActive,Bonus,FullPath,RoleID) values('{0}','{1}',{2},'{3}',{4},{5},{6},'{7}',{8})", info.UserID, info.UserPwd, info.ParentUID, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), 0, 1, info.Bonus, info.FullPath, info.RoleID); sqls[0] = sql_1; string sql_2 = "insert into CapitalInfo(userID,GameScores,EnableScores,DisableScores) values('" + info.UserID + "',0,0,0)"; sqls[1] = sql_2; bool returnValue = SqlHelper.getInstance.ExcuteTrancationForSQL(sqls); User user = SqlHelper.getInstance.ExcuteForList<User>(sql).FirstOrDefault(); if (user != null) { sql = "update CapitalInfo set ID=" + user.ID + " where UserID='" + info.UserID + "'"; SqlHelper.getInstance.ExcuteNonQuery(sql); } return returnValue; }