Exemplo n.º 1
0
    void ToggleValueChanged(Toggle change)
    {
        Objets temp = model.Objets.Find(r => r.Modification == true);
        Item   item = model.Forme.Find(r => r.Nom == change.name);

        //Debug.Log("item name : " + item.Nom);
        if (change.isOn)
        {
            if (temp.FormeInactive.Contains(item.ID))
            {
                temp.FormeInactive.Remove(item.ID);
            }
            if (!temp.FormeActive.Contains(item.ID))
            {
                temp.FormeActive.Add(item.ID);
            }
        }
        else
        {
            if (temp.FormeActive.Contains(item.ID))
            {
                temp.FormeActive.Remove(item.ID);
            }
            if (!temp.FormeInactive.Contains(item.ID))
            {
                temp.FormeInactive.Add(item.ID);
            }
        }
    }
    void ToggleValueChanged(Toggle change)
    {
        //Debug.Log("game object name : " + change.name);
        Objets temp = model.Objets.Find(r => r.Nom == change.name);

        temp.Modification = change.isOn;
    }
    void ToggleSousMateriauxValueChanged(Toggle change)
    {
        Objets temp = model.Objets.Find(r => r.Modification == true);
        Item   item = model.SousMateriaux.Find(r => r.Nom == change.name);

        //Debug.Log("item name : " + item.Nom);
        if (change.isOn)
        {
            if (temp.SousMateriauxInactif.Contains(item.ID))
            {
                temp.SousMateriauxInactif.Remove(item.ID);
            }
            if (!temp.SousMateriauxActif.Contains(item.ID))
            {
                temp.SousMateriauxActif.Add(item.ID);
            }
        }
        else
        {
            if (temp.SousMateriauxActif.Contains(item.ID))
            {
                temp.SousMateriauxActif.Remove(item.ID);
            }
            if (!temp.SousMateriauxInactif.Contains(item.ID))
            {
                temp.SousMateriauxInactif.Add(item.ID);
            }
        }
    }
    void load_Objets()
    {
        string[] file_line = load_File(OBJETS_FILENAME);

        string Header = null;

        int size = file_line.Length;
        //Debug.Log("Number of line of the configuration file : " + size);
        int marker = 0;

        for (int i = 0; i < size; i++)
        {
            string[] elements = file_line[i].Split(';');
            if (elements[0].CompareTo("") != 0)
            {
                Header = elements[0];
                marker = i;
                //Debug.Log("header : " + Header);
                //Debug.Log(Header.CompareTo("Question"));
                //Debug.Log("i : " + i + " ; marker : " + marker);
            }
            if (Header.CompareTo("Objets") == 0 && i > marker)
            {
                Objets temp = new Objets();
                temp.ID  = int.Parse(elements[1]);
                temp.Nom = elements[2];
                string[] forme;
                for (int j = 3; j < elements.Length - 1; j++)
                {
                    //Debug.Log("element j : " + elements[j]);
                    List <int> liste = new List <int>();

                    if (elements[j].CompareTo("") != 0)
                    {
                        //Debug.Log("element j : " + elements[j]);
                        forme = elements[j].Split(',');
                        foreach (string thing in forme)
                        {
                            liste.Add(int.Parse(thing));
                        }
                    }
                    switch (j)
                    {
                    case 3:
                        temp.Justification_materiel = liste;
                        break;

                    case 4:
                        temp.Coherence_materiel_technique_outils = liste;
                        break;

                    default:
                        break;
                    }
                }
                temp.Image = elements[5];
                Objets.Add(temp);
            }
        }
    }
