Esempio n. 1
0
    protected void HandicapFactor_Click(object sender, EventArgs e)
    {
        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();
        float factor = CBRD.GetCurrentHandicap((int)Session["MemberNumber"]);

        HandicapFactorLabel.Text = "Handicap Factor: " + factor;
    }
Esempio n. 2
0
    protected void Record_Click(object sender, EventArgs e)
    {
        int   total    = int.Parse(Front9Total.Text) + int.Parse(Back9Total.Text);
        Score NewScore = new Score(TeeList.SelectedValue, total);

        foreach (TextBox item in boxes)
        {
            try
            {
                NewScore.scores.Add(int.Parse(item.Text));
            }
            catch (Exception)
            {
                Message.Text = "Your scores are not correct";
            }
        }

        if (NewScore.scores.Count == 18)
        {
            NewScore.HandicapDifferential = Math.Round(((NewScore.Total - float.Parse(Rating.Text)) * 113) / float.Parse(Slope.Text), 1);
        }


        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();

        if (CBRD.RecordScore((int)Session["MemberNumber"], NewScore))
        {
            Message.Text = "Score was recorded successfully";
        }
        else
        {
            Message.Text = "There seems to be an error in your score.";
        }
    }
Esempio n. 3
0
    protected void CancelReservation_Click(object sender, EventArgs e)
    {
        string   SelectedItem         = ReservationList.SelectedItem.Value;
        DateTime reservation          = DateTime.Parse(SelectedItem);
        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();

        Message.Text = CBRD.CancelReservation(reservation, reservation, int.Parse(Session["MemberNumber"].ToString())).ToString();
    }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         int MemberNumber = 0;
         ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();
         try
         {
             MemberNumber = int.Parse(Session["MemberNumber"].ToString());
         }
       }
