/// <summary> /// Chargement du Formulaire /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmItemCalendar_Load(object sender, EventArgs e) { _oldPhotographe = ""; lblErreur.Text = ""; frm = (frmAppli)this.Owner; p_applClass = frm.GetApplClass(); if (cmbPhotographe.Items.Count == 0) { for (int i = 0; i < p_applClass.Param.ListPhotographe.Count; i++) { cmbPhotographe.Items.Add(p_applClass.Param.ListPhotographe[i].Nom); if (_infoEcole._planifEnCours != null) { if (_infoEcole._planifEnCours.IdPhotographe == p_applClass.Param.ListPhotographe[i].IdPhotographe) { cmbPhotographe.SelectedIndex = i; } } } } if (_infoEcole._planifEnCours != null) { btnDeletePDV.Enabled = true; if (_infoEcole._planifEnCours.StartDate == DateTime.MinValue) { p_tsheureDebut = new TimeSpan(08, 00, 0); p_dateDebut = new DateTime(_dateSelected.Year, _dateSelected.Month, _dateSelected.Day); p_dateDebut = p_dateDebut.Date + p_tsheureDebut; p_tsheureFin = new TimeSpan(17, 00, 0); p_dateFin = new DateTime(_dateSelected.Year, _dateSelected.Month, _dateSelected.Day); p_dateFin = p_dateDebut.Date + p_tsheureFin; } else { p_tsheureDebut = new TimeSpan(_infoEcole._planifEnCours.StartDate.Hour, _infoEcole._planifEnCours.StartDate.Minute, _infoEcole._planifEnCours.StartDate.Second); p_dateDebut = _infoEcole._planifEnCours.StartDate; p_tsheureFin = new TimeSpan(_infoEcole._planifEnCours.EndDate.Hour, _infoEcole._planifEnCours.EndDate.Minute, _infoEcole._planifEnCours.EndDate.Second); p_dateFin = _infoEcole._planifEnCours.EndDate; chkConfirm.Checked = _infoEcole._planifEnCours.Confirme; } } else { btnDeletePDV.Enabled = false; p_tsheureDebut = new TimeSpan(08, 00, 0); p_dateDebut = new DateTime(_dateSelected.Year, _dateSelected.Month, _dateSelected.Day); p_dateDebut = p_dateDebut.Date + p_tsheureDebut; p_tsheureFin = new TimeSpan(17, 00, 0); p_dateFin = new DateTime(_dateSelected.Year, _dateSelected.Month, _dateSelected.Day); p_dateFin = p_dateDebut.Date + p_tsheureFin; } dateDebutPicker.Value = p_dateDebut; dateFinPicker.Value = p_dateFin; txtHeureDebut.Text = p_tsheureDebut.ToString(); txtHeureFin.Text = p_tsheureFin.ToString(); dateDebutPicker.MinDate = p_applClass.Param.GetPeriode(frm._saison).StartDate; dateDebutPicker.MaxDate = p_applClass.Param.GetPeriode(frm._saison).EndDate; // Disponibilité chkDay1.Checked = _infoEcole.getDispo(1); chkDay2.Checked = _infoEcole.getDispo(2); chkDay3.Checked = _infoEcole.getDispo(3); chkDay4.Checked = _infoEcole.getDispo(4); chkDay5.Checked = _infoEcole.getDispo(5); // Contrôle si la journée entière est planifiée if (p_tsheureDebut.Equals(new TimeSpan(08, 00, 00)) && p_tsheureFin.Equals(new TimeSpan(17, 00, 00))) { chkFullDay.Checked = true; txtHeureDebut.Enabled = false; txtHeureFin.Enabled = false; } else { chkFullDay.Checked = false; txtHeureDebut.Enabled = true; txtHeureFin.Enabled = true; } txtCode.Text = _infoEcole.IdEcole; txtLibelle.Text = _infoEcole.Libelle; txtAdresse.Text = _infoEcole.Adresse; txtCP.Text = _infoEcole.CodePostal; txtVille.Text = _infoEcole.Ville; txtTelephone.Text = _infoEcole.Telephone; if (p_modeDuplicate) { txtCode.Enabled = true; txtCode.Mask = "00000000L"; } // Informations sur le contact if (_infoEcole.Contact != null) { lstTitre.SelectedItem = _infoEcole.Contact.TitreCTC; txtNomContact.Text = String.Format("{0}", _infoEcole.Contact.NomCTC); txtFonction.Text = _infoEcole.Contact.FonctionCTC; mskTelContact.Text = _infoEcole.Contact.TelephoneCTC; mskPortContact.Text = _infoEcole.Contact.PortableCTC; mskFaxContact.Text = _infoEcole.Contact.FaxCTC; txtEmail.Text = _infoEcole.Contact.EmailCTC; rchComplements.Text = _infoEcole.Contact.ComplementsCTC; } txtPrivateInfo.Text = _infoEcole.PrivateInfo; txtNbClass.Text = _infoEcole.NbClasses; txtEffectif.Text = _infoEcole.Effectif; if (!String.IsNullOrEmpty(_infoEcole.NbClassesMaternelle)) { txtNbMaternelle.Text = _infoEcole.NbClassesMaternelle; } if (!String.IsNullOrEmpty(_infoEcole.NbClassesElementaire)) { txtNbElementaire.Text = _infoEcole.NbClassesElementaire; } if (!String.IsNullOrEmpty(_infoEcole.NbClassesCollege)) { txtNbCollege.Text = _infoEcole.NbClassesCollege; } if (_infoEcole.TypSecteur == "0") { typSecteur.SelectedIndex = 0; } else { typSecteur.SelectedIndex = 1; } this.calculPrixRevient(); // Informations sur les autres planifications grid2.BorderStyle = BorderStyle.FixedSingle; grid2.ColumnsCount = 4; grid2.FixedRows = 1; grid2.Rows.Insert(0); grid2.Selection.FocusStyle = FocusStyle.None; grid2.SelectionMode = GridSelectionMode.Row; grid2[0, 0] = new SourceGrid.Cells.ColumnHeader("Saison"); grid2[0, 1] = new SourceGrid.Cells.ColumnHeader("Du"); grid2[0, 2] = new SourceGrid.Cells.ColumnHeader("Au"); grid2[0, 3] = new SourceGrid.Cells.ColumnHeader("Photographe"); grid2.Columns.SetWidth(0, 100); grid2.Columns.SetWidth(1, 120); grid2.Columns.SetWidth(2, 120); grid2.Columns.SetWidth(3, 100); this.loadLstPlanif(); }