UI層算法
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using BLL;
using Model;
using Common;數據庫
public partial class player : System.Web.UI.Page
{
private StudentBll bll = new StudentBll();
protected void Page_Load(object sender, EventArgs e)
{
List<Juticahngfen> juti = bll.GetAllvoll();
StringBuilder sb = new StringBuilder();編程
sb.Append("<div style='position:absolute;background-color: #669999; font-family: 隸書;font-size:20px; text-align:center;'><table border='1px;solid'style='width:500px;height:600px'><tr><th>編號</th><th>局數</th><th>隊名</th><th>得分</th></tr>");
foreach (var item in juti)
{
sb.Append(string.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td></tr>", item.ID, item.jushu, item.duiming, item.defen));
}
sb.Append("<tr><td colspan='4'><a href='player.aspx'>最終比分</a></td></tr></table>");
Response.Write(sb.ToString());
}
}架構
在本週週三開始進行三次架構的設計,本週週六下午開始作的,在開始以前思考了上週的解決方法,代碼不會打,因此就仿了ASP.NET上面查詢詳情的作法,能夠用三層架構把數據顯示在界面上,在作的過程當中一直沒能運行成功,花費了一個多小時的時間,最後請教了個人兩位室友,她們幫我解決了問題,讓我意識到結對編程是對於學習是頗有幫助的。因此要多和同窗交流。因爲個人完成做業的時間比較匆忙,因此在最後比分的顯示中用的是控件,沒有用三層架構。因此沒有具體代碼。但願之後多多改進。而且我對算法比較生疏,因此在每一局小分的狀況中我沒有作。但願下一週請教同窗嘗試一下。學習