示例#1
0
        public Result IsFound(PatronTimeSpend patronTimeSpend)
        {
            if (!patronTimeSpend.IsEntryWeekday())
            {
                return(null);
            }
            if (patronTimeSpend.EntryDateTime.Hour < 18)
            {
                return(null);
            }
            if (patronTimeSpend.EntryDateTime.Hour > 24)
            {
                return(null);
            }

            if (patronTimeSpend.IsEntryAndExitGreaterThanOneDay())
            {
                return(null);
            }

            if ((patronTimeSpend.ExitDateTime.Hour >= 6) && (patronTimeSpend.ExitDateTime.Minute > 0))
            {
                return(null);
            }

            Result retVal = new Result();

            retVal.RateName   = V;
            retVal.TotalPrice = 6.50;
            return(retVal);
        }
示例#2
0
 private bool IsEntryEarlyBirdStart(PatronTimeSpend patronTimeSpend)
 {
     if ((patronTimeSpend.EntryDateTime.Hour >= 6) && (patronTimeSpend.EntryDateTime.Hour <= 9))
     {
         return(true);
     }
     return(false);
 }
示例#3
0
 private void Button1_Click(object sender, EventArgs e)
 {
     try {
         PatronTimeSpend pts = new PatronTimeSpend(this.dtpEntryDate.Value, this.dtpExitDate.Value);
         Result          r   = _rates.GetResult(pts);
         this.lblRateName.Text   = r.RateName;
         this.lblTotalPrice.Text = r.TotalPrice.ToString();
     }catch (Exception ex)
     {
         MessageBox.Show("Something went wrong");
     }
 }
示例#4
0
        public Result IsFound(PatronTimeSpend patronTimeSpend)
        {
            if (!patronTimeSpend.IsSameDay())
            {
                return(null);
            }
            if (!IsEntryEarlyBirdStart(patronTimeSpend) || !IsEarlyBirdEnd(patronTimeSpend))
            {
                return(null);
            }

            Result retVal = new Result();

            retVal.RateName   = V;
            retVal.TotalPrice = 13.00;
            return(retVal);
        }
        public Result IsFound(PatronTimeSpend patronTimeSpend)
        {
            if (patronTimeSpend.IsEntryWeekday())
            {
                return(null);
            }
            if (patronTimeSpend.IsExitWeekday())
            {
                return(null);
            }

            if (patronTimeSpend.ExitDateTime.Subtract(patronTimeSpend.EntryDateTime).TotalDays > 2)
            {
                return(null);
            }

            Result retVal = new Result();

            retVal.RateName   = V;
            retVal.TotalPrice = 10.00;
            return(retVal);
        }
示例#6
0
 private bool IsEarlyBirdEnd(PatronTimeSpend patronTimeSpend)
 {
     return(IsInExitSpan(patronTimeSpend.ExitDateTime));
 }