Esempio n. 5
0
        public JsonResult CancelTee(string cancellDate)
        {
            string message = string.Empty;

            if (!string.IsNullOrEmpty(cancellDate))
            {
                DateTime reservation          = DateTime.Parse(cancellDate);
                ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();
                message = new ReservationRepository().CancelReservation(reservation, reservation, int.Parse(Session["MemberNumber"].ToString())).ToString();
            }
            return(Json(new { status = true, message = message }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 6
0
    protected void OnHold_Click(object sender, EventArgs e)
    {
        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();

        if (CBRD.HoldApplication(int.Parse(ApplicationID.Text)))
        {
            Message.Text = "Application was put on hold successfully.";
        }
        else
        {
            Message.Text = "Application could not be put on hold.";
        }
    }
Esempio n. 7
0
    protected void Waitlist_Click(object sender, EventArgs e)
    {
        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();

        if (CBRD.WaitlistApplication(int.Parse(ApplicationID.Text)))
        {
            Message.Text = "Application was waitlisted successfully.";
        }
        else
        {
            Message.Text = "Application could not be waitlisted.";
        }
    }
    protected void DisplayTeeTime_Click(object sender, EventArgs e)
    {
        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();

        try
        {
            List <TeeTime> Times = CBRD.ViewTeeTimes(DateTime.Parse(ViewTeeTimeBox.Text));

            for (int i = 0; i < Times.Count; i++)
            {
                TableRow Row = new TableRow();
                Row.Height = 10;
                TableCell Cell = new TableCell();

                Cell = new TableCell();

                if (i % 2 == 0)
                {
                    Row.BackColor = System.Drawing.Color.LightGray;
                }
                if (Times[i].MemberName1 != "N/A")
                {
                    Row.Font.Bold = true;
                }

                Cell.Text = Times[i].Time.ToShortTimeString();
                Row.Cells.Add(Cell);
                Cell      = new TableCell();
                Cell.Text = Times[i].MemberName1;
                Row.Cells.Add(Cell);
                Cell      = new TableCell();
                Cell.Text = Times[i].MemberName2;
                Row.Cells.Add(Cell);
                Cell      = new TableCell();
                Cell.Text = Times[i].MemberName3;
                Row.Cells.Add(Cell);
                Cell      = new TableCell();
                Cell.Text = Times[i].MemberName4;
                Row.Cells.Add(Cell);

                TeeTimesTable.Rows.Add(Row);
            }
        }
        catch (Exception)
        {
            Message.Text = "Please Enter a Valid Date";
        }
    }
Esempio n. 9
0
    protected void Submit_Click(object sender, EventArgs e)
    {
        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();



        Application NewApplication = new Application(LastName.Text, FirstName.Text, Address.Text, PostalCode.Text, Phone.Text,
                                                     AltPhone.Text, Email.Text, DateTime.Parse(DateofBirth.Text), Occupation.Text, CompanyName.Text, CompanyAddress.Text,
                                                     CompanyPostalCode.Text, CompanyPhone.Text, DateTime.Parse(SubmitDate.Text), char.Parse(Sexlist.SelectedValue),
                                                     Share.Checked, ShareholderName1.Text, ShareholderName2.Text, DateTime.Parse(ShareholderDate1.Text), DateTime.Parse(ShareholderDate2.Text), Password.Text);
        bool confirmation = CBRD.AddApplication(NewApplication);

        if (confirmation)
        {
            Message.Text = "Application successfully submitted";
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         NumberOfPlayers.SelectedIndex = 0;
         int MemberNumber = 0;
         ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();
         try
         {
             MemberNumber = int.Parse(Session["MemberNumber"].ToString());
         }
         catch (Exception)
         {
             Message.Text = "Login Violation in This Page ";
         }
     }
 }
Esempio n. 11
0
    protected void Accept_Click(object sender, EventArgs e)
    {
        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();
        int MemberID = 0;

        MemberID = CBRD.AcceptApplication(int.Parse(ApplicationID.Text));
        if (MemberID != 0)
        {
            Message.Text      = "Application was accepted successfully...... MemberID = " + MemberID.ToString();
            Message.ForeColor = System.Drawing.Color.Green;
        }
        else
        {
            Message.Text = "Application could not be accepted.";
        }
        Message.ForeColor = System.Drawing.Color.Red;
    }
        public JsonResult SaveDataBookTeeTimeReservation(BookTeeTimeReservation objBoookstanding)
        {
            bool   isStatus = false;
            string message  = string.Empty;

            int hours   = objBoookstanding.Hour;
            int minutes = objBoookstanding.Minute;

            if (objBoookstanding.AMorPM == "PM" && hours != 12)
            {
                hours += 12;
            }

            string datetime = objBoookstanding.Date;

            datetime += " " + hours.ToString() + ":" + minutes.ToString();
            TeeTime  NewTeeTime = new TeeTime();
            DateTime DateT      = DateTime.Parse(datetime);

            try
            {
                NewTeeTime = new TeeTime(DateT, DateT, Session["MemberName"].ToString(), objBoookstanding.MemberName2, objBoookstanding.MemberName3, objBoookstanding.MemberName4, Convert.ToInt32(Session["MemberNumber"]), objBoookstanding.NumberOfPlayers, objBoookstanding.PhoneNumber, Convert.ToInt32(objBoookstanding.NumberOfCarts), "N/A");



                ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();


                if (CBRD.ReserveTeeTime(NewTeeTime, Session["MembershipLevel"].ToString()))
                {
                    isStatus = true;
                    message  = "Reservation was successfuly made.";
                }
                else
                {
                    message = "Reservation could not be made.";
                }
            }
            catch (Exception ex)
            {
                return(Json(new { Status = isStatus, message = ex.Message.ToString() }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { Status = isStatus, message = message }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 13
0
        public JsonResult RecordTee(string totalAndTee)
        {
            string message = string.Empty;
            bool   status  = false;

            try
            {
                var response = JsonConvert.DeserializeObject <RecordPlayerScoreResponse>(totalAndTee);

                boxes = new List <string>()
                {
                    "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S10", "S11", "S12", "S13", "S14", "S15", "S16", "S17", "S18"
                };
                Score NewScore = new Score(response.teeValue, response.total);
                for (int i = 0; i < boxes.Count; i++)
                {
                    NewScore.scores.Add(int.Parse(boxes[i].Last().ToString()));
                }
                if (NewScore.scores.Count == 18)
                {
                    //NewScore.HandicapDifferential = Math.Round(((NewScore.Total - float.Parse(response.rating)) * 113) / float.Parse(response.slope), 1);
                    NewScore.HandicapDifferential = Math.Round(((NewScore.Total - (!string.IsNullOrEmpty(response.rating) ? float.Parse(response.rating) : 0)) * 113) / (!string.IsNullOrEmpty(response.slope) ? float.Parse(response.slope) : 0), 1);
                }



                ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();
                if (CBRD.RecordScore((int)Session["MemberNumber"], NewScore))
                {
                    message = "Score was recorded successfully";
                }
                else
                {
                    message = "There seems to be an error in your score.";
                }
            }
            catch (Exception ex)
            {
                status = false; message = ex.Message.ToString();
                return(Json(new { status = status, message = message }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { status = status, message = message }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int MemberNumber = 0;
            ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();
            try
            {
                MemberNumber = int.Parse(Session["MemberNumber"].ToString());
            }



            catch (Exception)
            {
                Response.Redirect("~/Logon.aspx");
            }

            CBRD.DisplayMemberReservations(MemberNumber, ReservationList);
        }
    }
    protected void BookTeeTime_Click(object sender, EventArgs e)
    {
        int hours   = int.Parse(Hour.SelectedItem.Text);
        int minutes = int.Parse(Minute.SelectedItem.Text);

        if (AMorPM.SelectedItem.Text == "PM" && hours != 12)
        {
            hours += 12;
        }

        string datetime = Date.Text;

        datetime += " " + hours.ToString() + ":" + minutes.ToString();
        TeeTime  NewTeeTime;
        DateTime DateT = DateTime.Parse(datetime);

        try
        {
            NewTeeTime = new TeeTime(DateT, DateT, Session["MemberName"].ToString(), MemberName2.Text, MemberName3.Text, MemberName4.Text, Convert.ToInt32(Session["MemberNumber"]), Convert.ToInt32(NumberOfPlayers.SelectedValue),
                                     PhoneNumber.Text, Convert.ToInt32(NumberOfCarts.Text), "N/A");
        }
        catch (Exception)
        {
            Message.Text = "Information was input incorrectly. Double check your fields";
            return;
        }


        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();


        if (CBRD.ReserveTeeTime(NewTeeTime, Session["MembershipLevel"].ToString()))
        {
            Message.Text = "Reservation was successfuly made.";
        }
        else
        {
            Message.Text = "Reservation could not be made.";
        }
    }
    protected void Cancel_Click(object sender, EventArgs e)
    {
        ClubBAISTRequestDirector CBRD = new ClubBAISTRequestDirector();

        Message.Text = CBRD.CancelStandingReservation(int.Parse(Session["MemberNumber"].ToString()), DateTime.Now.Year).ToString();
    }
Esempio n. 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int MemberNumber = 0;
            try
            {
                MemberNumber = int.Parse(Session["MemberNumber"].ToString());
            }
            catch (Exception)
            {
                Response.Redirect("~/Logpn.aspx");
            }
        }

        ClubBAISTRequestDirector CBRD         = new ClubBAISTRequestDirector();
        List <Application>       Applications = CBRD.GetApplications();

        foreach (Application item in Applications)
        {
            TableRow  Row  = new TableRow();
            TableCell Cell = new TableCell();

            Cell.Text = item.ApplicationID.ToString();
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.LastName;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.FirstName;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.Address;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.PostalCode;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.Phone;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.AltPhone;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.Email;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.BirthDate.ToShortDateString();
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.Occupation;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.CompanyName;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.CompanyAddress;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.CompanyPostalCode;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.CompanyPhone;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.SubmitDate.ToShortDateString();
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.Sex.ToString();
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.WantsShare ? "Yes" : "No";
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.Waitlisted ? "Yes" : "No";
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.Onhold ? "Yes" : "No";
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.ShareholderName1;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.ShareholderDate1.ToShortDateString();
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.ShareholderName2;
            Row.Cells.Add(Cell);

            Cell      = new TableCell();
            Cell.Text = item.ShareholderDate2.ToShortDateString();
            Row.Cells.Add(Cell);

            ApplicationsTable.Rows.Add(Row);
        }
    }