public yuhun getYuhunByName(string yuhunName) { string sql = "select * from Table_Yuhun where YuhunName = '" + yuhunName + "'"; DataSet dataset = db.query(sql); DataRow datarow = dataset.Tables[0].Rows[0]; yuhun yh = new yuhun(); yh.YuhunId = datarow["YuhunId"].ToString(); yh.YuhunName = datarow["YuhunName"].ToString(); yh.YuhunType = datarow["YuhunType"].ToString(); yh.YuhunTime = datarow["YuhunTime"].ToString(); yh.YuhunPlace = datarow["YuhunPlace"].ToString(); yh.YuhunIntroduction = datarow["YuhunIntroduction"].ToString(); return(yh); }
private void button1_Click(object sender, EventArgs e) { string yuhunName = yhTextBox.Text.Trim().ToString(); //获得式神 yuhun yh = yhBLL.queryYuhunByName(yuhunName); //设置页面 显示御魂名称 yhname.Text = yh.YuhunName; //设置页面 显示御魂类型,并显示为红色 yhleixing.Text = yh.YuhunType; yhleixing.ForeColor = Color.Red; //设置页面显示御魂简介 richTextBox1.Text = yh.YuhunIntroduction; //设置页面显示御魂出现地点 richTextBox2.Text = yh.YuhunPlace; }