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"; } }
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"; } }
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"; } }
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"; } }
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"; } }