コード例 #1
0
        private void EditRentalForm_Load(object sender, EventArgs e)
        {
            using (CustomerService customerService = new CustomerService())
            {
                cmbCustomer.DataSource    = customerService.List();
                cmbCustomer.DisplayMember = "FullName";
                cmbCustomer.ValueMember   = "CustomerId";
            }

            using (MovieService movieService = new MovieService())
            {
                cmbMovieName.DataSource    = movieService.List();
                cmbMovieName.DisplayMember = "MovieName";
                cmbMovieName.ValueMember   = "MovieId";
            }

            using (RentalService movieService = new RentalService())
            {
                lstBoxRental.DataSource    = movieService.List();
                lstBoxRental.DisplayMember = "Display";
                lstBoxRental.ValueMember   = "RentalId";
            }

            using (DefinitionService definitionService = new DefinitionService())
            {
                cbRecordStatus.DataSource    = definitionService.GetRecordStatus();
                cbRecordStatus.DisplayMember = "RecordStatusName";
                cbRecordStatus.ValueMember   = "RecordStatusId";
            }
        }
コード例 #2
0
        private void NewMovieForm_Load(object sender, EventArgs e)
        {
            using (DefinitionService definitionService = new DefinitionService())
            {
                cbRecordStatus.DataSource    = definitionService.GetRecordStatus();
                cbRecordStatus.DisplayMember = "RecordStatusName";
                cbRecordStatus.ValueMember   = "RecordStatusId";


                cmbGenre.DataSource    = definitionService.GetGenres();
                cmbGenre.DisplayMember = "GenreName";
                cmbGenre.ValueMember   = "GenreId";
            }
        }
コード例 #3
0
        private void EditMovieForm_Load(object sender, EventArgs e)
        {
            using (DefinitionService definitionService = new DefinitionService())
            {
                cbRecordStatus.DataSource    = definitionService.GetRecordStatus();
                cbRecordStatus.DisplayMember = "RecordStatusName";
                cbRecordStatus.ValueMember   = "RecordStatusId";
            }

            using (CustomerService customerService = new CustomerService())
            {
                var customers = customerService.List();
                lbCustomer.DataSource    = customers;
                lbCustomer.DisplayMember = "DisplayString";
                lbCustomer.ValueMember   = "CustomerId";
            }
        }
コード例 #4
0
        private void EditUserForm_Load(object sender, EventArgs e)
        {
            using (DefinitionService definitionService = new DefinitionService())
            {
                cbRecordStatus.DataSource    = definitionService.GetRecordStatus();
                cbRecordStatus.DisplayMember = "RecordStatusName";
                cbRecordStatus.ValueMember   = "RecordStatusId";
            }

            using (UserService userService = new UserService())
            {
                var users = userService.List();
                lbUsers.DataSource    = users;
                lbUsers.DisplayMember = "DisplayString";
                lbUsers.ValueMember   = "UserId";
            }
        }
コード例 #5
0
        private void EditMoviesForm_Load(object sender, EventArgs e)
        {
            using (DefinitionService definitionService = new DefinitionService())
            {
                cbRecordStatus.DataSource    = definitionService.GetRecordStatus();
                cbRecordStatus.DisplayMember = "RecordStatusName";
                cbRecordStatus.ValueMember   = "RecordStatusId";


                cbGenre.DataSource    = definitionService.GetGenres();
                cbGenre.DisplayMember = "GenreName";
                cbGenre.ValueMember   = "GenreId";
            }

            using (MovieService movieService = new MovieService())
            {
                lbMovies.DataSource    = movieService.List();
                lbMovies.DisplayMember = "MovieName";
                lbMovies.ValueMember   = "MovieId";
            }
        }