Esempio n. 1
0
        private static SendServiceCallEntity GetSendBatch(AccountEntity account)
        {
            using (var dataBinding = new MessageDataAccessor())
            {
                var settings = dataBinding.GetSendSettings();
                if (settings != null)
                {
                    DateTime cutoffTime = TypeSafety.GetValue<DateTime>(ConfigurationManager.AppSettings["CutoffTime"], DateTime.Parse("20:00"));
                    DateTime startTime = TypeSafety.GetValue<DateTime>(ConfigurationManager.AppSettings["StartTime"], DateTime.Parse("08:00"));

                    if (DateTime.Compare(DateTime.Now, cutoffTime) > 0)
                    {
                        settings.DefaultTime = startTime.ToString("HH:mm");
                    }
                }

                SendServiceCallEntity data = new SendServiceCallEntity()
                {
                    Account = account,
                    Settings = settings
                };

                return data;
            }
        }