コード例 #1
0
ファイル: Form1.cs プロジェクト: KNC-SI/KNC-WEB-Connect
        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();
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: KNC-SI/KNC-WEB-Connect
        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);
            }
        }
コード例 #3
0
        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);
            }
        }