Пример #1
0
        private void CreateFilmButton_Click(object sender, EventArgs e)
        {
            String title        = this.titleTextBox.Text;
            String production   = this.productionTextBox.Text;
            String distribution = this.distributionTextBox.Text;

            String   datePattern = "yyyy-MM-dd "; //2018-12-30 year month day
            DateTime premiereDate, deadLine;

            DateTime.TryParseExact(this.premiereDateTextBox.Text, datePattern, null, DateTimeStyles.None, out premiereDate);
            DateTime.TryParseExact(this.deadlineTextBox.Text, datePattern, null, DateTimeStyles.None, out deadLine);

            //String hourPattern = "H"; //0-23
            String scheduledHour = this.scheduleDateTextBox.Text;
            int    hour          = int.Parse(scheduledHour);

            String noOfTicketsSTr = this.noOfTicketsTextBox.Text;
            int    noOfTickets    = int.Parse(noOfTicketsSTr);

            FilmService fs = new FilmService();

            fs.CreateFilmBl(title, production, distribution, premiereDate, hour, deadLine, noOfTickets);
        }