public PerformanceAdministrationVM(IAdministrationServices service)
        {
            this.administrationService = service;
            this.Performances = new ObservableCollection<PerformanceVM>();
            this.CurrentDate = DateTime.Now;
            this.LoadItems();

            AppMessages.ArtistChanged.Register(this,(changeType) => { this.LoadItems(); });
            AppMessages.CatagoryChanged.Register(this, (changeType) => { this.LoadItems(); });
            AppMessages.VenueChanged.Register(this, (changeType) => { this.LoadItems(); });

            ValidatePerformances = new RelayCommand((c) =>
            {
                if (this.ValidateProgram())
                {
                    AppMessages.ShowSuccessMessage.Send("Program is Valid");
                }
                else
                {
                    AppMessages.ShowErrorMessage.Send("Program is not Valid");
                }
            });
            SavePerformances = new RelayCommand((c) =>
            {
                if (!this.ValidateProgram())
                {
                    AppMessages.ShowErrorMessage.Send("Cannot Save Invalid Program");
                    return;
                }
                administrationService.DeletePerformancesByDay(CurrentDate);
                foreach(PerformanceVM vm in Performances)
                {
                    SavePerformanceHelper(vm.Col1);
                    SavePerformanceHelper(vm.Col2);
                    SavePerformanceHelper(vm.Col3);
                    SavePerformanceHelper(vm.Col4);
                    SavePerformanceHelper(vm.Col5);

                }
                AppMessages.ShowSuccessMessage.Send("Program Saved");
            });

            SendMailToArtists = new RelayCommand(c =>
            {
                if (!this.ValidateProgram())
                {
                    AppMessages.ShowErrorMessage.Send("Cannot Send Mails for Invalid Program");
                }
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += new DoWorkEventHandler((sender, args) => {
                    this.SendMails();
                });
                worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler((sender, args) => {
                    AppMessages.ShowSuccessMessage.Send("Mails sent");
                });
                worker.RunWorkerAsync(System.Reflection.Assembly.GetExecutingAssembly().Location);

            });
        }
        public PerformanceAdministrationVM(IAdministrationServices service)
        {
            this.administrationService = service;
            this.Performances          = new ObservableCollection <PerformanceVM>();
            this.CurrentDate           = DateTime.Now;
            this.LoadItems();

            AppMessages.ArtistChanged.Register(this, (changeType) => { this.LoadItems(); });
            AppMessages.CatagoryChanged.Register(this, (changeType) => { this.LoadItems(); });
            AppMessages.VenueChanged.Register(this, (changeType) => { this.LoadItems(); });

            ValidatePerformances = new RelayCommand((c) =>
            {
                if (this.ValidateProgram())
                {
                    AppMessages.ShowSuccessMessage.Send("Program is Valid");
                }
                else
                {
                    AppMessages.ShowErrorMessage.Send("Program is not Valid");
                }
            });
            SavePerformances = new RelayCommand((c) =>
            {
                if (!this.ValidateProgram())
                {
                    AppMessages.ShowErrorMessage.Send("Cannot Save Invalid Program");
                    return;
                }
                administrationService.DeletePerformancesByDay(CurrentDate);
                foreach (PerformanceVM vm in Performances)
                {
                    SavePerformanceHelper(vm.Col1);
                    SavePerformanceHelper(vm.Col2);
                    SavePerformanceHelper(vm.Col3);
                    SavePerformanceHelper(vm.Col4);
                    SavePerformanceHelper(vm.Col5);
                }
                AppMessages.ShowSuccessMessage.Send("Program Saved");
            });

            SendMailToArtists = new RelayCommand(c =>
            {
                if (!this.ValidateProgram())
                {
                    AppMessages.ShowErrorMessage.Send("Cannot Send Mails for Invalid Program");
                }
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork          += new DoWorkEventHandler((sender, args) => {
                    this.SendMails();
                });
                worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler((sender, args) => {
                    AppMessages.ShowSuccessMessage.Send("Mails sent");
                });
                worker.RunWorkerAsync(System.Reflection.Assembly.GetExecutingAssembly().Location);
            });
        }