内容发布更新时间 : 2024/12/24 4:26:22星期一 下面是文章的全部内容请认真阅读。
5 系统的设计与实现
5.1 住户页面的设计与实现
作为小区物业管理系统主页[18],应尽可能多地提供小区及时信息。为了吸引和留住客户,网站除了创建自己的特色外,还需要使客户使用起来方便、易用。系统主界面主要包含以下信息内容,结构如下图5.1所示:
图5.1首页框架页面图
该框架页面对应的html代码为:
public partial class Default2 : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
this.xinwenfillgv();
18
this.qianfeifillgv();
if (Session[\ {
if (gvQf.Rows.Count == 0) {
Label1.Visible = false; Label2.Visible = true; } else {
Label2.Visible = false; Label1.Visible = false; }
return; } }
public void xinwenfillgv() {
SqlConnection con = DB.createDB(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; con.Open();
SqlDataAdapter sda = new SqlDataAdapter(\top 9 * from tb_xinwen order by fabushijian desc\
DataSet ds = new DataSet(); sda.Fill(ds, \ this.gvXw.DataSource = ds; this.gvXw.DataBind();
for (int i = 0; i <= gvXw.Rows.Count - 1; i++) {
DataRowView mydrv; string gintro;
if (this.gvXw.PageIndex == 0) {
mydrv = ds.Tables[\ gintro = Convert.ToString(mydrv[\
this.gvXw.Rows[i].Cells[0].Text = SubStr(gintro, 10); } else {
19
mydrv = ds.Tables[\ gintro = Convert.ToString(mydrv[\
this.gvXw.Rows[i].Cells[0].Text = SubStr(gintro, 10); } }
con.Close(); }
protected void gvXw_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow) {
e.Row.Attributes.Add(\
\
e.Row.Attributes.Add(\ e.Row.Cells[1].Text
Convert.ToDateTime(e.Row.Cells[1].Text).ToShortDateString(); } }
protected void gvQf_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow) {
e.Row.Attributes.Add(\
\
e.Row.Attributes.Add(\ e.Row.Cells[3].Text
Convert.ToDateTime(e.Row.Cells[3].Text).ToShortDateString(); } }
protected void LinkButton1_Click(object sender, EventArgs e) {
Response.Redirect(\ }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) {
Response.Redirect(\ }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) {
=
=
20
SqlConnection con = DB.createDB(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; con.Open();
cmd.CommandText = \count(*) from tb_zhuce where name='\+ this.txtyhname.Text + \ int a = Convert.ToInt32(cmd.ExecuteScalar()); if (a > 0) {
this.lblshibai.Visible = true; this.lblxzchdl.Visible = false; this.Label1.Visible = false;
Session[\ Session[\ this.qianfeifillgv(); }
5.2 管理员页面的设计与实现
后台管理是专供管理员使用的界面,登录需要专用的用户名和口令。小区物业管理系统网站后台管理功能强大,所有信息都可以在后台管理程序上进行管理。界面视图如图5.2所示:
21
图5.2管理员基本信息页面
管理员页面的部分代码为:
public partial class guanliindex : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e)
protected void LinkButton2_Click(object sender, EventArgs e) {
Response.Redirect(\ }
protected void LinkButton3_Click(object sender, EventArgs e) {
Response.Redirect(\ }
protected void LinkButton1_Click(object sender, EventArgs e) {
Response.Redirect(\ }
protected void LinkButton7_Click(object sender, EventArgs e) {
Response.Redirect(\ }
22