/// <summary>
        ///     Evento al pulsar Guardar
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ButtonSave_Click(object sender, EventArgs e)
        {
            if (this.cbSubjects.SelectedValue != null)
            {
                //Recupera la asignatura seleccionada
                int     subjectId = (int)this.cbSubjects.SelectedValue;
                Subject subject   = _course.Subjects.FirstOrDefault(s => s.Id == subjectId);

                //Si la asignatura no tiene profesor asignado, no se puede crear una clase
                if (subject.Teacher is null)
                {
                    string message = "No puedes crear esta clase porque la asignatura "
                                     + subject.Name + " no tiene profesor asignado.";
                    CustomErrorMessageWindow dialog = new CustomErrorMessageWindow(message);
                    dialog.ShowDialog();
                }
                else
                {
                    try
                    {
                        SchoolClass schoolClass = new SchoolClass()
                        {
                            Course   = _course,
                            Day      = _day,
                            Schedule = _schedule,
                            Subject  = subject
                        };

                        //El cliente http retorna la misma clase creada
                        schoolClass = await SchoolClassHttpService.Save(schoolClass);

                        this.Close();

                        this.OnSchoolClassCreatedDelegate(schoolClass);
                    }
                    catch (ServerErrorException ex)
                    {
                        new CustomErrorMessageWindow(ex.Message).ShowDialog();
                    }
                }
            }
        }
        /// <summary>
        ///     Evento al pulsar Conectarse
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void buttonSignIn_Click(object sender, EventArgs e)
        {
            Admin admin = new Admin
            {
                AdminName = this.textBoxAdmin.Text,
                Password  = this.textBoxPassword.Text
            };

            try
            {
                //Envia las credenciales al cliente http
                await SignInHttpService.SignIn(admin);

                //Se oculta este formulario y se abre la aplicacion principal
                this.Visible = false;
                new MainAppForm().ShowDialog();
            }
            catch (ServerErrorException ex)
            {
                string message = ex.Message;
                CustomErrorMessageWindow dialog = new CustomErrorMessageWindow(message);
                dialog.ShowDialog();
            }
        }