Ejemplo n.º 1
0
        public List <TeeTime> GetAvilableTeeTime(List <TeeTime> AvailableTeeTimeList, string Date)
        {
            TeeTimes       TeeTImeManager   = new TeeTimes();
            List <TeeTime> AvailableTeeTime = TeeTImeManager.GetAvailableTeeTimeList(AvailableTeeTimeList, Date);

            return(AvailableTeeTime);
        }
    protected void Search_Click(object sender, EventArgs e)
    {
        CustomPrincipal cp         = (CustomPrincipal)HttpContext.Current.User;
        TeeTimes        teeTimeMGR = new TeeTimes();

        if (!cp.IsMember())
        {
            int selectedMember;
            if (int.TryParse(MemberSelection.Text, out selectedMember))
            {
                TeeTimesTable.DataSource = teeTimeMGR.GetTeeTimeByMemberAndDate(selectedMember, DatePicker.SelectedDate);
                TeeTimesTable.DataBind();
                Message.Text = "Search executed";
            }
            else
            {
                Message.Text = "Please select a valid member";
            }
        }
        else
        {
            TeeTimesTable.DataSource = teeTimeMGR.GetTeeTimeByMemberAndDate(cp.GetId(), DatePicker.SelectedDate);
            TeeTimesTable.DataBind();
        }
    }
Ejemplo n.º 3
0
    protected void Search_Click(object sender, EventArgs e)
    {
        CustomPrincipal cp         = (CustomPrincipal)HttpContext.Current.User;
        TeeTimes        teeTimeMGR = new TeeTimes();

        if (!cp.IsMember())
        {
            int selectedMember;
            if (int.TryParse(MemberSelection.Text, out selectedMember))
            {
                List <TeeTime> teeTimes = teeTimeMGR.GetTeeTimeByMember(selectedMember);
                TeeTimesTable.DataSource = teeTimes;
                MemberID.Text            = selectedMember.ToString();
                TeeTimesTable.DataBind();
                carts.Text = teeTimes[0].Carts.ToString();
            }
            else
            {
                Message.Text = "Please select a valid member";
            }
        }
        else
        {
            TeeTimesTable.DataSource = teeTimeMGR.GetTeeTimeByMember(cp.GetId());
            TeeTimesTable.DataBind();
        }
    }
Ejemplo n.º 4
0
        public DailyTeeTimeSheet GetBookedTeeTime(string MemberNumber, string Date, string TeeTime)
        {
            TeeTimes          TeeTImeManager = new TeeTimes();
            DailyTeeTimeSheet BookedTeeTime  = TeeTImeManager.GetBookedTeeTime(MemberNumber, Date, TeeTime);

            return(BookedTeeTime);
        }
Ejemplo n.º 5
0
        public TeeTime FindTeeTime(DateTime Date, TimeSpan time)
        {
            TeeTimes dataManager = new TeeTimes();
            var      teeTime     = dataManager.FindTeeTime(Date, time);

            return(teeTime);
        }
Ejemplo n.º 6
0
        public List <DailyTeeTimeSheet> GetDailyTeeTimeSheet(List <DailyTeeTimeSheet> InitialDailyTeeTimeSheet, string Date)
        {
            TeeTimes TeeTImeManager = new TeeTimes();
            List <DailyTeeTimeSheet> DailyTeeSheet = TeeTImeManager.GetDailyTeeTimeSheet(InitialDailyTeeTimeSheet, Date);

            return(DailyTeeSheet);
        }
Ejemplo n.º 7
0
    protected void Cancel_Command(object sender, CommandEventArgs e)
    {
        CustomPrincipal cp         = (CustomPrincipal)HttpContext.Current.User;
        TeeTimes        teeTimeMGR = new TeeTimes();

        if (!cp.IsMember())
        {
            int selectedMember;
            if (int.TryParse(MemberID.Text, out selectedMember))
            {
                int cartsInt = int.Parse(carts.Text);
                teeTimeMGR.UpdateTeeTime(int.Parse(e.CommandArgument.ToString()), cartsInt);
                MemberSelection.DataBind();
            }
            else
            {
                Message.Text = "something went wrong";
            }
        }
        else
        {
            int cartsInt = int.Parse(carts.Text);
            teeTimeMGR.UpdateTeeTime(int.Parse(e.CommandArgument.ToString()), cartsInt);
            MemberSelection.DataBind();
        }
    }
Ejemplo n.º 8
0
        public bool DeleteTeeTime(string MemberNumber, string Date, string TeeTime)
        {
            bool     confirmation   = false;
            TeeTimes TeeTImeManager = new TeeTimes();

            confirmation = TeeTImeManager.DeleteTeeTime(MemberNumber, Date, TeeTime);
            return(confirmation);
        }
Ejemplo n.º 9
0
        public bool DeleteTeeTime(TeeTime selectedTeeTime)
        {
            bool     Confirmation = false;
            TeeTimes dataManager  = new TeeTimes();

            Confirmation = dataManager.DeleteTeeTime(selectedTeeTime);
            return(Confirmation);
        }
Ejemplo n.º 10
0
        public TeeTime GetTeeTime(DateTime teeDate, DateTime teeTime)
        {
            TeeTime  getTeeTime;
            TeeTimes teeTimeManager = new TeeTimes();

            getTeeTime = teeTimeManager.GetTeeTime(teeDate, teeTime, "", "");
            return(getTeeTime);
        }
