protected void Button1_Click(object sender, EventArgs e) { monitor myMon = new monitor(); time Time = new time(); string Time1 = Time.GetStartTime(); string Time2 = Time.GetEndTime(); myMon.Initial(); if (myMon.TeacherNum() == false | myMon.RoomNum() == false | myMon.CourseNum() == false | myMon.ClassNum() == false | Time1 == Time2) { Response.Write("<script>alert('监考信息添加不完全,请返回继续添加!')</script>"); } else { bool Result = myMon.MakeMonitor(); if (Result) { Response.Write("<script>alert('监考安排成功!')</script>"); } else { Response.Write("<script>alert('监考安排失败,考试资源有限,安排任务无法在考试时间内安排成功!')</script>"); } } }
private void BindData() { time Time = new time(); DateTime T1, T2; T1 = Convert.ToDateTime(Time.GetStartTime()); T2 = Convert.ToDateTime(Time.GetEndTime()); date1.Text = T1.ToString("yyyy-MM-dd"); date2.Text = T2.ToString("yyyy-MM-dd"); }
protected void Page_Load(object sender, EventArgs e) { if (Session["admin"] == null) { Response.Redirect("~/login.html"); } if (!IsPostBack) { time Time = new time(); DateTime T1, T2; T1 = Convert.ToDateTime(Time.GetStartTime()); T2 = Convert.ToDateTime(Time.GetEndTime()); date1.Text = T1.ToString("yyyy-MM-dd"); date2.Text = T2.ToString("yyyy-MM-dd"); BindData(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { Response.Redirect("~/login.html"); } if (!IsPostBack) { role_User user = new role_User(); time Time = new time(); llname.Text = user.GetUserName(Session["user"].ToString());//Session["user"].ToString()是teachername DateTime T1, T2; T1 = Convert.ToDateTime(Time.GetStartTime()); T2 = Convert.ToDateTime(Time.GetEndTime()); date1.Text = T1.ToString("yyyy-MM-dd"); date2.Text = T2.ToString("yyyy-MM-dd"); BindData(); } }