private void bind() { SubmitApply sa = new SubmitApply(); this.applyView.DataSource = sa.viewSubmitMessage(Session["userName"].ToString()); this.applyView.DataBind(); }
void bind() { if (Session["applyID"] != null) { string id = Session["applyID"].ToString(); SubmitApply sa = new SubmitApply(); DataRow dr = sa.viewApplyDetail(id); this.companyName.Text = dr["companyName"].ToString(); this.companyCode.Text = dr["companyCode"].ToString(); this.companyAddress.Text = dr["companyAddress"].ToString(); this.companyContacts.Text = dr["companyContacts"].ToString(); this.companyDeparture.Text = dr["companyDeparture"].ToString(); this.companyEmail.Text = dr["companyEmail"].ToString(); this.companyPhone.Text = dr["companyPhone"].ToString(); this.companyMobile.Text = dr["companyMobile"].ToString(); this.companyTax.Text = dr["companyTax"].ToString(); this.agentContacts.Text = dr["agentContacts"].ToString(); this.agentName.Text = dr["agentName"].ToString(); this.agentEmail.Text = dr["agentEmail"].ToString(); this.agentPhone.Text = dr["agentPhone"].ToString(); this.agentMobile.Text = dr["agentMobile"].ToString(); this.applyDate.Text = dr["applyDate"].ToString(); } }
protected void checkAvailable_Click(object sender, EventArgs e) { string applyAddress=""; string applyTime=""; string applyDate = this.applyDate.Text; if (this.g1.Checked) { applyAddress = "光彪楼一楼多功能厅"; applyTime = "13:00-15:00"; } if (this.g2.Checked) { applyAddress = "光彪楼一楼多功能厅"; applyTime = "16:00-18:00"; } if (this.g3.Checked) { applyAddress = "光彪楼一楼多功能厅"; applyTime = "19:00-21:00"; } if (this.x1.Checked) { applyAddress = "学术活动中心演讲厅"; applyTime = "13:00-15:00"; } if (this.x2.Checked) { applyAddress = "学术活动中心演讲厅"; applyTime = "16:00-18:00"; } if (this.x3.Checked) { applyAddress = "学术活动中心演讲厅"; applyTime = "19:00-21:00"; } if (this.t1.Checked) { applyAddress = "铁生馆200号宣讲厅"; applyTime = "13:00-15:00"; } if (this.t2.Checked) { applyAddress = "铁生馆200号宣讲厅"; applyTime = "16:00-18:00"; } SubmitApply sa = new SubmitApply(); if (sa.checkTime(applyAddress,this.applyDate.Text.Trim(),applyTime)) { this.checkMessage.Text="该时间地点已被占用,请重新选择"; } else { this.checkMessage.Text="恭喜!该时间地点可用"; } }
protected void submit_Click(object sender, EventArgs e) { SubmitApply sa = new SubmitApply(); string applyAddress = ""; string applyTime = ""; if (this.g1.Checked) { applyAddress = "光彪楼一楼多功能厅"; applyTime = "13:00-15:00"; } if (this.g2.Checked) { applyAddress = "光彪楼一楼多功能厅"; applyTime = "16:00-18:00"; } if (this.g3.Checked) { applyAddress = "光彪楼一楼多功能厅"; applyTime = "19:00-21:00"; } if (this.x1.Checked) { applyAddress = "学术活动中心演讲厅"; applyTime = "13:00-15:00"; } if (this.x2.Checked) { applyAddress = "学术活动中心演讲厅"; applyTime = "16:00-18:00"; } if (this.x3.Checked) { applyAddress = "学术活动中心演讲厅"; applyTime = "19:00-21:00"; } if (this.t1.Checked) { applyAddress = "铁生馆200号宣讲厅"; applyTime = "13:00-15:00"; } if (this.t2.Checked) { applyAddress = "铁生馆200号宣讲厅"; applyTime = "16:00-18:00"; } if(!sa.checkTime(applyAddress,applyDate.Text,applyTime)) { if (sa.submitMessage(this.companyName.Text, this.companyCode.Text, this.companyAddress.Text, this.companyContacts.Text, this.companyDeparture.Text, this.companyEmail.Text, this.companyMobile.Text, this.companyTax.Text, this.agentContacts.Text, this.agentName.Text, this.agentEmail.Text, this.agentPhone.Text, this.agentPhone.Text, this.agentMobile.Text, applyAddress, this.applyDate.Text, applyTime, Session["userName"].ToString()) > 0) { Response.Redirect("~/Tips/SuccessTips.aspx"); } } else { Response.Write("<script>alert('该时间地点不可用,请重新选择')</script>"); } }