Exemplo n.º 5
0
        private void button51_Click(object sender, EventArgs e)
        {
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "SQLServer", textBox19.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "TypeServeur", comboBox2.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "SQLUser", textBox18.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "SQLPassword", textBox17.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "SQLAuthModeWindows", checkBox15.Checked);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "SBODbCompany", comboBox3.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "LicenceServer", comboBox1.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "SBOUser", textBox16.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "SBOPassword", textBox15.Text);
            try
            {
                this.Cursor = Cursors.WaitCursor;
                int Connexion = Parametres.ConnectSqlSap(textBox19.Text, comboBox2.Text, textBox18.Text, textBox17.Text, comboBox3.Text, textBox16.Text, textBox15.Text, comboBox1.Text);

                if (Connexion != 0)
                {
                    Interaction.MsgBox("Connexion échouée : ", MsgBoxStyle.Exclamation, this.Text);
                }
                else
                {
                    Interaction.MsgBox("Connexion réussie.", MsgBoxStyle.Information, this.Text);
                }

                this.Cursor = Cursors.Default;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                Interaction.MsgBox(string.Concat("Exception lors du test : ", exception.Message, "\r\n", exception.StackTrace), MsgBoxStyle.OkOnly, null);
                ProjectData.ClearProjectError();
            }
        }
        private void PlanificationArticlesKnco_Load(object sender, EventArgs e)
        {
            foreach (string item in Parametres.list)
            {
                comboBox1.Items.Add(item);
            }

            try
            {
                comboBox1.SelectedItem = Parametres.list.First();
                if (Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "intervalArticleKnco", "", null)) != null)
                {
                    label6.Text   = "Le " + Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "dayArticleKncos", "", null)) + "/" + Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "monthArticleKncos", "", null)) + "/" + Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "yearArticleKncos", "", null)) + " a " + Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "hourArticleKncos", "", null)) + ":" + Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "minArticleKncos", "", null));
                    textBox1.Text = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "intervalArticleKnco", "", null));
                    dataGridView1.Rows.Add(Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "debutArticleKnco", "", null)), Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "finArticleKnco", "", null)));
                    comboBox1.SelectedItem = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "intervalMinOrHourArticleKnco", "", null));
                    if ("MON" == Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "LundiArticleKnco", "", null)))
                    {
                        checkBox1.Checked = true;
                    }
                    if ("TUE" == Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "MardiArticleKnco", "", null)))
                    {
                        checkBox2.Checked = true;
                    }
                    if ("WED" == Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "MecrediArticleKnco", "", null)))
                    {
                        checkBox3.Checked = true;
                    }
                    if ("THU" == Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "JeudiArticleKnco", "", null)))
                    {
                        checkBox4.Checked = true;
                    }
                    if ("FRI" == Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "VendrediArticleKnco", "", null)))
                    {
                        checkBox5.Checked = true;
                    }
                    if ("SAT" == Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "SamediArticleKnco", "", null)))
                    {
                        checkBox6.Checked = true;
                    }
                    if ("SUN" == Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "DimancheArticleKnco", "", null)))
                    {
                        checkBox7.Checked = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 7
0
        private void button50_Click(object sender, EventArgs e)
        {
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "Databasetest", textBox7.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "ServeurMySqltest", textBox8.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "UserMySqltest", textBox13.Text);
            Objets.LocalSaveSetting("B1-Prestashop", "Config", "PassMySqltest", Objets.StrCrypt(textBox14.Text, Conversions.ToString(b1Prestashop_Tools.cleCrypt)));
            bool Connexion = Parametres.Openconnection(textBox8.Text, textBox13.Text, textBox14.Text, textBox7.Text);

            if (!Connexion)
            {
                Interaction.MsgBox("Connexion échouée : ", MsgBoxStyle.Exclamation, this.Text);
            }
            else
            {
                Interaction.MsgBox("Connexion réussie.", MsgBoxStyle.Information, this.Text);
            }
        }
Exemplo n.º 8
0
        private void Form1_Load(object sender, EventArgs e)
        {
            textBox11.Text = (string)Parametres.key.GetValue("ServeurMySql" + textBox12.Text);
            textBox10.Text = (string)Parametres.key.GetValue("UserMySql" + textBox12.Text);
            textBox9.Text  = (string)Parametres.key.GetValue("PassMySql" + textBox12.Text);

            //sap-sql
            textBox19.Text         = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "SQLServer", "", null));
            comboBox2.SelectedItem = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "TypeServeur", "", null));
            textBox18.Text         = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "SQLUser", "", null));
            textBox17.Text         = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "SQLPassword", "", null));
            if (Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "SQLAuthModeWindows", "", null)) != "False")
            {
                checkBox15.Checked = true;
            }
            else
            {
                checkBox15.Checked = false;
            }
            comboBox3.SelectedItem = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "SBODbCompany", "", null));
            comboBox1.SelectedItem = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "LicenceServer", "", null));
            textBox16.Text         = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "SBOUser", "", null));
            textBox15.Text         = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "SBOPassword", "", null));

            //mysql
            textBox7.Text  = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "Databasetest", "", null));
            textBox8.Text  = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "ServeurMySqltest", "", null));
            textBox13.Text = Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "UserMySqltest", "", null));
            textBox14.Text = Objets.StrDecrypt(Conversions.ToString(Objets.GlobalGetSettingtest("B1-Prestashop", "Config", "PassMySqltest", "", null)), Conversions.ToString(b1Prestashop_Tools.cleCrypt), false);
            Parametres.startservice("formload");
            if ("1" == ((string)Parametres.key.GetValue("active")))
            {
                pictureBox1.BackgroundImage = Properties.Resources.Cute_Ball_Go_icon_V;
                button26.Enabled            = false;
                button25.Enabled            = true;
            }
            else
            {
                pictureBox1.BackgroundImage = Properties.Resources.Cute_Ball_Shutdown_icon_R;
                button25.Enabled            = false;
                button26.Enabled            = true;
            }
        }
