public ActionResult DragBetween()
        {
            //each scheduler must have unique name
            var scheduler = new DHXScheduler("sched1");

            scheduler.Extensions.Add(SchedulerExtensions.Extension.DragBetween);
            scheduler.InitialView = scheduler.Views[scheduler.Views.Count - 1].Name;


            var scheduler2 = new DHXScheduler("sched2");
            var timeline   = new TimelineView("timeline", "room_id");

            timeline.RenderMode = TimelineView.RenderModes.Bar;

            var rooms = new List <object>();

            for (var i = 1; i < 10; i++)
            {
                rooms.Add(new { key = i, label = string.Format("Room #{0}", i) });
            }

            timeline.FitEvents = false;
            scheduler2.Views.Add(timeline);
            timeline.AddOptions(rooms);
            timeline.X_Unit = TimelineView.XScaleUnits.Hour;
            timeline.X_Size = 18;
            timeline.AddSecondScale(TimelineView.XScaleUnits.Day, "%j, %M");
            timeline.X_Step        = 4;
            scheduler2.InitialView = timeline.Name;

            return(View(new mod()
            {
                sh1 = scheduler, sh2 = scheduler2
            }));
        }
        /// <summary>
        /// Add resources views - units and timeline
        /// </summary>
        /// <returns></returns>
        public ActionResult MultipleResources()
        {
            var scheduler = new DHXScheduler(this);
            scheduler.Skin = DHXScheduler.Skins.Terrace;
            var rooms = new DHXSchedulerModelsDataContext().Rooms.ToList();

            scheduler.Views.Clear();
            scheduler.Views.Add(new MonthView());

            var unit = new UnitsView("unit", "room_id");
            unit.AddOptions(rooms);//parse model objects
            scheduler.Views.Add(unit);

            var timeline = new TimelineView("timeline", "room_id");
            timeline.RenderMode = TimelineView.RenderModes.Bar;
            timeline.FitEvents = false;
            timeline.AddOptions(rooms);
            scheduler.Views.Add(timeline);

            //show timeline view by default
            scheduler.InitialView = timeline.Name;

            scheduler.Lightbox.AddDefaults();//add default set of options - text and timepicker
            //add controls to the details form
            var select = new LightboxSelect("room_id", "Room id");
            select.AddOptions(rooms);
            scheduler.Lightbox.Add(select);

            scheduler.LoadData = true;
            scheduler.InitialDate = new DateTime(2011, 9, 7);
            scheduler.EnableDataprocessor = true;

            return View(scheduler);
        }
Ejemplo n.º 3
0
        // GET: MVCFormInLightbox
        public ActionResult Index()
        {
            var sched = new DHXScheduler(this);

            sched.LoadData            = true;
            sched.EnableDataprocessor = true;

            var timeline = new TimelineView("timeline", "room_id")
            {
                RenderMode = TimelineView.RenderModes.Bar
            };

            sched.XY.scale_height = 40;
            timeline.X_Date       = "%d<br>%D";
            timeline.FitEvents    = false;
            sched.Views.Add(timeline);

            timeline.AddOptions(new List <object> {
                new { key = 1, label = "first" },
                new { key = 2, label = "second" },
                new { key = 3, label = "third" },
                new { key = 4, label = "fourth" }
            });
            //view, width, height
            var box = sched.Lightbox.SetExternalLightbox("MVCFormInLightbox/LightboxControl", 420, 195);

            //css class to be applied to the form
            box.ClassName     = "custom_lightbox";
            sched.InitialDate = new DateTime(2011, 9, 5);

            //try in new skin
            //sched.Skin = DHXScheduler.Skins.Terrace;

            return(View(sched));
        }
