Пример #1
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        ClubBAIST          cb = new ClubBAIST();
        User               u  = cb.ReadUser(HttpContext.Current.User.Identity.Name);
        bool               b;
        SecurityController s = HttpContext.Current.User as SecurityController;

        if (s != null)
        {
            if (s.IsInAnyRoles("ADMIN"))
            {
                b = cb.CreateStandingReservation(int.Parse(Request.QueryString["u"]), int.Parse(CourseDD.SelectedValue), DateTime.Parse(TeeTimesDD.SelectedValue), EndCalendar.SelectedDate, int.Parse(NumberHolesDD.SelectedValue), int.Parse(NumberCartsDD.SelectedValue), Player2TB.Text, Player3TB.Text, Player4TB.Text);
                Response.Redirect("Default.aspx");
            }
            else
            {
                b = cb.CreateStandingReservation(u.UserID, int.Parse(CourseDD.SelectedValue), DateTime.Parse(TeeTimesDD.SelectedValue), EndCalendar.SelectedDate, int.Parse(NumberHolesDD.SelectedValue), int.Parse(NumberCartsDD.SelectedValue), Player2TB.Text, Player3TB.Text, Player4TB.Text);
                Response.Redirect("Default.aspx");
            }
        }
    }