예제 #1
0
        private void buttonConnexion_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.textBoxBDD.Text == "" && this.textBoxServer.Text == "")
                {
                    persitanceContact = new PersitanceContact(ConfigurationManager.ConnectionStrings["papyrus"].ConnectionString);
                    persitanceContact.Open();
                    labelStateConnexion.Text = "Open";
                }
                else
                {
                    throw new ArgumentException();
                }
            }
            catch (Exception e1)
            {
                textBoxLogs.Visible      = true;
                textBoxLogs.Text         = e1.Message;
                labelStateConnexion.Text = "Error";
                if (persitanceContact != null)
                {
                    persitanceContact.Close();
                }

                Trace.TraceError(DateTime.Now + " Tentative de connection échouée : " + textBoxBDD.Text + ":" + textBoxServer.Text);
            }

            Trace.Flush();
        }
예제 #2
0
        public AffichageFournisseur(int id)
        {
            InitializeComponent();
            createMode = false;

            this.id = id;

            this.persitanceContact = new PersitanceContact(ConfigurationManager.ConnectionStrings["papyrus"].ConnectionString);

            Contact contact = new Contact(persitanceContact.GetContact(id));

            textBoxNom.Text = contact.nom;

            textBoxNumRue.Text = contact.num_rue;

            textBoxRue.Text = contact.rue;

            textBoxCP.Text = contact.code_postal;

            textBoxVille.Text = contact.ville;

            textBoxContact.Text = contact.personne_contact;

            textBoxSatisfaction.Text = contact.satisfaction.ToString();
        }
예제 #3
0
        public AffichageFournisseur()
        {
            InitializeComponent();
            createMode          = true;
            this.buttonMAJ.Text = "Créer";

            this.persitanceContact = new PersitanceContact(ConfigurationManager.ConnectionStrings["papyrus"].ConnectionString);
        }
예제 #4
0
 public SupressForm()
 {
     numero = -1;
     InitializeComponent();
     persitanceContact = new PersitanceContact(ConfigurationManager.ConnectionStrings["papyrus"].ConnectionString);
 }
예제 #5
0
 public RechercheFournisseurs()
 {
     InitializeComponent();
     this.persitanceContact = new PersitanceContact(ConfigurationManager.ConnectionStrings["papyrus"].ConnectionString);
 }