Ejemplo n.º 4
0
        public ActionResult Index()
        {
            var locale       = SchedulerLocalization.Localizations.English;
            var skin         = DHXScheduler.Skins.Standart;
            var request_lang = this.Request.QueryString["language"];
            var request_skin = this.Request.QueryString["skin"];

            if (!string.IsNullOrEmpty(request_lang))
            {
                locale = (SchedulerLocalization.Localizations)Enum.Parse(typeof(SchedulerLocalization.Localizations), request_lang);
            }
            if (!string.IsNullOrEmpty(request_skin))
            {
                skin = (DHXScheduler.Skins)Enum.Parse(typeof(DHXScheduler.Skins), request_skin);
            }


            var scheduler = new DHXScheduler(this);

            scheduler.Skin = skin;
            scheduler.Localization.Set(locale);


            scheduler.InitialDate = new DateTime(2011, 11, 24);

            scheduler.XY.scroll_width          = 0;
            scheduler.Config.first_hour        = 8;
            scheduler.Config.last_hour         = 19;
            scheduler.Config.time_step         = 30;
            scheduler.Config.multi_day         = true;
            scheduler.Config.limit_time_select = true;

            scheduler.Localization.Directory = "locale";


            var rooms = Repository.Rooms.ToList();

            var unit = new UnitsView("unit1", "room_id");

            unit.AddOptions(rooms);
            scheduler.Views.Add(unit);

            var timeline = new TimelineView("timeline", "room_id");

            timeline.RenderMode = TimelineView.RenderModes.Bar;
            timeline.FitEvents  = false;

            timeline.AddOptions(rooms);
            scheduler.Views.Add(timeline);


            scheduler.EnableDataprocessor = true;
            scheduler.LoadData            = true;
            scheduler.InitialDate         = new DateTime(2011, 9, 19);
            return(View(new LocaleData(scheduler, locale.ToString(), skin.ToString())));
        }
Ejemplo n.º 5
0
        public ActionResult Index()
        {
            var sched = new DHXScheduler(this);
            var unit  = new UnitsView("unit1", "room_id");

            sched.Views.Add(unit);

            //can add IEnumerable of objects, native units or dictionary

            var rooms = Repository.Rooms.ToList();

            unit.AddOptions(rooms);//parse model objects
            sched.Config.details_on_create   = true;
            sched.Config.details_on_dblclick = true;

            var timeline = new TimelineView("timeline", "room_id")
            {
                RenderMode = TimelineView.RenderModes.Bar
            };

            sched.XY.scale_height = 40;
            timeline.X_Date       = "%d<br>%D";
            timeline.FitEvents    = false;
            sched.Views.Add(timeline);

            timeline.AddOptions(rooms);

            var select = new LightboxSelect("color", "Priority");

            select.AddOptions(new List <object> {
                new { key = "#ccc", label = "Low" },
                new { key = "#76B007", label = "Medium" },
                new { key = "#FE7510", label = "Hight" }
            });
            sched.Lightbox.Add(select);


            select = new LightboxSelect("room_id", "Room id");
            select.AddOptions(rooms);

            sched.Lightbox.Add(select);

            sched.LoadData            = true;
            sched.EnableDataprocessor = true;
            sched.InitialDate         = new DateTime(2011, 9, 5);
            return(View(sched));
        }
Ejemplo n.º 6
0
        // GET: CustomScale
        public ActionResult Index()
        {
            var sched = new DHXScheduler(this);

            sched.Config.first_hour = 8;
            sched.Config.last_hour  = 18;
            sched.InitialDate       = new DateTime(2011, 9, 19);

            var rooms = Repository.Rooms.ToList();
            //new DHXSchedulerModelsDataContext().Rooms.ToList();
            var timeline = new TimelineView("timeline", "room_id");

            timeline.X_Unit = TimelineView.XScaleUnits.Hour;
            timeline.X_Size = 72;

            timeline.Scale.IgnoreRange(19, 23);
            timeline.Scale.IgnoreRange(0, 7);

            timeline.RenderMode = TimelineView.RenderModes.Bar;
            timeline.FitEvents  = false;


            sched.TimeSpans.Add(new DHXMarkTime
            {
                FullWeek = true,
                Zones    = new List <Zone> {
                    new Zone(8 * 60 + 10, 19 * 60 - 10)
                },
                CssClass    = "day_split",
                InvertZones = true,
                Sections    = new List <Section> {
                    new Section(timeline.Name, rooms.Select(r => r.key.ToString()).ToList())
                }
            });

            timeline.AddOptions(rooms);
            sched.Views.Add(timeline);
            sched.InitialView = timeline.Name;
            var week = sched.Views[1];

            week.Scale.Ignore((int)DayOfWeek.Saturday, (int)DayOfWeek.Sunday);


            sched.LoadData = true;

            return(View(sched));
        }
