public AddEditDayOfCinemaForm(ScheduleForm scheduleForm, Model.Requests.CinemasScheduleRequest schedule, MenuForm menuForm, int?airingDayId = null)
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(Screen.PrimaryScreen.Bounds.Width - 20 - this.Width, Screen.PrimaryScreen.Bounds.Height - this.Height - saveBtn.Height - 20);
     _scheduleForm      = scheduleForm;
     _schedule          = schedule;
     _airingDayId       = airingDayId;
     _menuForm          = menuForm;
 }
Beispiel #2
0
 public AddMovieForm(ScheduleForm scheduleForm, Model.Requests.CinemasScheduleRequest schedule, MenuForm menuForm, int airingDayId, DateTime date, string day)
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(Screen.PrimaryScreen.Bounds.Width - 20 - this.Width, Screen.PrimaryScreen.Bounds.Height - this.Height - saveBtn.Height - 20);
     _scheduleForm      = scheduleForm;
     _schedule          = schedule;
     _airingDayId       = airingDayId;
     _menuForm          = menuForm;
     _date = date;
     _day  = day;
 }
Beispiel #3
0
        private async void ScheduleForm_Load(object sender, EventArgs e)
        {
            var schedule = await _apiService.CustomGet <Model.Requests.CinemasScheduleRequest>("GetCinemasSchedule", _cinemaId);

            _schedule  = schedule;
            Title.Text = $"{schedule.Cinema.Name} schedule";

            var list = new List <Model.dgvLists.ScheduleItem>();

            foreach (var item in schedule.AiringDaysOfCinema)
            {
                string airingDay      = "";
                int    numberOfMovies = 0;
                foreach (var day in schedule.AiringDays)
                {
                    if (item.AiringDayId == day.AiringDayId)
                    {
                        airingDay = day.Name;
                        break;
                    }
                }
                foreach (var movie in schedule.CinemaDayMovies)
                {
                    if (movie.AiringDaysOfCinemaId == item.AiringDaysOfCinemaId)
                    {
                        numberOfMovies++;
                    }
                }
                var Object = new Model.dgvLists.ScheduleItem()
                {
                    AiringDaysOfCinemasId = item.AiringDaysOfCinemaId,
                    Date           = item.Date.Date,
                    Day            = airingDay,
                    NumberOfMovies = numberOfMovies
                };
                list.Add(Object);
            }
            dgvSchedule.AutoGenerateColumns = false;

            dgvSchedule.DataSource = list;
            _list = list;
            selectList.DataSource = new string[] {
                "All",
                "Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday",
                "Sunday"
            };
        }
Beispiel #4
0
        public AddEditAppointmentForm(AppointmentsForm appointmentsForm, ScheduleForm scheduleForm, Model.Requests.CinemasScheduleRequest schedule, MenuForm menuForm, int airingDayId, DateTime date, string day, int cinemaDayMovieId, int movieId, CinemaDayMovieForm cinemaDayMovieForm, int?appointmentId = null)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(Screen.PrimaryScreen.Bounds.Width - 20 - this.Width, Screen.PrimaryScreen.Bounds.Height - this.Height - saveBtn.Height - 20);
            _scheduleForm      = scheduleForm;
            _schedule          = schedule;
            _airingDayId       = airingDayId;
            _menuForm          = menuForm;
            _date               = date;
            _day                = day;
            _cinemaDayMovieId   = cinemaDayMovieId;
            _movieId            = movieId;
            _appointmentId      = appointmentId;
            _cinemaDayMovieForm = cinemaDayMovieForm;
            _appointmentsForm   = appointmentsForm;

            StartsAt.Format       = DateTimePickerFormat.Custom;
            StartsAt.CustomFormat = "HH:mm";
            StartsAt.ShowUpDown   = true;
        }