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>"); } }