Ejemplo n.º 7
0
        public ActionResult Index()
        {
            var sched = new DHXScheduler(this);

            sched.Skin = DHXScheduler.Skins.Terrace;
            var unit = new UnitsView("unit1", "room_id");

            sched.Views.Add(unit);


            var context = new DHXSchedulerDataContext();

            //can add IEnumerable of objects, native units or dictionary
            unit.AddOptions(context.Rooms);//parse model objects
            sched.Config.details_on_create   = true;
            sched.Config.details_on_dblclick = true;

            var timeline = new TimelineView("timeline", "room_id");

            var items = new List <object>();

            timeline.FitEvents = false;
            sched.Views.Add(timeline);
            timeline.AddOptions(context.Rooms);


            var select = new LightboxSelect("textColor", "Priority");

            items = new List <object>();
            items.Add(new { key = "gray", label = "Low" });
            items.Add(new { key = "blue", label = "Medium" });
            items.Add(new { key = "red", label = "Hight" });
            select.AddOptions(items);
            sched.Lightbox.Add(select);


            select = new LightboxSelect("room_id", "Room id");
            select.AddOptions(context.Rooms);
            sched.Lightbox.Add(select);

            sched.LoadData            = true;
            sched.EnableDataprocessor = true;
            sched.InitialDate         = new DateTime(2011, 9, 5);
            return(View(sched));
        }
    protected void _ConfigureViews(DHXScheduler scheduler, IEnumerable cars)
    {
        var units = new TimelineView("Thue_Xes", "carid");

        units.X_Step   = 2;
        units.X_Length = 12;
        units.X_Size   = 12;
        //width of the first column
        units.Dx = 180;
        //row height
        units.Dy = 90;
        //order bar height
        units.EventDy = units.Dy - 10;
        units.AddOptions(cars);
        units.RenderMode = TimelineView.RenderModes.Bar;
        scheduler.Views.Clear();
        scheduler.Views.Add(units);
        scheduler.InitialView = scheduler.Views[0].Name;
    }
