예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int     tripId    = Convert.ToInt32(Request.QueryString["tripId"]);
            Trip    tripClass = new Trip();
            TripDAO tripObj   = new TripDAO();

            if (Session["AdminNo"] == null)
            {
                Response.Redirect("loginStudent.aspx");
            }
            else
            {
                Choice choice = tripObj.checkOffer(Session["AdminNo"].ToString(), tripId);
                if (choice == null || choice.choice == "Accepted" || choice.choice == "Rejected")
                {
                    System.Diagnostics.Debug.WriteLine("its here");
                    Response.Redirect("Oops.aspx");
                }
                else if (choice.teacherChoice != "Approve")
                {
                    System.Diagnostics.Debug.WriteLine("its here2");
                    Response.Redirect("Oops.aspx");
                }
                tripName  = choice.tripName;
                tripStart = choice.tripStart.ToString("dd/MM/yyyy");
                tripEnd   = choice.tripEnd.ToString("dd/MM/yyyy");
            }
        }