In this paper, we study the valuation of swing options on electricity in a model where the underlying spot price is set to be the product of a deterministic seasonal pattern and Ornstein-Uhlenbeck process with Markov-modulated parameters. Under this setting, the difficulties of pricing swing options come from the various constraints embedded in contracts, e.g., the total number of rights constraint, the refraction time constraint, the local volume constraint, and the global volume constraint. Here we propose a framework for the valuation of the swing option on the condition that all the above constraints are nontrivial. To be specific, we formulate the pricing problem as an optimal stochastic control problem, which can be solved by the trinomial forest dynamic programming approach. Besides, empirical analysis is carried out on the model. We collect historical data in Nord Pool electricity market, extract the seasonal pattern, calibrate the Ornstein-Uhlenbeck process parameters in each regime, and also get market price of risk. Finally, on the basis of calibration results, a specific numerical example concerning all typical constraints is presented to demonstrate the valuation procedure.