Ejemplo n.º 9
0
        protected TimelineView GenericTimeline(string name, IEnumerable cars)
        {
            var timeline = new TimelineView(name, "section_id");

            //width of the first column
            timeline.Dx = 149;
            timeline.AddOptions(cars);
            //row height
            timeline.Dy = 38;

            //rent boxes height
            timeline.EventDy  = timeline.Dy - 5;
            timeline.FolderDy = 114;
            timeline.FolderEventsAvailable = false;
            timeline.ResizeEvents          = false;
            timeline.SectionAutoheight     = false;
            timeline.RenderMode            = TimelineView.RenderModes.Tree;
            return(timeline);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Add resources views - units and timeline
        /// </summary>
        /// <returns></returns>
        public ActionResult MultipleResources()
        {
            var scheduler = new DHXScheduler(this);

            scheduler.Skin = DHXScheduler.Skins.Terrace;
            var rooms = Repository.Rooms.ToList();

            scheduler.Views.Clear();
            scheduler.Views.Add(new MonthView());

            var unit = new UnitsView("unit", "room_id");

            unit.AddOptions(rooms);//parse model objects

            scheduler.Views.Add(unit);

            var timeline = new TimelineView("timeline", "room_id")
            {
                RenderMode = TimelineView.RenderModes.Bar,
                FitEvents  = false
            };

            timeline.AddOptions(rooms);
            scheduler.Views.Add(timeline);


            //show timeline view by default
            scheduler.InitialView = timeline.Name;

            scheduler.Lightbox.AddDefaults();//add default set of options - text and timepicker
            //add controls to the details form
            var select = new LightboxSelect("room_id", "Room id");

            select.AddOptions(rooms);
            scheduler.Lightbox.Add(select);


            scheduler.LoadData            = true;
            scheduler.InitialDate         = new DateTime(2011, 9, 7);
            scheduler.EnableDataprocessor = true;

            return(View(scheduler));
        }
Ejemplo n.º 11
0
        //
        // GET: /CustomizeScale/
        public ActionResult Index()
        {
            var sched = new DHXScheduler(this);

            sched.Config.first_hour = 8;
            sched.Config.last_hour = 18;
            sched.InitialDate = new DateTime(2011, 9, 19);

            var rooms = new DHXSchedulerModelsDataContext().Rooms.ToList();
            var timeline = new TimelineView("timeline", "room_id");
            timeline.X_Unit = TimelineView.XScaleUnits.Hour;
            timeline.X_Size = 72;

            timeline.Scale.IgnoreRange(19, 23);
            timeline.Scale.IgnoreRange(0, 7);

            timeline.RenderMode = TimelineView.RenderModes.Bar;
            timeline.FitEvents = false;

            sched.TimeSpans.Add(new DHXMarkTime
            {
                FullWeek = true,
                Zones = new List<Zone> { new Zone(8 * 60 + 10, 19 * 60 - 10) },
                CssClass = "day_split",
                InvertZones = true,
                Sections = new List<Section>{
                    new Section(timeline.Name, rooms.Select(r => r.key.ToString()).ToList())

                }
            });

            timeline.AddOptions(rooms);
            sched.Views.Add(timeline);
            sched.InitialView = timeline.Name;
            var week = sched.Views[1];
            week.Scale.Ignore((int)DayOfWeek.Saturday, (int)DayOfWeek.Sunday);

            sched.LoadData = true;

            return View(sched);
        }
Ejemplo n.º 12
0
        private TimelineView ConfigureTimelineView(IEnumerable <object> rooms)
        {
            var timeline = new TimelineView("Timeline", "room_number");

            timeline.RenderMode = TimelineView.RenderModes.Bar;
            timeline.X_Unit     = TimelineView.XScaleUnits.Day;
            timeline.X_Date     = "%d";
            timeline.X_Size     = 45;
            timeline.AddSecondScale(TimelineView.XScaleUnits.Month, "%F %Y");
            timeline.Dy = 51;
            timeline.SectionAutoheight = false;
            timeline.RoundPosition     = true;

            timeline.FullEventDy = true;

            timeline.ServerList = "Rooms";

            timeline.AddOptions(rooms);

            return(timeline);
        }
Ejemplo n.º 13
0
        public ActionResult Index()
        {
            var sched = new DHXScheduler(this);
            sched.Skin = DHXScheduler.Skins.Terrace;
            var unit = new UnitsView("unit1", "room_id");
            sched.Views.Add(unit);

            var context = new DHXSchedulerDataContext();

            //can add IEnumerable of objects, native units or dictionary
            unit.AddOptions(context.Rooms);//parse model objects
            sched.Config.details_on_create = true;
            sched.Config.details_on_dblclick = true;

            var timeline = new TimelineView("timeline", "room_id");

            var items = new List<object>();
            timeline.FitEvents = false;
            sched.Views.Add(timeline);
            timeline.AddOptions(context.Rooms);

            var select = new LightboxSelect("textColor", "Priority");
            items = new List<object>();
            items.Add(new { key = "gray", label = "Low" });
            items.Add(new { key = "blue", label = "Medium" });
            items.Add(new { key = "red", label = "Hight" });
            select.AddOptions(items);
            sched.Lightbox.Add(select);

            select = new LightboxSelect("room_id", "Room id");
            select.AddOptions(context.Rooms);
            sched.Lightbox.Add(select);

            sched.LoadData = true;
            sched.EnableDataprocessor = true;
            sched.InitialDate = new DateTime(2011, 9, 5);
            return View(sched);
        }
Ejemplo n.º 14
0
        public ActionResult Index()
        {
            var sched = new DHXScheduler(this);
            var unit = new UnitsView("unit1", "room_id");
            sched.Views.Add(unit);

            var context = new DHXSchedulerModelsDataContext();

            //can add IEnumerable of objects, native units or dictionary
            unit.AddOptions(context.Rooms);//parse model objects
            sched.Config.details_on_create = true;
            sched.Config.details_on_dblclick = true;

            var timeline = new TimelineView("timeline", "room_id");
            timeline.RenderMode = TimelineView.RenderModes.Bar;
            var rooms = context.Rooms.ToList();
            timeline.FitEvents = false;
            sched.Views.Add(timeline);
            timeline.AddOptions(rooms);

            var select = new LightboxSelect("color", "Priority");
            select.AddOptions(new List<object>{
                new { key = "#ccc", label = "Low" },
                new { key = "#76B007", label = "Medium" },
                new { key = "#FE7510", label = "Hight" }
            });
            sched.Lightbox.Add(select);

            select = new LightboxSelect("room_id", "Room id");
            select.AddOptions(rooms);
            sched.Lightbox.Add(select);

            sched.LoadData = true;
            sched.EnableDataprocessor = true;
            sched.InitialDate = new DateTime(2011, 9, 5);
            return View(sched);
        }
        /// <summary>
        /// Block time areas
        /// </summary>
        /// <returns></returns>
        public ActionResult Limit()
        {
            var sched = new DHXScheduler(this);

            sched.InitialDate = new DateTime(2011, 9, 19);


            // block specific date range
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                StartDate = new DateTime(2011, 9, 14),
                EndDate   = new DateTime(2011, 9, 17)
            });

            // block each tuesday from 12AM to 15PM
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                Day   = DayOfWeek.Tuesday,
                Zones = new List <Zone>()
                {
                    new Zone {
                        Start = 0, End = 15 * 60
                    }
                }
            });

            // block each sunday
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                Day = DayOfWeek.Sunday
            });

            // block each monday from 12am to 8am, and from 18pm to 12am of the next day
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                Day   = DayOfWeek.Monday,
                Zones = new List <Zone>()
                {
                    new Zone {
                        Start = 0, End = 8 * 60
                    }, new Zone {
                        Start = 18 * 60, End = 24 * 60
                    }
                }
            });
            #region add units and timeline
            var rooms = new DHXSchedulerModelsDataContext().Rooms.ToList();
            var unit  = new UnitsView("unit", "room_id");
            unit.AddOptions(rooms);//parse model objects
            sched.Views.Add(unit);

            var timeline = new TimelineView("timeline", "room_id");
            timeline.RenderMode = TimelineView.RenderModes.Bar;
            timeline.FitEvents  = false;
            timeline.AddOptions(rooms);
            sched.Views.Add(timeline);
            #endregion
            //block different sections in timeline and units view
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                FullWeek = true,
                Sections = new List <Section>()
                {
                    new Section(unit.Name, rooms.Take(2).Select(r => r.key.ToString()).ToArray()),
                    new Section(timeline.Name, rooms.Skip(2).Select(r => r.key.ToString()).ToArray())
                }
            });


            sched.LoadData            = true;
            sched.EnableDataprocessor = true;
            return(View(sched));
        }
