using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; namespace web.agent { public partial class viewcharacter1 : System.Web.UI.Page { private static string sql; private static DataSet ds; protected static int rcount; protected void Page_Load(object sender, EventArgs e) { } protected void tbsearch_Click(object sender, EventArgs e) { system system = new system(); string str = system.ChkSql(this.tbsuserid.Value.ToString().Trim()); sql = "select * from mhgame..tb_character where substring(character_name,1,1)!='@'"; string str2 = ""; if (str != "") { str2 = str2 + " and user_idx in(select propid from mhcmember..chr_log_info where id_loginid = '" + str + "')"; sql = sql + str2; ds = new DataProviders().ExecuteSqlDs(sql, "DataGrid1"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ds.Tables[0].Rows[i]["character_name"] = system.ConvertToBig5(ds.Tables[0].Rows[i]["character_name"].ToString(), 950); } this.DataGrid1.DataSource = ds; this.DataGrid1.CurrentPageIndex = 0; this.DataGrid1.DataBind(); rcount = ds.Tables[0].Rows.Count; } } protected void DataGrid1_SelectedIndexChanged(object sender, EventArgs e) { int num = int.Parse(this.DataGrid1.SelectedItem.Cells[0].Text.ToString()); DataProviders providers = new DataProviders(); SqlDataReader reader = providers.ExecuteSqlDataReader("select * from mhgame..tb_character where character_idx=" + num); if (reader.Read()) { this.tbuseridx.Value = reader["user_idx"].ToString(); this.tbchaidx.Value = reader["character_idx"].ToString(); this.tbchaname.Value = new system().ConvertToBig5(reader["character_name"].ToString(), 950); this.tbguild.Value = new system().ConvertToBig5(reader["character_munpaname"].ToString(), 950); this.tbparty.Value = reader["character_partyidx"].ToString(); //if (this.tbguild.Value.ToString() == "") //{ // this.btnsearchguild.Enabled = false; //} //else //{ // this.btnsearchguild.Enabled = true; //} this.ddsex.SelectedValue = reader["character_gender"].ToString(); this.ddstage.SelectedValue = reader["character_stage"].ToString(); this.ddmap.SelectedValue = reader["character_map"].ToString(); this.tbchalv.Value = reader["character_grade"].ToString(); this.tbmoney.Value = reader["character_money"].ToString(); this.tbchareset.Value = reader["webchareset"].ToString(); this.tbnewname.Value = reader["webnewname"].ToString(); this.tbgengoal.Value = reader["character_gengoal"].ToString(); this.tbsta.Value = reader["character_sta"].ToString(); this.tbdex.Value = reader["character_dex"].ToString(); this.tbsimmak.Value = reader["character_simmak"].ToString(); this.tbpoint.Value = reader["character_gradeuppoint"].ToString(); this.tbabilityexp.Value = reader["character_abilityexp"].ToString(); this.tbbadfame.Value = reader["character_badfame"].ToString(); this.tblogouttime.Value = reader["character_lastmodified"].ToString(); this.tbplaytime.Value = reader["character_playtime"].ToString(); } reader.Close(); providers.CloseConn(); } } }