Ejemplo n.º 11
0
        public List <TeeTime> GetDailyTeeTimeSheet(DateTime searchParam)
        {
            List <TeeTime> itemList       = new List <TeeTime>();
            TeeTimes       teeTimeManager = new TeeTimes();

            itemList = teeTimeManager.GetDailyTeeSheetByDay(searchParam, "", "");
            return(itemList);
        }
Ejemplo n.º 12
0
        public bool UpdateTeeTime(TeeTime newTeeTime)
        {
            bool     Confirmation;
            TeeTimes teeTimeManager = new TeeTimes();

            Confirmation = teeTimeManager.ModifyTeeTime(newTeeTime, "", "");
            return(Confirmation);
        }
Ejemplo n.º 13
0
        public bool RemoveTeeTime(TeeTime newTeeTime)
        {
            bool     Confirmation;
            TeeTimes teeTimeManager = new TeeTimes();

            Confirmation = teeTimeManager.DeleteTeeTime(newTeeTime, "", "");
            return(Confirmation);
        }
Ejemplo n.º 14
0
        public bool BookNewTeeTime(TeeTime newTeeTime)
        {
            bool     Confirmation;
            TeeTimes teeTimeManager = new TeeTimes();

            Confirmation = teeTimeManager.InsertTeeTime(newTeeTime, "", "");
            return(Confirmation);
        }
Ejemplo n.º 15
0
        public DailyTeeSheet ViewDailyTeeSheet(DateTime date)
        {
            DailyTeeSheet dailyTeeSheet = new DailyTeeSheet();
            TeeTimes      dataManager   = new TeeTimes();

            dailyTeeSheet = dataManager.FindDailyTeeSheet(date);
            return(dailyTeeSheet);
        }
Ejemplo n.º 16
0
        public bool AddTeeTime(DailyTeeTimeSheet DedesireTeeTime, List <TeeTimeMember> Members)
        {
            bool     confirmation;
            TeeTimes TeeTImeManager = new TeeTimes();

            confirmation = TeeTImeManager.AddTeeTime(DedesireTeeTime, Members);
            return(confirmation);
        }
Ejemplo n.º 17
0
        public bool UpdateTeeTime(DailyTeeTimeSheet ModifyTeeTime, List <TeeTimeMember> Members)
        {
            bool     confirmation   = false;
            TeeTimes TeeTImeManager = new TeeTimes();

            confirmation = TeeTImeManager.UpdateTeeTime(ModifyTeeTime, Members);
            return(confirmation);
        }
Ejemplo n.º 18
0
    protected void Cancel_Command(object sender, CommandEventArgs e)
    {
        CustomPrincipal cp         = (CustomPrincipal)HttpContext.Current.User;
        TeeTimes        teeTimeMGR = new TeeTimes();

        if (!cp.IsMember())
        {
            teeTimeMGR.CancelTeeTime(int.Parse(e.CommandArgument.ToString()));
            MemberSelection.DataBind();
        }
        else
        {
            teeTimeMGR.CancelTeeTime(int.Parse(e.CommandArgument.ToString()));
            MemberSelection.DataBind();
        }
    }
    //  protected void GetAvailableTimes_Click(object sender, EventArgs e)
    //  {
    //try
    //{
    //		Message.Text = "";
    //		if (DateSelection.SelectedDate < DateTime.Now || DateSelection.SelectedDate > DateTime.Now.AddDays(7))
    //		{
    //			throw new Exception("Date must be within this week");
    //		}
    //		TeeTimes teeTimeMGR = new TeeTimes();
    //		DateTime selectedDate = DateSelection.SelectedDate;
    //		DateTime start = new DateTime(selectedDate.Year, selectedDate.Month, selectedDate.Day, 7, 0, 0);
    //		DateTime end = new DateTime(selectedDate.Year, selectedDate.Month, selectedDate.Day, 20, 0, 0);
    //		List<DateTime> dates = getTimesInRange(start, end);
    //		List<DateTime> bookedDates = teeTimeMGR.GetScheduledTeeTimes(selectedDate);
    //		foreach (var date in bookedDates)
    //		{
    //			dates.Remove(date);
    //		}
    //		TimeSelection.DataSource = dates;
    //		TimeSelection.DataBind();

    //}
    //catch (Exception ex)
    //{
    //	Message.Text = ex.Message;
    //}
    //  }

    protected void Submit_Click(object sender, EventArgs e)
    {
        try
        {
            Message.Text = "Tee time scheduled";
            if (DateSelection.SelectedDate < DateTime.Now || DateSelection.SelectedDate > DateTime.Now.AddDays(7))
            {
                throw new Exception("Date must be within this week");
            }
            TeeTimes teeTimeMGR  = new TeeTimes();
            string[] time        = TimeSelection.SelectedItem.Text.Split(':');
            DateTime teeTimeDate = Convert.ToDateTime(TimeSelection.SelectedValue);
            teeTimeMGR.ScheduleTeeTime(new DateTime(teeTimeDate.Year, teeTimeDate.Month, teeTimeDate.Day, int.Parse(time[0]), int.Parse(time[1]), int.Parse(time[2])),
                                       int.Parse(Member.Text), int.Parse(Carts.Text));
        }
        catch (Exception ex)
        {
            Message.Text = ex.Message;
        }
    }
Ejemplo n.º 20
0
        public void CreateTeeSheet(DateTime searchParam)
        {
            TeeTimes teeTimeManager = new TeeTimes();

            teeTimeManager.CreateDailySheet(searchParam, "", "");
        }