Ejemplo n.º 16
0
        public ActionResult Index()
        {
            SchedulerLocalization.Localizations lang;
            var language = this.Request.QueryString["language"];
            var skn = this.Request.QueryString["skin"];
            DHXScheduler.Skins skin;
            #region language
            switch (this.Request.QueryString["language"])
            {
                case "ar":
                    lang = SchedulerLocalization.Localizations.Arabic;
                    break;
                case "be":
                    lang = SchedulerLocalization.Localizations.Belarusian;
                    break;
                case "ca":
                    lang = SchedulerLocalization.Localizations.Catalan;
                    break;
                case "cn":
                    lang = SchedulerLocalization.Localizations.Chinese;
                    break;
                case "cs":
                    lang = SchedulerLocalization.Localizations.Czech;
                    break;
                case "da":
                    lang = SchedulerLocalization.Localizations.Danish;
                    break;
                case "nl":
                    lang = SchedulerLocalization.Localizations.Dutch;
                    break;
                case "fi":
                    lang = SchedulerLocalization.Localizations.Finnish;
                    break;
                case "fr":
                    lang = SchedulerLocalization.Localizations.French;
                    break;
                case "de":
                    lang = SchedulerLocalization.Localizations.German;
                    break;
                case "el":
                    lang = SchedulerLocalization.Localizations.Greek;
                    break;
                case "he":
                    lang = SchedulerLocalization.Localizations.Hebrew;
                    break;
                case "hu":
                    lang = SchedulerLocalization.Localizations.Hungarian;
                    break;
                case "id":
                    lang = SchedulerLocalization.Localizations.Indonesia;
                    break;
                case "it":
                    lang = SchedulerLocalization.Localizations.Italian;
                    break;
                case "jp":
                    lang = SchedulerLocalization.Localizations.Japanese;
                    break;
                case "no":
                    lang = SchedulerLocalization.Localizations.Norwegian;
                    break;
                case "pl":
                    lang = SchedulerLocalization.Localizations.Polish;
                    break;
                case "pt":
                    lang = SchedulerLocalization.Localizations.Portuguese;
                    break;
                case "ro":
                    lang = SchedulerLocalization.Localizations.Romanian;
                    break;
                case "ru":
                    lang = SchedulerLocalization.Localizations.Russian;
                    break;
                case "si":
                    lang = SchedulerLocalization.Localizations.Slovenian;
                    break;
                case "es":
                    lang = SchedulerLocalization.Localizations.Spanish;
                    break;
                case "sv":
                    lang = SchedulerLocalization.Localizations.Swedish;
                    break;
                case "tr":
                    lang = SchedulerLocalization.Localizations.Turkish;
                    break;
                case "ua":
                    lang = SchedulerLocalization.Localizations.Ukrainian;
                    break;
                default:
                    lang = SchedulerLocalization.Localizations.English;
                    language = "en";
                    break;
            }
            #endregion

            #region skin
            switch (this.Request.QueryString["skin"])
            {
                case "glossy":
                    skin = DHXScheduler.Skins.Glossy;
                    break;
                case "terrace":
                    skin = DHXScheduler.Skins.Terrace;
                    break;
                default:
                    skin = DHXScheduler.Skins.Standart;
                    skn = "classic";
                    break;
            }
            #endregion
            var scheduler = new DHXScheduler(this);
            scheduler.Skin = DHXScheduler.Skins.Terrace;
            scheduler.InitialDate = new DateTime(2011, 11, 24);

            scheduler.XY.scroll_width = 0;
            scheduler.Config.first_hour = 8;
            scheduler.Config.last_hour = 19;
            scheduler.Config.time_step = 30;
            scheduler.Config.multi_day = true;
            scheduler.Config.limit_time_select = true;
            scheduler.Skin = skin;
            scheduler.Localization.Directory = "locale";
            scheduler.Localization.Set(lang, false);

            var rooms = new DHXSchedulerModelsDataContext().Rooms.ToList();

            var unit = new UnitsView("unit1", "room_id");
            unit.AddOptions(rooms);//parse model objects
            scheduler.Views.Add(unit);

            var timeline = new TimelineView("timeline", "room_id");
            timeline.RenderMode = TimelineView.RenderModes.Bar;
            timeline.FitEvents = false;
            timeline.AddOptions(rooms);
            scheduler.Views.Add(timeline);

            scheduler.EnableDataprocessor = true;
            scheduler.LoadData = true;
            scheduler.InitialDate = new DateTime(2011, 9, 19);
            return View(new LocaleData(scheduler, language, skn));
        }
