private void SetCashTime()
        {
            SettingCloseTime closeTime = Settings.GetCloseTime();

            cmbInitHour.SelectedIndex  = closeTime.InitHour;
            cmbInitMinut.SelectedIndex = closeTime.InitMinute;
            cmbEndHour.SelectedIndex   = closeTime.EndHour;
            cmbEndMinut.SelectedIndex  = closeTime.EndMinute;
        }
Пример #2
0
        public static bool CanDoTransactions()
        {
            SettingCloseTime closeTime = GetCloseTime();

            TimeSpan initTime = TimeSpan.FromHours(closeTime.InitHour).Add(TimeSpan.FromMinutes(closeTime.InitMinute));
            TimeSpan endTime  = TimeSpan.FromHours(closeTime.EndHour).Add(TimeSpan.FromMinutes(closeTime.EndMinute));

            TimeSpan now = TimeSpan.FromHours(DateTime.Now.Hour).Add(TimeSpan.FromMinutes(DateTime.Now.Minute));

            return((initTime <= now && endTime >= now) && Properties.Settings.Default.CashIsOpen);
        }