コード例 #1
0
        private void Visualiser_Click(object sender, EventArgs e)
        {
            Fiche_Bien fb = new Fiche_Bien();

            fb.Show(this);
            this.Hide();
        }
コード例 #2
0
        private void Button_Annuler_MouseClick(object sender, MouseEventArgs e)
        {
            textBox1.Text = ApplicationState.id_bien;
            Fiche_Bien fb = new Fiche_Bien();

            fb.Show(this);
            this.Hide();
        }
コード例 #3
0
        private void Visualiser_Click(object sender, EventArgs e)
        {
            ApplicationState.id_bien = id_bien_selectionne;
            Fiche_Bien fb = new Fiche_Bien();

            fb.Show(this);
            this.Hide();
        }
コード例 #4
0
        private void Button_Valider_MouseClick(object sender, MouseEventArgs e)
        {
            //string nomBase = "IMMOBILLY_JACKYTEAM";
            string          ChaineBd     = "Provider=SQLOLEDB;Data Source=INFO-joyeux;Initial Catalog=IMMOBILLY_JACKYTEAM;Persist Security Info=True; Integrated Security=sspi;";
            OleDbConnection dbConnection = new OleDbConnection(ChaineBd);

            dbConnection.Open();

            DateTime a       = dateTimePicker1.Value;
            string   statuts = " ";

            if (Disponible.Checked == true)
            {
                statuts           = "D";
                Sous_Sein.Checked = false;
                Retire.Checked    = false;
                Vendu.Checked     = false;
            }

            else if (Sous_Sein.Checked == true)
            {
                statuts            = "S";
                Disponible.Checked = false;
                Vendu.Checked      = false;
                Retire.Checked     = false;
            }


            else if (Vendu.Checked == true)
            {
                statuts            = "V";
                Disponible.Checked = false;
                Sous_Sein.Checked  = false;
                Retire.Checked     = false;
            }


            else if (Retire.Checked == true)
            {
                statuts            = "R";
                Disponible.Checked = false;
                Sous_Sein.Checked  = false;
                Vendu.Checked      = false;
            }

            string garage = " ";
            string cave   = " ";

            if (Garage.Checked == true)
            {
                garage = "true";
            }

            if (Cave.Checked == true)
            {
                cave = "true";
            }
            string sql = "UPDATE Bien SET Surface_habitable ='" + textBox2.Text + "', Surface_parcelle ='" + textBox3.Text + "' ,Nb_piéces ='" + numericUpDown1.Value + "', Nb_chambres ='" + numericUpDown2.Value + "' , Nb_Salle_de_bain ='" + numericUpDown3.Value + "' , Garage ='" + garage + "' , Cave ='" + cave + "' , Prix_vendeur ='" + textBox4.Text + "' ,Adresse ='" + textBox12.Text + "', Date_Mise_en_Vente = '" + dateTimePicker1.Value + "' ,Commentaire = '" + textBox9.Text.Replace("'", "''") + "',Statut = '" + statuts + "'  , code_ville = (select code_ville from ville where upper(nom_ville) = '" + textBox11.Text + "' and Code_Postal = '" + textBox10.Text + "') WHERE Code_bien = '" + textBox1.Text + "' ";


            OleDbCommand cmd = new OleDbCommand(sql, dbConnection);

            cmd.ExecuteNonQuery();
            MessageBox.Show("Saved");

            textBox1.Text = ApplicationState.id_bien;
            Fiche_Bien fb = new Fiche_Bien();

            fb.Show(this);
            this.Hide();
        }