private void registerMovieButton_Click(object sender, EventArgs e)
        {
            try
            {
                var   name         = this.nameTextBox.Text;
                var   directorName = this.directorNameTextBox.Text;
                float?rating       = (float?)this.ratingUpDown.Value;
                var   year         = (int)this.yearUpDown.Value;
                var   image        = this.movieImageBytes;


                //TODO: CHECK IF IMAGE ALREADY EXISTS
                //TODO: IF NOT -> UPLOAD IT FIRST (code)
                MovieService.AddMovie(name, rating, 150, directorName, year, this.ageRestriction, null, null, image);
                MessageBox.Show(Constants.SuccessMessages.MovieRegisteredSuccessfully);
                AdminMenuForm adminMenuForm = new AdminMenuForm();
                adminMenuForm.TopLevel   = false;
                adminMenuForm.AutoScroll = true;
                this.Hide();
                ((Button)sender).Parent.Parent.Controls.Add(adminMenuForm);
                adminMenuForm.Show();
            }
            catch (Exception exception)
            {
                MessageBox.Show("Movie Register failed!");
            }
        }
        private void btn_mainwindow_click(object sender, EventArgs e)
        {
            parentForm.Visible      = false;
            tagetForm               = new AdminMenuForm();
            tagetForm.StartPosition = parentForm.StartPosition;
            tagetForm.FormClosed   += new FormClosedEventHandler(Exit_click);

            tagetForm.Show();
        }
Example #3
0
        private void BackButton_Click(object sender, EventArgs e)
        {
            AdminMenuForm adminMenuForm = new AdminMenuForm();

            adminMenuForm.TopLevel   = false;
            adminMenuForm.AutoScroll = true;
            this.Hide();
            ((Button)sender).Parent.Parent.Controls.Add(adminMenuForm);
            adminMenuForm.Show();
        }
Example #4
0
        private void btn_login_click(object sender, EventArgs e)
        {
            WebAPI api       = new WebAPI();
            string Correctpw = api.getPasswd(Program.serverUrl + "admin/passwd");

            if (passwd == Correctpw)
            {
                parentForm.Visible = false;

                tagetForm = new AdminMenuForm();
                tagetForm.StartPosition = FormStartPosition.CenterParent;
                tagetForm.FormClosed   += new FormClosedEventHandler(Exit_click);
                tagetForm.Show();
            }
            else
            {
                MessageBox.Show("비밀번호를 다시 입력해 주세요.");
                textBox.Text = "";
                passwd       = "";
            }
        }