示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CookieHandler.checkLogin();
     Label1.Text = CookieHandler.getUsername();
     Label2.Text = CookieHandler.getPassword();
     Label3.Text = CookieHandler.getID().ToString();
 }
示例#2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            String   jet  = jetsDropDownList.SelectedValue;
            String   dest = destinationDropDownList.SelectedValue;
            DateTime date = Calendar1.SelectedDate;

            if (ampmDropDownList.SelectedValue == "PM")
            {
                int hours;
                if (hourBox.Text == "12")
                {
                    hours = Convert.ToInt32(hourBox.Text);
                }
                else
                {
                    hours = Convert.ToInt32(hourBox.Text) + 12;
                }
                TimeSpan time = new TimeSpan(hours, Convert.ToInt32(minuteBox.Text), 0);
                date = date.Date + time;
            }
            else
            {
                int hours;
                if (hourBox.Text == "12")
                {
                    hours = Convert.ToInt32(hourBox.Text) - 12;
                }
                else
                {
                    hours = Convert.ToInt32(hourBox.Text);
                }
                TimeSpan time = new TimeSpan(hours, Convert.ToInt32(minuteBox.Text), 0);
                date = date.Date + time;
            }

            DBReservations.RegisterReservation(DBPlanes.getID(jet), CookieHandler.getID(), DBDestinations.getID(dest), date);

            //sets cookies for use in results page
            CookieHandler.setCookie("jet", DBPlanes.getName(DBPlanes.getID(jet)));
            CookieHandler.setCookie("dest", destinationDropDownList.SelectedValue);
            CookieHandler.setCookie("date", date.ToString());
            //change page to results
            HttpContext.Current.Response.Redirect("Results.aspx");
        }
示例#3
0
 //returns current user's first + last name
 public static string getUserFullName()
 {
     return(DBEmployees.getFName(CookieHandler.getID()) + " " + DBEmployees.getLName(CookieHandler.getID()));
 }