一个学生预约的网站,按时间段预约,预约成功后,会在另一个页面显示学生姓名,学号,预约时间等个人信息
现在想实现这样的功能,DropDownList1里邦定的时间段,每个时间段只能预约两个人,超过两个人会给出一个提示
另外 DataView能按周分页吗
本人刚学.net没多久,请大家多多帮忙,先谢了
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb;
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btntj_Click(object sender, EventArgs e) { string text = string.Empty; if (rb1.Checked) { text = "就业政策、流程"; } else if (rb2.Checked) { text = "职业生涯规划"; }
else if (rb3.Checked) { text = "简历制作、面试技巧"; } else if (rb4.Checked) { text = "权益保障"; } else if (rb5.Checked) { text = "就业心理障碍"; } else if (rb6.Checked) { text = other.Text; } DateTime d1 = System.DateTime.Now;
string strconnection = "provider=microsoft.jet.oledb.4.0;Data
Source=C:\\Documents and Settings\\User\\My Documents\\Visual Studio
2005\\work\\App_Data\\cauwork.mdb";
OleDbConnection cusconnection = new OleDbConnection(strconnection);
cusconnection.Open();
string strcmd = "insert into job([name],
xuehao,collage,tel,banji,mail,zxnr,zxsj,[time]) values('" + name.Text +
"','" + xuehao.Text + "','" + collage.Text + "','" + tel.Text + "','" +
banji.Text + "','" + mail.Text + "','" + text + "','" +
DropDownList1.SelectedItem.Text + "',#" + d1 + "#)"; OleDbCommand cmd = new OleDbCommand(strcmd, cusconnection); cmd.ExecuteNonQuery(); cusconnection.Close(); Response.Write("<script>alert('预约成功')</script>"); name.Text = ""; collage.Text = ""; tel.Text = ""; xuehao.Text = ""; banji.Text = ""; mail.Text = ""; other.Text=""; } protected void btncz_Click(object sender, EventArgs e) { name.Text = ""; collage.Text = ""; tel.Text = ""; xuehao.Text = ""; banji.Text = ""; mail.Text = ""; } }
|