/// <summary>
 /// Evénement déclenché lors du Load du formulaire
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmAddEntry_Load(object sender, EventArgs e)
 {
     frm = (frmAppli)this.Owner;
     _infoParam = frm.GetParam();
     p_isScheduled = false;
     lblErr.Text = "";
     dateDebutPicker.Enabled = false;
     dateFinPicker.Enabled = false;
     chkFullDay.Enabled = false;
     txtHeureDebut.Text = "0800";
     txtHeureFin.Text = "1700";
     cmbPhotographe.Enabled = false;
     txtHeureDebut.Enabled = false;
     txtHeureFin.Enabled = false;
     chkConfirm.Enabled = false;
     if (cmbPhotographe.Items.Count == 0)
     {
         for (int i = 0; i < _infoParam.ListPhotographe.Count; i++)
         {
             cmbPhotographe.Items.Add(_infoParam.ListPhotographe[i].Nom);
         }
     }
     if (_infoParam.ListPhotographe.Count == 0) { grpRdv.Enabled = false; }
     typSecteur.SelectedIndex = 0;
     // Disponibilité
     chkDay1.Checked = true;
     chkDay2.Checked = true;
     chkDay3.Checked = true;
     chkDay4.Checked = true;
     chkDay5.Checked = true;
 }
        /// <summary>
        /// sauvegarde du paramétrage dans la Registry
        /// </summary>
        /// <param name="_param"></param>
        public static void SetParamIntoRegistry(Parametrage _param)
        {
            Log.Debug("Sauvegarde des informations dans la Registry");

            Registry.SetValue(Constantes.HKEY_PARAM, "PKey", _param.PrivateKey);
            Registry.SetValue(Constantes.HKEY_PARAM, "GAccount", _param.GoogleAccount);
            Registry.SetValue(Constantes.HKEY_PARAM, "PxTicketMoyen", _param.PrixTicketMoyen);
            Registry.SetValue(Constantes.HKEY_PARAM, "PxFullPch", _param.PrixPochetteCompl);
            Registry.SetValue(Constantes.HKEY_PARAM, "PxWoGrpPch", _param.PrixPochetteSansGroupe);
            Registry.SetValue(Constantes.HKEY_PARAM, "PxOnlyGrpPch", _param.PrixPochetteGroupSeul);
            Registry.SetValue(Constantes.HKEY_PARAM, "DefaultFile", _param.DefaultFile);
            Registry.SetValue(Constantes.HKEY_ROOT, "MailFrom", _param.MailFrom);

            Registry.SetValue(Constantes.HKEY_PARAM, "isGoogleAct", _param.IsGoogleActivate);

            Registry.SetValue(Constantes.HKEY_PARAM + @"\AdresseLabo\", "NomLabo", _param.AdresseLabo.NomLabo);
            Registry.SetValue(Constantes.HKEY_PARAM + @"\AdresseLabo\", "ZoneGeo", _param.AdresseLabo.ZoneGeo);
            Registry.SetValue(Constantes.HKEY_PARAM + @"\AdresseLabo\", "Voie", _param.AdresseLabo.Voie);
            Registry.SetValue(Constantes.HKEY_PARAM + @"\AdresseLabo\", "CodePostal", _param.AdresseLabo.CodePostal);
            Registry.SetValue(Constantes.HKEY_PARAM + @"\AdresseLabo\", "Ville", _param.AdresseLabo.Ville);

            // Liste des Photographes
            foreach (Photographe _photo in _param.ListPhotographe)
            {
                Registry.SetValue(Constantes.HKEY_PARAM + @"\ListPhotos\" + _photo.IdPhotographe, "Nom", _photo.Nom);
                Registry.SetValue(Constantes.HKEY_PARAM + @"\ListPhotos\" + _photo.IdPhotographe, "Argb", _photo.ARGB.ToString());
                Registry.SetValue(Constantes.HKEY_PARAM + @"\ListPhotos\" + _photo.IdPhotographe, "IdCal", _photo.IdGoogleCalendar);
                Registry.SetValue(Constantes.HKEY_PARAM + @"\ListPhotos\" + _photo.IdPhotographe, "EMail", _photo.EMailPhotograph);
                Registry.SetValue(Constantes.HKEY_PARAM + @"\ListPhotos\" + _photo.IdPhotographe, "Adresse", _photo.Adresse);
                Registry.SetValue(Constantes.HKEY_PARAM + @"\ListPhotos\" + _photo.IdPhotographe, "CodePostal", _photo.CodePostal);
                Registry.SetValue(Constantes.HKEY_PARAM + @"\ListPhotos\" + _photo.IdPhotographe, "Localite", _photo.Localite);
            }
            // Liste des périodes
            foreach (Periode _periode in _param.ListPeriode)
            {
                Registry.SetValue(Constantes.HKEY_PARAM + @"\ListPeriodes\" + _periode.Libelle, "StartDate", _periode.StartDate);
                Registry.SetValue(Constantes.HKEY_PARAM + @"\ListPeriodes\" + _periode.Libelle, "EndDate", _periode.EndDate);
            }
            // Modèles
            ClassOutils.SetParamModelsIntoRegistry(_param);
        }
 /// <summary>
 /// Sauvegarde des MODEL dans la Registry
 /// </summary>
 /// <param name="_param"></param>
 public static void SetParamModelsIntoRegistry(Parametrage _param)
 {
     Log.Debug("Sauvegarde des Models dans la Registry");
     foreach (InfosModels _infoModel in _param.MailContents.ListModels)
     {
         Log.Debug("---> Model {" + _infoModel.Id + "} ");
         Registry.SetValue(Constantes.HKEY_PARAM + @"\ListMailContents\" + _infoModel.Id, "Type", _infoModel.Type);
         Registry.SetValue(Constantes.HKEY_PARAM + @"\ListMailContents\" + _infoModel.Id, "Object", _infoModel.Object);
         Registry.SetValue(Constantes.HKEY_PARAM + @"\ListMailContents\" + _infoModel.Id, "Path", _infoModel.Path);
         Registry.SetValue(Constantes.HKEY_PARAM + @"\ListMailContents\" + _infoModel.Id, "Id", _infoModel.Id);
     }
 }
        /// <summary>
        /// Récupération des données depuis la registry
        /// </summary>
        public static bool GetParamFromRegistry(Parametrage _param)
        {
            Log.Debug("Récupération des paramètres depuis la Registry");
            // On récupère les paramètres depuis la base de registres
            _param.PrivateKey = (string)Registry.GetValue(Constantes.HKEY_PARAM, "PKey", String.Empty) ?? String.Empty;
            _param.GoogleAccount = (string)Registry.GetValue(Constantes.HKEY_PARAM, "GAccount", String.Empty) ?? String.Empty;
            _param.PrixTicketMoyen = (string)Registry.GetValue(Constantes.HKEY_PARAM, "PxTicketMoyen", String.Empty) ?? String.Empty;
            _param.PrixPochetteCompl = (string)Registry.GetValue(Constantes.HKEY_PARAM, "PxFullPch", String.Empty) ?? String.Empty;
            _param.PrixPochetteSansGroupe = (string)Registry.GetValue(Constantes.HKEY_PARAM, "PxWoGrpPch", String.Empty) ?? String.Empty;
            _param.PrixPochetteGroupSeul = (string)Registry.GetValue(Constantes.HKEY_PARAM, "PxOnlyGrpPch", String.Empty) ?? String.Empty;
            _param.DefaultFile = (string)Registry.GetValue(Constantes.HKEY_PARAM, "DefaultFile", String.Empty) ?? String.Empty;
            _param.MailFrom = (string)Registry.GetValue(Constantes.HKEY_ROOT, "MailFrom", String.Empty) ?? String.Empty;

            _param.AdresseLabo.NomLabo = (string)Registry.GetValue(Constantes.HKEY_PARAM + @"\AdresseLabo", "NomLabo", String.Empty) ?? String.Empty;
            _param.AdresseLabo.ZoneGeo = (string)Registry.GetValue(Constantes.HKEY_PARAM + @"\AdresseLabo", "ZoneGeo", String.Empty) ?? String.Empty;
            _param.AdresseLabo.Voie = (string)Registry.GetValue(Constantes.HKEY_PARAM + @"\AdresseLabo", "Voie", String.Empty) ?? String.Empty;
            _param.AdresseLabo.CodePostal = (string)Registry.GetValue(Constantes.HKEY_PARAM + @"\AdresseLabo", "CodePostal", String.Empty) ?? String.Empty;
            _param.AdresseLabo.Ville = (string)Registry.GetValue(Constantes.HKEY_PARAM + @"\AdresseLabo", "Ville", String.Empty) ?? String.Empty;

            bool _boolValue;
            if (Boolean.TryParse((string)Registry.GetValue(Constantes.HKEY_PARAM, "isGoogleAct", "False"), out _boolValue)) { _param.IsGoogleActivate = _boolValue; }
            else { _param.IsGoogleActivate = false; }
            return true;
        }
Example #5
0
 /// <summary>
 /// Constructeur
 /// </summary>
 /// <param name="_infoEcole"></param>
 /// <param name="param"></param>
 public docToPrint(Ecole _infoEcole, Parametrage param)
     : base()
 {
     p_infoEcole = _infoEcole;
     p_param = param;
 }