Exemplo n.º 1
0
        private void endCal_DateChanged(object sender, DateRangeEventArgs e)
        {
            // this checks the dates selected is valid and calcualtes the number of days the stay is for

            dateChanged dtc = new dateChanged();
            if (dtc.isBeforeToday(currentDate.ToString(), endCal.ToString()))
            {


                lblNumOfDays.Text = (dtc.calculateLength(startCal.ToString(), endCal.ToString()));
            }
            else
            {

                lblNumOfDays.Text = ("Return date is before this day");

            }
        }
Exemplo n.º 2
0
        private void startCal_DateChanged(object sender, DateRangeEventArgs e)
        {
            // this checks the dates selected is valid and calcualtes the number of days the stay is for

            dateChanged dtc = new dateChanged(); // declares an object of class data changed
            if (dtc.isBeforeToday(currentDate.ToString(), startCal.ToString())) // calls function isBeforeToday which returns to see if the date is before today
            {
                lblNumOfDays.Text = (dtc.calculateLength(startCal.ToString(), endCal.ToString()));
            }
            else
            {
                lblNumOfDays.Text = ("Out date is before this day");


            }
        }