Exemplo n.º 9
0
            public void AddLog(string pMessage, clsGeneralSetting.Logger.En_LogDetail pLevel)
            {
                string[] strArrays = new string[] { Strings.Format(DateTime.Now, "yyyy/MM/dd HH:mm:ss"), " - ", pLevel.ToString(), " - ", pMessage };
                string   str       = string.Concat(strArrays);

                if (this.EventSource != null && (int)pLevel <= this.LogEventSourceLevel)
                {
                    if (Operators.CompareString(clsGeneralSetting.Logger.ELog.Source, "", false) == 0)
                    {
                        clsGeneralSetting.Logger.ELog.Source = this.EventSource;
                    }
                    if (!EventLog.SourceExists(clsGeneralSetting.Logger.ELog.Source))
                    {
                        EventLog.CreateEventSource(clsGeneralSetting.Logger.ELog.Source, string.Concat("Log", clsGeneralSetting.Logger.ELog.Source));
                    }
                    switch (pLevel)
                    {
                    case clsGeneralSetting.Logger.En_LogDetail.A_Erreurs_Critiques:
                    case clsGeneralSetting.Logger.En_LogDetail.B_Erreurs:
                    {
                        clsGeneralSetting.Logger.ELog.WriteEntry(pMessage, EventLogEntryType.Error);
                        break;
                    }

                    case clsGeneralSetting.Logger.En_LogDetail.C_Avertissements:
                    {
                        clsGeneralSetting.Logger.ELog.WriteEntry(pMessage, EventLogEntryType.Warning);
                        break;
                    }

                    default:
                    {
                        clsGeneralSetting.Logger.ELog.WriteEntry(pMessage, EventLogEntryType.Information);
                        break;
                    }
                    }
                }
                string str1 = Conversions.ToString(0);

                while (true)
                {
                    try
                    {
                        str1 = Conversions.ToString(Conversions.ToDouble(str1) + 1);
                        if (this.LogInFile & (int)pLevel <= this.LogInFileLevel)
                        {
                            if (!Directory.Exists(this.LogDirectory))
                            {
                                Directory.CreateDirectory(this.LogDirectory);
                            }
                            Objets.FileWrite(this.FileLogName, string.Concat(str, "\r\n"), true, false, null);
                        }
                        break;
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        if (Conversions.ToDouble(str1) != 1)
                        {
                            if (this.EventSource != null)
                            {
                                clsGeneralSetting.Logger.ELog.WriteEntry(string.Concat("Inscription dans le fichier de log impossible : ", exception.Message), EventLogEntryType.Warning);
                            }
                            ProjectData.ClearProjectError();
                            break;
                        }
                        else
                        {
                            Thread.Sleep(100);
                            ProjectData.ClearProjectError();
                        }
                    }
                }
                if (this.LogInMail && (int)pLevel <= this.LogInMailLevel)
                {
                    this.MailLog.Append(string.Concat(str, "\r\n"));
                }
                try
                {
                    if (this.LogInSBOTOOLS)
                    {
                        SBOTools.AddLog(pMessage, (int)pLevel);
                    }
                    if (this.LogInADO & (int)pLevel <= this.LogInADOLevel)
                    {
                        strArrays = new string[] { "begin tran\r\ndeclare @NextCode as varchar(8) ;\r\nselect @NextCode=cast(coalesce(Max(cast(Code as int)),0)+1 as varchar(8)) FROM [@MG2S_SBOTLog] updlock ; \r\nselect @NextCode=stuff('00000000',9-len(@NextCode),len(@NextCode),@NextCode) ; \r\ninsert into [@MG2S_SBOTLog] (Code,Name, U_DateTime, U_UserName,U_HostName,U_Details, U_Level) VALUES (@NextCode, @NextCode, '", Objets.StrClean(Strings.Format(DateTime.Now, "yyyy-MM-dd HH:mm:ss")), "', '", Objets.StrClean(Environment.UserName), "','", Objets.StrClean(Environment.MachineName), "','", Objets.StrClean(pMessage), "',", pLevel.ToString(), ") ;\r\ncommit" };
                        string     str2  = string.Concat(strArrays);
                        Connection aDOCN = this.ADOCN;
                        object     value = Missing.Value;
                        aDOCN.Execute(str2, out value, -1);
                    }
                }
                catch (Exception exception3)
                {
                    ProjectData.SetProjectError(exception3);
                    Exception exception2 = exception3;
                    if (this.EventSource != null)
                    {
                        clsGeneralSetting.Logger.ELog.WriteEntry(string.Concat("Inscription des logs dans SBO / ADO  impossible : ", exception2.Message), EventLogEntryType.Warning);
                    }
                    ProjectData.ClearProjectError();
                }
            }
    void load_currentState()
    {
        string[] file_line = load_File(CURRENTSTATE_FILENAME);

        string Header = null;

        int size = file_line.Length;
        //Debug.Log("Number of line of the configuration file : " + size);
        int marker = 0;

        for (int i = 0; i < size; i++)
        {
            string[] elements = file_line[i].Split(';');
            if (elements[0].CompareTo("") != 0)
            {
                Header = elements[0];
                marker = i;
            }
            else if (Header.CompareTo("Objet") == 0 && i > marker)
            {
                //Debug.Log("in object");

                Objets   temp = Objets.Find(r => r.ID == int.Parse(elements[1]));
                string[] forme;
                for (int j = 2; j < elements.Length - 1; j++)
                {
                    //Debug.Log("element j : " + elements[j]);
                    List <int> liste = new List <int>();

                    if (elements[j].CompareTo("") != 0)
                    {
                        //Debug.Log("element j : " + elements[j]);
                        forme = elements[j].Split(',');
                        foreach (string thing in forme)
                        {
                            liste.Add(int.Parse(thing));
                        }
                    }
                    switch (j)
                    {
                    case 2:
                        temp.FormeActive = liste;
                        break;

                    case 3:
                        temp.FormeInactive = liste;
                        break;

                    case 4:
                        temp.TailleActive = liste;
                        break;

                    case 5:
                        temp.TailleInactive = liste;
                        break;

                    case 6:
                        temp.MateriauxActif = liste;
                        break;

                    case 7:
                        temp.MateriauxInactif = liste;
                        break;

                    case 8:
                        temp.SousMateriauxActif = liste;
                        break;

                    case 9:
                        temp.SousMateriauxInactif = liste;
                        break;

                    case 10:
                        temp.OutilsActif = liste;
                        break;

                    case 11:
                        temp.OutilsInactif = liste;
                        break;

                    case 12:
                        temp.TechniqueActive = liste;
                        break;

                    case 13:
                        temp.TechniqueInactive = liste;
                        break;

                    case 14:
                        temp.AssociationJustification = liste;
                        break;

                    default:
                        break;
                    }
                }
                temp.Modification = bool.Parse(elements[15]);
            }
            else if (Header.CompareTo("Association_justification") == 0 && i > marker)
            {
                //Debug.Log("in association justification");

                Association_justification temp = new Association_justification();
                temp.ID        = int.Parse(elements[1]);
                temp.Materiaux = int.Parse(elements[2]);

                for (int j = 3; j < elements.Length - 1; j++)
                {
                    List <int> liste = new List <int>();
                    if (elements[j].CompareTo("") != 0)
                    {
                        string[] forme = elements[j].Split(',');
                        foreach (string thing in forme)
                        {
                            liste.Add(int.Parse(thing));
                        }
                    }
                    switch (j)
                    {
                    case 3:
                        temp.JustificationActive = liste;
                        break;

                    case 4:
                        temp.JustificaionInactive = liste;
                        break;

                    default:
                        break;
                    }
                }
                AssociationJustifications.Add(temp);
            }
            else if (Header.CompareTo("Question") == 0 && i > marker)
            {
                Question temp = new Question();
                Debug.Log("Element 1 : " + elements[1]);
                temp.ID          = int.Parse(elements[1]);
                temp.Nom         = elements[2];
                temp.Description = elements[3];
                if (elements[4] != null)
                {
                    temp.Reponse = elements[4];
                }
                else
                {
                    temp.Reponse = "";
                }
                temp.Modification = bool.Parse(elements[5]);
                Questions.Add(temp);
            }
        }
    }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Parametres.jours.Clear();
                TimeSpan tstar = TimeSpan.Parse(dataGridView1.Rows[0].Cells[0].Value.ToString());
                TimeSpan tend  = TimeSpan.Parse(dataGridView1.Rows[0].Cells[1].Value.ToString());
                if (tstar.CompareTo(tend) == -1)
                {
                    if (Parametres.key.GetValue("intervalArticleKnco") != null)
                    {
                        Parametres.deleteKey(Parametres.ValueKeyArticleKnco);
                        Parametres.ValueKeyArticleKnco.Clear();
                    }



                    if (!string.IsNullOrWhiteSpace(textBox1.Text))
                    {
                        if (comboBox1.SelectedItem != null)
                        {
                            Objets.LocalSaveSetting("B1-Prestashop", "Config", "intervalArticleKnco", textBox1.Text.ToString());
                            Objets.LocalSaveSetting("B1-Prestashop", "Config", "intervalMinOrHourArticleKnco", comboBox1.SelectedItem);
                            Objets.LocalSaveSetting("B1-Prestashop", "Config", "debutArticleKnco", dataGridView1.Rows[0].Cells[0].Value.ToString());
                            Objets.LocalSaveSetting("B1-Prestashop", "Config", "finArticleKnco", dataGridView1.Rows[0].Cells[1].Value.ToString());
                            Parametres.ValueKeyArticleKnco.Add("intervalArticleKnco");
                            Parametres.ValueKeyArticleKnco.Add("intervalMinOrHourArticleKnco");
                            Parametres.ValueKeyArticleKnco.Add("debutArticleKnco");
                            Parametres.ValueKeyArticleKnco.Add("finArticleKnco");
                            if (checkBox1.Checked)
                            {
                                Parametres.jours.Add(new jours()
                                {
                                    Name = "LundiArticleKnco", variable = "MON"
                                });
                            }
                            if (checkBox2.Checked)
                            {
                                Parametres.jours.Add(new jours()
                                {
                                    Name = "MardiArticleKnco", variable = "TUE"
                                });
                            }
                            if (checkBox3.Checked)
                            {
                                Parametres.jours.Add(new jours()
                                {
                                    Name = "MecrediArticleKnco", variable = "WED"
                                });
                            }
                            if (checkBox4.Checked)
                            {
                                Parametres.jours.Add(new jours()
                                {
                                    Name = "JeudiArticleKnco", variable = "THU"
                                });
                            }
                            if (checkBox5.Checked)
                            {
                                Parametres.jours.Add(new jours()
                                {
                                    Name = "VendrediArticleKnco", variable = "FRI"
                                });
                            }
                            if (checkBox6.Checked)
                            {
                                Parametres.jours.Add(new jours()
                                {
                                    Name = "SamediArticleKnco", variable = "SAT"
                                });
                            }
                            if (checkBox7.Checked)
                            {
                                Parametres.jours.Add(new jours()
                                {
                                    Name = "DimancheArticleKnco", variable = "SUN"
                                });
                            }
                            foreach (jours jour in Parametres.jours)
                            {
                                Objets.LocalSaveSetting("B1-Prestashop", "Config", jour.Name, jour.variable);
                                Parametres.ValueKeyArticleKnco.Add(jour.Name);
                            }

                            Scheduler sc     = new Scheduler();
                            int       StratM = tstar.Minutes;
                            int       StartH = tstar.Hours;
                            int       EndM   = tend.Minutes;
                            int       EndH   = tend.Hours;

                            sc.Start(StartH, StratM, EndH, EndM, int.Parse(textBox1.Text), new JobArticlesKnco(), Parametres.jours, comboBox1.SelectedItem.ToString());
                        }
                        else
                        {
                            MessageBox.Show("Merci de Sélectionnez votre champ interval !!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Merci de remplir votre champ interval !!");
                        textBox1.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("Vérifier votre date !!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 } // fin fonction
 #region carractéristiques - méthodes
 public void nouveauSort(Objets.Parchemin parchemin)
 {
     // on vérifie qu'on ai pas déjà le sort si on l'a, on augmente son niveau
     bool aLeSort = false;
     foreach (Magie.Sort sort in m_Grimmoire)
         if (parchemin.Sortilege.Equals(sort))
         { 
             aLeSort = true;
             sort.Niveau++;
             sort.CoutMana  *= 2;
             sort.Puissance *= 2;
             break;
         }
     if (!aLeSort)
         m_Grimmoire.Add(parchemin.Sortilege);
 }
 public void ajouterElement(Objets.Objet obj)
 { m_Sac.Add(obj); }
Exemplo n.º 14
0
 public void AjouterObjet(Objet unObjet)
 {
     Objets.Add(unObjet);
     etatMajor.EnregistrerObservateur(unObjet);
 }