private static DateTime GetOrderTimeLimit(int excursionId, DateTime dateFrom, ExcursionReservationLanguage lang)
        {
            int defStopSale = -1 * Convert.ToInt32(ConfigurationManager.AppSettings["timelimit_default_stopsale_hours"]) * 60;

            DataSet dataset = null;

            //exdetplan / stop SALE
            if (lang != null)
                dataset = DatabaseOperationProvider.Query("select [stopsale] from [dbo].[exdetplan] where excurs=@excursionId and language = @language ", "stops", new { excursionId = excursionId, language = lang.id });
            else
                dataset = DatabaseOperationProvider.Query("select [stopsale] from [dbo].[exdetplan] where excurs=@excursionId ", "stops", new { excursionId = excursionId });

            if (dataset.Tables["stops"].Rows.Count > 0)
                defStopSale = dataset.Tables["stops"].Rows[0].ReadInt("stopsale");

            return dateFrom.AddMinutes(defStopSale);
        }
Пример #2
0
        private static DateTime GetOrderTimeLimit(int excursionId, DateTime dateFrom, ExcursionReservationLanguage lang)
        {
            int defStopSale = -1 * Convert.ToInt32(ConfigurationManager.AppSettings["timelimit_default_stopsale_hours"]) * 60;

            DataSet dataset = null;

            //exdetplan / stop SALE
            if (lang != null)
            {
                dataset = DatabaseOperationProvider.Query("select [stopsale] from [dbo].[exdetplan] where excurs=@excursionId and language = @language ", "stops", new { excursionId = excursionId, language = lang.id });
            }
            else
            {
                dataset = DatabaseOperationProvider.Query("select [stopsale] from [dbo].[exdetplan] where excurs=@excursionId ", "stops", new { excursionId = excursionId });
            }


            if (dataset.Tables["stops"].Rows.Count > 0)
            {
                defStopSale = dataset.Tables["stops"].Rows[0].ReadInt("stopsale");
            }

            return(dateFrom.AddMinutes(defStopSale));
        }