public void addMovieShow(String movieId, String cinemahallId, DateTime time) { if (movieId == "") { throw new Exception("movie id can't be empty"); } if (cinemahallId == "") { throw new Exception("cinemallID id can't be empty"); } int mid; int cid; if (!int.TryParse(movieId, out mid)) { throw new Exception("Movie ID must be a number"); } if (!int.TryParse(cinemahallId, out cid)) { throw new Exception("CinemaHall ID must be a number"); } try { Model.MovieShow movieShow = new Model.MovieShow(mid, cid, time); dbC.addMovieShow(movieShow); } catch (Exception err) { throw err; } }
void initFunc(String id) { movieShow = new BL.MovieShow().findMovieShow(id); txtMovieID.Text = movieShow.movieId.ToString(); txtCinemHallId.Text = movieShow.cinemahallId.ToString(); txtCapcity.Text = movieShow.remainingCapacity.ToString(); dtTime.SelectedDate = movieShow.time; timeAmPmClock.Text = movieShow.time.ToString().Substring(9); }