Exemple #1
0
        private bool IsValidated()
        {
            DateTime newDateTime = dtDrawDate.Value.Date;

            if (!lotterySchedule.IsDrawDateMatchLotterySchedule(newDateTime))
            {
                log(String.Format(ResourcesUtils.GetMessage("mdd_form_validation_msg2"),
                                  newDateTime.Date.ToString("dddd"),
                                  lotterySchedule.DrawDateEvery()));
                return(false);
            }
            else if (newDateTime.CompareTo(DateTimeConverterUtils.GetYear2011()) < 0) //if earlier
            {
                log(ResourcesUtils.GetMessage("mdd_form_validation_msg5"));
                return(false);
            }
            else if (newDateTime.CompareTo(DateTime.Now.Date) == 0) //if the same
            {
                if (lotteryDataServices.IsPastTicketSellingCutoffTime())
                {
                    DialogResult drPassCutOfftime = MessageBox.Show(ResourcesUtils.GetMessage("mdd_form_validation_msg8"),
                                                                    ResourcesUtils.GetMessage("mdd_form_others_mgs7"), MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
                    if (drPassCutOfftime != DialogResult.OK)
                    {
                        log(ResourcesUtils.GetMessage("mdd_form_validation_msg6"));
                        return(false);
                    }
                }
            }
            return(true);
        }