protected void SubmitButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Notifier.AddSuccessMessage("New film screening has been released!");
                Notifier.ShowAfterRedirect = true;

                this.Presenter.CreateFilmScreening(this.DateInput.Text, this.SelectMovieDropDownList.SelectedItem.Value, this.PriceInput.Text, this);
            }
        }
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            this.Movie.Name            = this.TitleInput.Text;
            this.Movie.ImageUrl        = this.ImageUrlInput.Text;
            this.Movie.Info            = this.InfoInput.Text;
            this.Movie.Genre           = this.GenreInput.Text;
            this.Movie.Director        = this.DirectorInput.Text;
            this.Movie.LengthInMinutes = int.Parse(this.LengthInput.Text);

            Notifier.AddSuccessMessage(string.Format("{0} has been added to Library!", this.Movie.Name));
            Notifier.ShowAfterRedirect = true;
            this.Presenter.CreateMovie(this.Movie, this);
        }
Beispiel #3
0
        protected void RemoveAdminButton_Click(object sender, EventArgs e)
        {
            var casherRole = new IdentityUserRole();

            casherRole.RoleId = this.context.Roles.FirstOrDefault(r => r.Name == "casher").Id;

            var targetUser = this.context.Users.Where(u => u.UserName == this.UsersDropdown.SelectedItem.Text).First();

            targetUser.Roles.Clear();
            targetUser.Roles.Add(casherRole);
            this.context.SaveChanges();
            Notifier.AddSuccessMessage(string.Format("User {0}, promoted as cashier!", targetUser.UserName));
        }