温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:小区物业管理系统源码
当前文件:
SmallHouse/admin/ddd.aspx.cs,打开代码结构图
SmallHouse/admin/ddd.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using System.Data.SqlClient; 12
13
public partial class admin_Default2 : System.Web.UI.Page 14
{ 15
BaseClass bc = new BaseClass(); 16
protected void Page_Load(object sender, EventArgs e) 17
{ 18
19
if (Session["uid"] == "") 20
{ 21
Response.Redirect("login.aspx"); 22
} 23
if (!IsPostBack) 24
{ 25
this.bind(); 26
} 27
28
} 29
protected void bind() 30
{ 31
32
33
34
bc.ExecDropDownList(name, "select * from chargeFeeType", "name", "typeID"); 35
36
37
string ownerID = Request.QueryString["ID"].ToString(); 38
string sql = "select * from v_homefee where ID='" + ownerID + "'"; 39
// Response.Write(sql); 40
// Response.End(); 41
SqlDataReader sdr = bc.ExecRead(sql); 42
if (sdr.Read()) 43
{ 44
Label1.Text = sdr["ownerID"].ToString(); 45
name.Text = sdr["typeID"].ToString(); 46
txtstart.Text = sdr["startDate"].ToString(); 47
txtlogindate.Text = sdr["loginDate"].ToString(); 48
txtsum.Text = sdr["tSum"].ToString(); 49
yesno.Text = sdr["sign"].ToString(); 50
Label2.Text = sdr["format"].ToString(); 51
52
} 53
else 54
{ 55
Response.Write("获取数据失败"); 56
return; 57
} 58
59
60
61
62
63
64
65
66
67
68
69
70
71
} 72
73
protected void Button1_Click(object sender, EventArgs e) 74
{ 75
string ID = Request.QueryString["ID"].ToString(); 76
77
string typeID = name.SelectedItem.Value; 78
string startDate = txtstart.Text; 79
string loginDate = txtlogindate.Text; 80
string tsum = txtsum.Text; 81
string sign = yesno.SelectedItem.Value; 82
83
string sql = "update homeChargeFee set typeID=" + typeID + ",startDate='" + startDate + "',loginDate='"; 84
sql = sql + loginDate + "',tsum=" + tsum + ",sign=" + sign+" where ID="+ID; 85
// Response.Write(sql); 86
// Response.End(); 87
if (bc.ExecSql(sql)) 88
{ 89
Response.Write("<script language=javascript>alert('修改成功!');location='homechargefee.aspx'</script>"); 90
} 91
else 92
{ 93
Response.Write("<script>alert(修改失败,请重试!');</script>"); 94
return; 95
} 96
97
98
99
100
} 101
102
103
104
105
106
107
} 108




BaseClass bc 
}
}