Ejemplo n.º 17
0
        public ActionResult Index()
        {
            SchedulerLocalization.Localizations lang;
            var language = this.Request.QueryString["language"];
            var skn      = this.Request.QueryString["skin"];

            DHXScheduler.Skins skin;
            #region language
            switch (this.Request.QueryString["language"])
            {
            case "ar":
                lang = SchedulerLocalization.Localizations.Arabic;
                break;

            case "be":
                lang = SchedulerLocalization.Localizations.Belarusian;
                break;

            case "ca":
                lang = SchedulerLocalization.Localizations.Catalan;
                break;

            case "cn":
                lang = SchedulerLocalization.Localizations.Chinese;
                break;

            case "cs":
                lang = SchedulerLocalization.Localizations.Czech;
                break;

            case "da":
                lang = SchedulerLocalization.Localizations.Danish;
                break;

            case "nl":
                lang = SchedulerLocalization.Localizations.Dutch;
                break;

            case "fi":
                lang = SchedulerLocalization.Localizations.Finnish;
                break;

            case "fr":
                lang = SchedulerLocalization.Localizations.French;
                break;

            case "de":
                lang = SchedulerLocalization.Localizations.German;
                break;

            case "el":
                lang = SchedulerLocalization.Localizations.Greek;
                break;

            case "he":
                lang = SchedulerLocalization.Localizations.Hebrew;
                break;

            case "hu":
                lang = SchedulerLocalization.Localizations.Hungarian;
                break;

            case "id":
                lang = SchedulerLocalization.Localizations.Indonesia;
                break;

            case "it":
                lang = SchedulerLocalization.Localizations.Italian;
                break;

            case "jp":
                lang = SchedulerLocalization.Localizations.Japanese;
                break;

            case "no":
                lang = SchedulerLocalization.Localizations.Norwegian;
                break;

            case "pl":
                lang = SchedulerLocalization.Localizations.Polish;
                break;

            case "pt":
                lang = SchedulerLocalization.Localizations.Portuguese;
                break;

            case "ru":
                lang = SchedulerLocalization.Localizations.Russian;
                break;

            case "ro":
                lang = SchedulerLocalization.Localizations.Romanian;
                break;

            case "si":
                lang = SchedulerLocalization.Localizations.Slovenian;
                break;

            case "es":
                lang = SchedulerLocalization.Localizations.Spanish;
                break;

            case "sv":
                lang = SchedulerLocalization.Localizations.Swedish;
                break;

            case "tr":
                lang = SchedulerLocalization.Localizations.Turkish;
                break;

            case "ua":
                lang = SchedulerLocalization.Localizations.Ukrainian;
                break;

            default:
                lang     = SchedulerLocalization.Localizations.English;
                language = "en";
                break;
            }
            #endregion

            #region skin
            switch (this.Request.QueryString["skin"])
            {
            case "glossy":
                skin = DHXScheduler.Skins.Glossy;
                break;

            case "terrace":
                skin = DHXScheduler.Skins.Terrace;
                break;

            default:
                skin = DHXScheduler.Skins.Standart;
                skn  = "classic";
                break;
            }
            #endregion
            var scheduler = new DHXScheduler(this);

            scheduler.InitialDate = new DateTime(2011, 11, 24);

            scheduler.XY.scroll_width          = 0;
            scheduler.Config.first_hour        = 8;
            scheduler.Config.last_hour         = 19;
            scheduler.Config.time_step         = 30;
            scheduler.Config.multi_day         = true;
            scheduler.Config.limit_time_select = true;
            scheduler.Skin = skin;
            scheduler.Localization.Directory = "locale";
            scheduler.Localization.Set(lang, false);

            var rooms = new DHXSchedulerDataContext().Rooms.ToList();

            var unit = new UnitsView("unit1", "room_id");
            unit.AddOptions(rooms);//parse model objects
            scheduler.Views.Add(unit);

            var timeline = new TimelineView("timeline", "room_id");
            timeline.RenderMode = TimelineView.RenderModes.Bar;
            timeline.FitEvents  = false;
            timeline.AddOptions(rooms);
            scheduler.Views.Add(timeline);


            scheduler.EnableDataprocessor = true;
            scheduler.LoadData            = true;
            scheduler.InitialDate         = new DateTime(2011, 9, 19);
            return(View(new LocaleData(scheduler, language, skn)));
        }
        /// <summary>
        /// Block time areas
        /// </summary>
        /// <returns></returns>
        public ActionResult Limit()
        {
            var sched = new DHXScheduler(this);

            sched.InitialDate = new DateTime(2011, 9, 19);

            // block specific date range
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                StartDate = new DateTime(2011, 9, 14),
                EndDate = new DateTime(2011, 9, 17)
            });

            // block each tuesday from 12AM to 15PM
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                Day = DayOfWeek.Tuesday,
                Zones = new List<Zone>() { new Zone { Start = 0, End = 15 * 60 } }
            });

            // block each sunday
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                Day = DayOfWeek.Sunday
            });

            // block each monday from 12am to 8am, and from 18pm to 12am of the next day
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                Day = DayOfWeek.Monday,
                Zones = new List<Zone>() { new Zone { Start = 0, End = 8 * 60 }, new Zone { Start = 18 * 60, End = 24 * 60 } }
            });
            #region add units and timeline
            var rooms = new DHXSchedulerDataContext().Rooms.ToList();
            var unit = new UnitsView("unit", "room_id");
            unit.AddOptions(rooms);//parse model objects
            sched.Views.Add(unit);

            var timeline = new TimelineView("timeline", "room_id");
            timeline.RenderMode = TimelineView.RenderModes.Bar;
            timeline.FitEvents = false;
            timeline.AddOptions(rooms);
            sched.Views.Add(timeline);
            #endregion
            //block different sections in timeline and units view
            sched.TimeSpans.Add(new DHXBlockTime()
            {
                FullWeek = true,
                Sections = new List<Section>() {
                    new Section(unit.Name, rooms.Take(2).Select(r => r.key.ToString()).ToArray()),
                    new Section(timeline.Name, rooms.Skip(2).Select(r => r.key.ToString()).ToArray())
                }
            });

            sched.LoadData = true;
            sched.EnableDataprocessor = true;
            return View(sched);
        }